Mail API reference

Mail API · Templates

get/v1/workspaces/{workspace_id}/templates/{name}/versionsAuth

List the published versions of a template, newest first and cursor-paginated: content, note, author and, for a GitHub-synced version, the commit SHA.

Path parameters

workspace_id*string · uuid

Id of the workspace.

name*string

Name of the template.

Query parameters

limitinteger

Page size. Defaults to 20; values above 100 are clamped to 100.

cursorstring

Opaque cursor from the previous page's `pagination.next_cursor`. Omit for the first page.

Response · 200

data*array

Versions, newest first.

pagination*object
next_cursor*string

Opaque cursor for the next page. `null` when no more pages are available.

Example: "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0wMVQwMDowMDowMFoifQ"

has_more*boolean

True iff another page exists; if true, pass `next_cursor` on the next request.

Example: false

Example

Request

GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/templates/{name}/versions
Authorization: Bearer YOUR_TOKEN

Response

{
  "data": [
    {
      "author_type": {},
      "author_id": "00000000-0000-0000-0000-000000000000",
      "author_label": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "template_id": "00000000-0000-0000-0000-000000000000",
      "version": 0,
      "subject": "string",
      "body_html": "string",
      "body_text": "string",
      "variables_schema": {},
      "note": "string",
      "source": {},
      "source_ref": "string",
      "restored_from": 0,
      "created_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "pagination": {
    "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0wMVQwMDowMDowMFoifQ",
    "has_more": false
  }
}