Mail API reference

Mail API · Templates

get/v1/workspaces/{workspace_id}/templatesAuth

List templates / layouts / partials in a workspace, name-ascending and cursor-paginated. Filter via ?kind=template|layout|partial (default: all), ?tags=foo,bar (comma-separated), ?search=<substring of the name>.

Path parameters

workspace_id*string · uuid

Id of the workspace.

Query parameters

tagsstring

Comma-separated tag list. A template matches when any of its tags appears in the list.

kindenum (3)

Restrict to one kind. Unrecognised values are ignored (no kind filter applied), preserving the pre-pagination behaviour.

searchstring

Case-insensitive substring match on the template name.

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

The templates on this page.

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
Authorization: Bearer YOUR_TOKEN

Response

{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "workspace_id": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "kind": {},
      "subject": "string",
      "body_html": "string",
      "body_text": "string",
      "variables_schema": {},
      "tags": [
        "string"
      ],
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "source": {},
      "source_ref": "string",
      "source_synced_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "pagination": {
    "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0wMVQwMDowMDowMFoifQ",
    "has_more": false
  }
}