Templates
Docs / Control plane

Templates

List and read versions. Publishing stays with templates:sync and the panel — the API does not mint versions.

Authentication

Authorization: Bearer spw_

Requires templates:read (or templates:manage).

Endpoints

GET/v1/templates list · ?source · ?limit · ?cursor
GET/v1/templates/{id} detail + versions[]
GET/v1/templates/by-slug/{slug} same detail; slug is per-account

Worked example

curl https://spoolway.com/api/v1/templates \
  -H "Authorization: Bearer spw_…"
200 listcaptured LOCAL
{
  "data": [
    {
      "id": 1,
      "slug": "welcome",
      "name": "Welcome",
      "description": null,
      "source": "panel",
      "is_sensitive": false,
      "content_retention_days": null,
      "current_version": {
        "id": 1,
        "version": 1,
        "published_at": "2026-08-06T08:11:01+00:00"
      }
    }
  ],
  "next_cursor": null
}
200 show / by-slug
{
  "data": {
    "id": 1,
    "slug": "welcome",
    "name": "Welcome",
    "description": null,
    "source": "panel",
    "is_sensitive": false,
    "content_retention_days": null,
    "current_version": {
      "id": 1,
      "version": 1,
      "published_at": "2026-08-06T08:11:01+00:00"
    },
    "versions": [
      {
        "id": 1,
        "version": 1,
        "subject": "Hello {{ name }}",
        "body_html": "<p>Hello {{ name }}</p>",
        "body_text": "Hello {{ name }}",
        "engine": "twig",
        "variables_schema": {
          "required": [
            "name"
          ]
        },
        "git_sha": null,
        "published_at": "2026-08-06T08:11:01+00:00",
        "created_at": "2026-08-06T08:11:01+00:00"
      }
    ]
  }
}

By slug

Same detail as show-by-id, keyed on the per-account slug. The body is the same captured shape — this endpoint does not invent a second one.

curl https://spoolway.com/api/v1/templates/by-slug/welcome \
  -H "Authorization: Bearer spw_…"
200 by-slugcaptured LOCAL
{
  "data": {
    "id": 1,
    "slug": "welcome",
    "name": "Welcome",
    "description": null,
    "source": "panel",
    "is_sensitive": false,
    "content_retention_days": null,
    "current_version": {
      "id": 1,
      "version": 1,
      "published_at": "2026-08-06T08:11:01+00:00"
    },
    "versions": [
      {
        "id": 1,
        "version": 1,
        "subject": "Hello {{ name }}",
        "body_html": "<p>Hello {{ name }}</p>",
        "body_text": "Hello {{ name }}",
        "engine": "twig",
        "variables_schema": {
          "required": [
            "name"
          ]
        },
        "git_sha": null,
        "published_at": "2026-08-06T08:11:01+00:00",
        "created_at": "2026-08-06T08:11:01+00:00"
      }
    ]
  }
}

Responses & failures

403 without the ability. Unknown id or slug on this account is 404. Slugs are per-account — the same slug on another account is a different row.