For the complete documentation index, see llms.txt. This page is also available as Markdown.

Templates

Reusable message bodies for email, SMS, and voice. Draft/publish versioning; preview and test-send before shipping. Referenced by Campaigns, Flows, and Notifications.

List available merge tags for the account/workroom.

get

Catalog for writing template bodies. Returns the three-source union the dashboard's email editor uses β€” Workroom Attributes (per-workroom contact fields), Special Attributes / Managed Links ({label} - email also accepts [label] - + {unsubscribe_url}), and Static Attributes (visits/purchases/appointments/workroom-info + mergetagstaticattributes catalog).

Also returns canonical syntax examples (single-brace, pipe defaults) and a dont list of common mistakes (Liquid double-brace, contact. namespace, invented tags). Use to avoid empty-render failures β€” a tag that doesn't resolve renders as empty string with no error.

Workroom-aware via ?workroom=<name-or-id> or the Gleantap-Workroom header. Without a scope, workroom attributes union across the account.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

filterstringOptional

Case-insensitive substring match against a tag's value or label, across all three categories.

categorystring Β· enumOptional

Narrow to one category instead of all three.

Possible values:
limitinteger Β· min: 1 Β· max: 500Optional

Cap on the Workroom Attributes group specifically (default 100, max 500). The special/static groups are always returned in full.

Default: 100
Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

The merge tag catalog.

application/json

Merge-tag catalog for the current account/workroom. Combines the same three sources the dashboard's email template editor uses. Use this to pick real field names when constructing template bodies β€” a merge tag that doesn't resolve renders as an empty string, so guessing is silent failure.

objectstring Β· enumOptionalPossible values:
workroom_idstring Β· nullableOptionalExample: wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$
notesstring[]Optional
get/templates/merge_tags
GET /v3/templates/merge_tags HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

The merge tag catalog.

{
  "object": "merge_tag_catalog",
  "workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
  "categories": [
    {
      "value": "workroom",
      "title": "text",
      "description": "text",
      "tags": [
        {
          "value": "text",
          "syntax": "text",
          "label": "text",
          "data_type": "text",
          "target": "text"
        }
      ]
    }
  ],
  "syntax": {
    "format": "single-brace",
    "defaults": "text",
    "examples": [
      {
        "template": "text",
        "renders": "text"
      }
    ],
    "dont": [
      "text"
    ]
  },
  "notes": [
    "text"
  ]
}

List template folders.

get

Backed by the dashboard's tags collection, filtered to campaign_type='template'.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

limitinteger Β· min: 1 Β· max: 100Optional

Page size. Default 25, max 100.

Default: 25
cursorstringOptional

Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

A page of folders.

application/json
objectconst: listRequired
has_morebooleanRequired

True if additional records exist beyond this page.

next_cursorstring Β· nullableRequired

Opaque cursor for the next page. Null on the last page.

prev_cursorstring Β· nullableRequired

Cursor for the previous page. Supported on listContacts and listSegmentContacts: pass it back as ?before=... to page backward; null on the first page. On every other list endpoint paging is forward-only and this is always null.

get/templates/folders
GET /v3/templates/folders HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

A page of folders.

{
  "object": "text",
  "data": [
    {
      "object": "text",
      "id": "tfd_66b3a91d0e5b7c1a4d8e2f1a",
      "name": "text",
      "template_count": 1,
      "created_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "has_more": true,
  "next_cursor": "text",
  "prev_cursor": "text"
}

Create a template folder.

post

Names must be unique within a workroom; conflicts return 409.

Requires the folder name. Optional fields fall back to a server-side default when omitted. That includes the workroom: an omitted workroom resolves to the account default, and a record created in the wrong workroom is invisible where it was expected. Half-specified records are created successfully and then have to be hunted down and fixed by hand.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body
namestring Β· min: 1Required
Responses
201

Folder created.

application/json
objectconst: template_folderOptional
idstringOptional

Template folder ID.

Example: tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$
namestringOptional
template_countintegerOptional
created_atstring Β· date-time Β· nullableOptional
post/templates/folders
POST /v3/templates/folders HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "name": "text"
}
{
  "object": "text",
  "id": "tfd_66b3a91d0e5b7c1a4d8e2f1a",
  "name": "text",
  "template_count": 1,
  "created_at": "2026-01-01T00:00:00.000Z"
}

Retrieve a template folder.

get
Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequired

Template folder ID.

Example: tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

Folder.

application/json
objectconst: template_folderOptional
idstringOptional

Template folder ID.

Example: tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$
namestringOptional
template_countintegerOptional
created_atstring Β· date-time Β· nullableOptional
get/templates/folders/{id}
GET /v3/templates/folders/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "text",
  "id": "tfd_66b3a91d0e5b7c1a4d8e2f1a",
  "name": "text",
  "template_count": 1,
  "created_at": "2026-01-01T00:00:00.000Z"
}

Rename a template folder.

patch
Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequired

Template folder ID.

Example: tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body
namestring Β· min: 1Optional
Responses
200

Updated folder.

application/json
objectconst: template_folderOptional
idstringOptional

Template folder ID.

Example: tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$
namestringOptional
template_countintegerOptional
created_atstring Β· date-time Β· nullableOptional
patch/templates/folders/{id}
PATCH /v3/templates/folders/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "name": "text"
}
{
  "object": "text",
  "id": "tfd_66b3a91d0e5b7c1a4d8e2f1a",
  "name": "text",
  "template_count": 1,
  "created_at": "2026-01-01T00:00:00.000Z"
}

Delete a template folder.

delete

Templates in the folder become unfoldered (they are not deleted).

Permanent. There is no undo and no trash to restore from. Anything that references the deleted record is affected too.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequired

Template folder ID.

Example: tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
204

Deleted.

No content

delete/templates/folders/{id}
DELETE /v3/templates/folders/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

List templates.

get

Paginated list. Common filters: ?filter[channel]=email, ?filter[status]=published, ?filter[name]=welcome (case-insensitive prefix), ?filter[tags]=onboarding. Rate limit bucket: read.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

limitinteger Β· min: 1 Β· max: 100Optional

Page size. Default 25, max 100.

Default: 25
cursorstringOptional

Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.

sortstringOptional

Comma-separated list of fields to sort by. Leading - reverses. Default -created_at. Sortable fields vary per resource; unsortable fields return 400 invalid_sort_field.

Example: -created_at,email
fieldsstringOptional

Sparse fieldset β€” comma-separated list of fields to include in the response. Reduces payload size on high-volume reads. Nested field access is not supported; request the parent object.

Example: id,email,phone,tags
Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

A page of templates.

application/json
objectconst: listRequired
has_morebooleanRequired

True if additional records exist beyond this page.

next_cursorstring Β· nullableRequired

Opaque cursor for the next page. Null on the last page.

prev_cursorstring Β· nullableRequired

Cursor for the previous page. Supported on listContacts and listSegmentContacts: pass it back as ?before=... to page backward; null on the first page. On every other list endpoint paging is forward-only and this is always null.

get/templates
GET /v3/templates HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "text",
  "data": [
    {
      "id": "tpl_6ab24872ba90b88e270b4904",
      "object": "text",
      "name": "text",
      "channel": "email",
      "status": "active",
      "version": 1,
      "subject": "text",
      "body_html": "text",
      "body_text": "text",
      "body": "text",
      "script": "text",
      "voice_id": "text",
      "from": {
        "name": "text",
        "email": "[email protected]"
      },
      "reply_to": "[email protected]",
      "variables": [
        {
          "name": "text",
          "type": "string",
          "required": false,
          "default": null,
          "description": "text"
        }
      ],
      "tags": [
        "text"
      ],
      "locale": "en-IN",
      "created_at": "2026-05-27T14:23:11.482Z",
      "updated_at": "2026-05-27T14:23:11.482Z",
      "published_at": "2026-05-27T14:23:11.482Z",
      "archived_at": "2026-05-27T14:23:11.482Z",
      "metadata": {
        "our_crm_id": "cust_884321",
        "sync_batch": "2026-05-imports"
      }
    }
  ],
  "has_more": true,
  "next_cursor": "text",
  "prev_cursor": "text"
}

Create a template.

post

Creates a new template. Like a template saved in the dashboard it is live immediately - selectable in the dashboard, campaigns, flows and the Inbox, with no publish step. channel is immutable after creation.

If the user wants this in a folder, call GET /v3/templates/folders first and let them choose from the existing list (or confirm a new one) rather than guessing a folder name.

Merge-tag format (Gleantap standard)

Use single braces ({ }), a flat field name (no contact. prefix), and a pipe for defaults. This matches the legacy Cron.php::format_field interpolator that renders every send.

  • Correct: Hi {first_name|there},

  • Correct: Your city is {data.city}

  • Correct: Membership status: {memberships.status|inactive}

  • Correct: Class on {class_date|format="M d, Y"} (date format directive - PHP date() letters; dates render in the account timezone)

  • Correct: Book here: {booking_link} (a workroom managed link, by its label)

  • Wrong: Hi {{contact.first_name}}, ... (double brace β€” this is Liquid, not Gleantap)

  • Wrong: Hi {{ first_name | default: "there" }} (Liquid filters not supported)

  • Wrong: {contact.first_name} (no contact. namespace)

  • Wrong: {cta_url} or {promo_code} or {deadline} if those aren't real contact fields β€” the tag renders as empty.

Available fields

Always available on a contact: first_name, last_name, email, phone, dob.

Under data.<key>: everything in Custom Fields (GET /v3/custom_fields). E.g. {data.favorite_color}, {data.company}.

Structured domain data (dot-path into an array's first element):

  • {memberships.status}, {memberships.type}, {memberships.renewal_date}, {memberships.next_billing_date}, {memberships.price}, {memberships.sessions_remaining}

  • {purchases.last_amount}, {purchases.all_products_purchased}

Discover the full catalog by calling GET /v3/templates/merge_tags (MCP: describeMergeTags). Returns three categories β€” Workroom Attributes (per-workroom contact fields), Special Attributes / Managed Links (short-link labels + {unsubscribe_url}), and Static Attributes (visits/purchases/appointments/workroom-info) β€” plus syntax examples and gotchas. Optional: GET /v3/segments/schema (describeSegmentSchema) has richer type/values info for segment-DSL fields, but for template merge tags prefer describeMergeTags.

A tag that doesn't resolve renders as the empty string with no error. If you need a runtime placeholder ({cta_url}, {promo_code}, {deadline}), pass it through the campaign or notification variables object at send-time β€” the interpolator checks variables before contact fields.

Content shape by channel

  • sms β€” body (plain text, ≀1600 chars, keep merge-tag budget under 30 total chars vs. carrier segment cost).

  • email β€” subject + body_html (and optional body_text for plain-text alternative). Subject supports merge tags too. Use inline CSS; external stylesheets get stripped by many email clients.

  • voice β€” script (SSML or plain text) + voice_id.

Requires the channel, subject and body content. Optional fields fall back to a server-side default when omitted. That includes the workroom: an omitted workroom resolves to the account default, and a record created in the wrong workroom is invisible where it was expected. Half-specified records are created successfully and then have to be hunted down and fixed by hand.

Names are not unique. name has no uniqueness constraint β€” two templates (even the same channel, even the same account) can share the exact same name. Template names are not unique: creating one with an existing name succeeds, after which that name no longer identifies a single template.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Idempotency-Keystring Β· max: 255Optional

A unique key (≀255 chars) chosen by the client. Replays with the same key + same body return the cached response. Replays with the same key + different body return 409 idempotency_conflict. Required on messaging sends and bulk operations; recommended elsewhere.

Example: 8e3c7a90-7c4d-4f8e-8e3c-7a907c4d4f8e
Body

Create a template (live immediately - there is no draft state). Provide channel-appropriate content (email: body_html/body_text; sms: body; voice: script + voice_id). Content can also be set later via PATCH. A content field for a DIFFERENT channel than the one being created (e.g. body on a voice template) is rejected with a 422 naming the correct field - it is never silently dropped.

Templates have no subject field, on any channel - the dashboard's template editor has no subject-line input at all (that's a campaign-level concept, not a template one). Sending subject is rejected with a 422, not silently dropped. A template's subject is chosen when it's used inside a campaign.

A content field that's present but whitespace-only (e.g. body: " ") is rejected with a 422 - omit the field instead to create an intentional empty stub.

Voice templates: voice_id is required whenever script is set - there is no default voice, so a voice template without one can never actually be used to place a call.

namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
body_htmlstringOptional
body_textstringOptional
bodystring Β· max: 1600Optional
scriptstringOptional
voice_idstringOptional

Required whenever script is set, and required before publish - there is no default voice.

reply_tostring Β· emailOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels. Prefer folder_id to place the template in a folder. If folder_id is omitted, the FIRST entry here is also resolved as a folder (id or name, find-or-create) - same fallback as folder_id, for callers that can only send tags.

localestringOptional

BCP 47 locale tag.

Example: en-IN
folder_idstringOptional

The template folder to create this template in, by id (tfd_...) or by name. An unrecognized name auto-creates a new folder - call GET /v3/templates/folders first and let the user choose from the existing list (or confirm a new one) instead of guessing a name. Omit to leave it unfoldered. Takes priority over any folder inferred from tags[0].

Responses
201

Template created (in draft status).

application/json

Reusable message body. Channel-specific content fields (email uses body_html/body_text; SMS uses body; voice uses script + voice_id). Unused fields are null. subject is read-only/legacy - see its own description.

idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
objectconst: templateRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

Templates have no draft/publish lifecycle - same as the dashboard, every saved template is live: create and PATCH take effect immediately for the dashboard, campaigns, flows and sends. active β€” every live template (email templates are stored exactly as the dashboard's Save writes them: status: "active", drafted: false). archived β€” only templates flag-archived by an older API version (DELETE now really deletes); resolvable with ?include_archived=true. Earlier API versions returned draft / published; both now read as active, and filter[status]=draft|published|active all list every live template.

Possible values:
versionintegerOptional

The template's current (live) version number. Bumped by every save, from the API or the dashboard.

published_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate published version).

draft_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate draft).

subjectstring Β· nullableOptional

Read-only legacy field - not settable via create/update. Templates have no subject line in the dashboard (that's a campaign-level concept); any value here is leftover from before that was enforced. Will be null on every template going forward.

body_htmlstring Β· nullableOptional

Email only.

body_textstring Β· nullableOptional

Email only. Recommended even when body_html is set.

bodystring Β· nullableOptional

SMS only. Max 1600 chars.

scriptstring Β· nullableOptional

Voice only. TTS script.

voice_idstring Β· nullableOptional

Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.

reply_tostring Β· email Β· nullableOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels (not contact tags).

localestring Β· nullableOptional

BCP 47 locale tag.

Example: en-IN
created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
updated_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
published_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
archived_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
post/templates
POST /v3/templates HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 431

{
  "name": "Welcome Email",
  "channel": "email",
  "subject": "Welcome, {{ contact.first_name }}!",
  "body_html": "<p>Hi {{ contact.first_name }}, thanks for joining.</p>",
  "body_text": "Hi {{ contact.first_name }}, thanks for joining.",
  "from": {
    "name": "Bandra West Studio",
    "email": "[email protected]"
  },
  "variables": [
    {
      "name": "contact.first_name",
      "type": "string",
      "required": false,
      "default": "there"
    }
  ],
  "tags": [
    "welcome",
    "onboarding"
  ],
  "locale": "en-IN"
}
{
  "id": "tpl_6ab24872ba90b88e270b4904",
  "object": "text",
  "name": "text",
  "channel": "email",
  "status": "active",
  "version": 1,
  "subject": "text",
  "body_html": "text",
  "body_text": "text",
  "body": "text",
  "script": "text",
  "voice_id": "text",
  "from": {
    "name": "text",
    "email": "[email protected]"
  },
  "reply_to": "[email protected]",
  "variables": [
    {
      "name": "text",
      "type": "string",
      "required": false,
      "default": null,
      "description": "text"
    }
  ],
  "tags": [
    "text"
  ],
  "locale": "en-IN",
  "created_at": "2026-05-27T14:23:11.482Z",
  "updated_at": "2026-05-27T14:23:11.482Z",
  "published_at": "2026-05-27T14:23:11.482Z",
  "archived_at": "2026-05-27T14:23:11.482Z",
  "metadata": {
    "our_crm_id": "cust_884321",
    "sync_batch": "2026-05-imports"
  }
}

Retrieve a template.

get

Returns the template's live content - for email the stored template_body, for SMS/voice the stored description, so edits made in the dashboard show up here. ?version=<n> (deprecated) fetches a historical snapshot taken by the old publish endpoint; ?draft=true is accepted and ignored.

This takes an id, not a name β€” there is no lookup-by-name endpoint. Template names are not unique (not even within a single channel/account), so a name alone can't be resolved to one template. Template names are not unique. GET /v3/templates?filter[name]=<name>&filter[channel]=<channel> resolves a name, and may return more than one.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

versioninteger Β· min: 1Optional
draftbooleanOptionalDeprecated

Ignored - templates have no separate draft.

Default: false
Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

The template.

application/json

Reusable message body. Channel-specific content fields (email uses body_html/body_text; SMS uses body; voice uses script + voice_id). Unused fields are null. subject is read-only/legacy - see its own description.

idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
objectconst: templateRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

Templates have no draft/publish lifecycle - same as the dashboard, every saved template is live: create and PATCH take effect immediately for the dashboard, campaigns, flows and sends. active β€” every live template (email templates are stored exactly as the dashboard's Save writes them: status: "active", drafted: false). archived β€” only templates flag-archived by an older API version (DELETE now really deletes); resolvable with ?include_archived=true. Earlier API versions returned draft / published; both now read as active, and filter[status]=draft|published|active all list every live template.

Possible values:
versionintegerOptional

The template's current (live) version number. Bumped by every save, from the API or the dashboard.

published_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate published version).

draft_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate draft).

subjectstring Β· nullableOptional

Read-only legacy field - not settable via create/update. Templates have no subject line in the dashboard (that's a campaign-level concept); any value here is leftover from before that was enforced. Will be null on every template going forward.

body_htmlstring Β· nullableOptional

Email only.

body_textstring Β· nullableOptional

Email only. Recommended even when body_html is set.

bodystring Β· nullableOptional

SMS only. Max 1600 chars.

scriptstring Β· nullableOptional

Voice only. TTS script.

voice_idstring Β· nullableOptional

Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.

reply_tostring Β· email Β· nullableOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels (not contact tags).

localestring Β· nullableOptional

BCP 47 locale tag.

Example: en-IN
created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
updated_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
published_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
archived_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
get/templates/{id}
GET /v3/templates/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "tpl_6ab24872ba90b88e270b4904",
  "object": "text",
  "name": "text",
  "channel": "email",
  "status": "active",
  "version": 1,
  "subject": "text",
  "body_html": "text",
  "body_text": "text",
  "body": "text",
  "script": "text",
  "voice_id": "text",
  "from": {
    "name": "text",
    "email": "[email protected]"
  },
  "reply_to": "[email protected]",
  "variables": [
    {
      "name": "text",
      "type": "string",
      "required": false,
      "default": null,
      "description": "text"
    }
  ],
  "tags": [
    "text"
  ],
  "locale": "en-IN",
  "created_at": "2026-05-27T14:23:11.482Z",
  "updated_at": "2026-05-27T14:23:11.482Z",
  "published_at": "2026-05-27T14:23:11.482Z",
  "archived_at": "2026-05-27T14:23:11.482Z",
  "metadata": {
    "our_crm_id": "cust_884321",
    "sync_batch": "2026-05-imports"
  }
}

Update a template.

patch

Changes the live template used by campaigns and sends, immediately and with no undo: the previous content is not kept (no version snapshot is taken), so the old wording cannot be restored from the API.

Live immediately, exactly like saving in the dashboard: the fields the dashboard, the Inbox / v1 template pickers, campaign creation and sends read (template_body / template_json for email, description for SMS and voice) are written by this call, and the version number is bumped. There is no draft and no publish step. A campaign that already copied the template's content keeps its own copy. channel cannot be changed β€” create a new template instead.

Email: when body_html changes, the stored Bee design (template_json) is regenerated only if it is still the one the API synthesized; a design saved later in the dashboard's Bee editor is left untouched (body_html is then what sends, until the design is saved again in the dashboard).

To move the template into (or out of) a folder, set folder_id (pass null to unfolder it) β€” call GET /v3/templates/folders first and let the user choose from the existing list (or confirm a new one) rather than guessing a folder name.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body

Partial update, live immediately (no draft). channel is immutable.

namestring Β· max: 200Optional
body_htmlstring Β· nullableOptional
body_textstring Β· nullableOptional
bodystring Β· max: 1600 Β· nullableOptional
scriptstring Β· nullableOptional
voice_idstring Β· nullableOptional

TTS voice for the script - there is no default voice, so a voice template without one cannot be sent.

reply_tostring Β· email Β· nullableOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels. Prefer folder_id to move the template between folders. If folder_id is omitted but tags is a non-empty array, the FIRST entry is also resolved as a folder (id or name, find-or-create) - same fallback as folder_id, for callers that can only send tags. An empty tags array does NOT unfolder the template (that requires folder_id: null).

localestring Β· nullableOptional

BCP 47 locale tag.

Example: en-IN
folder_idstring Β· nullableOptional

Move this template into (or out of) a folder, by id (tfd_...) or by name. An unrecognized name auto-creates a new folder - call GET /v3/templates/folders first and let the user choose from the existing list (or confirm a new one) instead of guessing a name. Pass null to unfolder it; omit to leave it where it is. Takes priority over any folder inferred from tags[0].

Responses
200

Updated (live). Returns the template with its new version.

application/json

Reusable message body. Channel-specific content fields (email uses body_html/body_text; SMS uses body; voice uses script + voice_id). Unused fields are null. subject is read-only/legacy - see its own description.

idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
objectconst: templateRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

Templates have no draft/publish lifecycle - same as the dashboard, every saved template is live: create and PATCH take effect immediately for the dashboard, campaigns, flows and sends. active β€” every live template (email templates are stored exactly as the dashboard's Save writes them: status: "active", drafted: false). archived β€” only templates flag-archived by an older API version (DELETE now really deletes); resolvable with ?include_archived=true. Earlier API versions returned draft / published; both now read as active, and filter[status]=draft|published|active all list every live template.

Possible values:
versionintegerOptional

The template's current (live) version number. Bumped by every save, from the API or the dashboard.

published_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate published version).

draft_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate draft).

subjectstring Β· nullableOptional

Read-only legacy field - not settable via create/update. Templates have no subject line in the dashboard (that's a campaign-level concept); any value here is leftover from before that was enforced. Will be null on every template going forward.

body_htmlstring Β· nullableOptional

Email only.

body_textstring Β· nullableOptional

Email only. Recommended even when body_html is set.

bodystring Β· nullableOptional

SMS only. Max 1600 chars.

scriptstring Β· nullableOptional

Voice only. TTS script.

voice_idstring Β· nullableOptional

Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.

reply_tostring Β· email Β· nullableOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels (not contact tags).

localestring Β· nullableOptional

BCP 47 locale tag.

Example: en-IN
created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
updated_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
published_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
archived_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
patch/templates/{id}
PATCH /v3/templates/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 405

{
  "name": "text",
  "body_html": "text",
  "body_text": "text",
  "body": "text",
  "script": "text",
  "voice_id": "text",
  "from": {
    "name": "text",
    "email": "[email protected]"
  },
  "reply_to": "[email protected]",
  "variables": [
    {
      "name": "text",
      "type": "string",
      "required": false,
      "default": null,
      "description": "text"
    }
  ],
  "tags": [
    "text"
  ],
  "locale": "en-IN",
  "metadata": {
    "our_crm_id": "cust_884321",
    "sync_batch": "2026-05-imports"
  },
  "folder_id": "text"
}
{
  "id": "tpl_6ab24872ba90b88e270b4904",
  "object": "text",
  "name": "text",
  "channel": "email",
  "status": "active",
  "version": 1,
  "subject": "text",
  "body_html": "text",
  "body_text": "text",
  "body": "text",
  "script": "text",
  "voice_id": "text",
  "from": {
    "name": "text",
    "email": "[email protected]"
  },
  "reply_to": "[email protected]",
  "variables": [
    {
      "name": "text",
      "type": "string",
      "required": false,
      "default": null,
      "description": "text"
    }
  ],
  "tags": [
    "text"
  ],
  "locale": "en-IN",
  "created_at": "2026-05-27T14:23:11.482Z",
  "updated_at": "2026-05-27T14:23:11.482Z",
  "published_at": "2026-05-27T14:23:11.482Z",
  "archived_at": "2026-05-27T14:23:11.482Z",
  "metadata": {
    "our_crm_id": "cust_884321",
    "sync_batch": "2026-05-imports"
  }
}

Delete a template.

delete

Genuine, irreversible hard delete β€” the template document is removed entirely. An internal audit copy is retained for support/recovery purposes but is not restorable via this API; there is no undelete/unarchive action.

This takes an id, not a name β€” there is no lookup-by-name endpoint. Template names are not unique (not even within a single channel/account), so a name alone can't be resolved to one template. Template names are not unique. GET /v3/templates?filter[name]=<name>&filter[channel]=<channel> resolves a name, and may return more than one.

Permanent. There is no undo and no trash to restore from. Anything that references the deleted record is affected too.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
204

Deleted.

No content

delete/templates/{id}
DELETE /v3/templates/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Deprecated

Publish a template (deprecated no-op).

post

Deprecated β€” no-op. Templates have no draft/publish lifecycle (the dashboard has none): create and PATCH are already live. Kept so existing callers keep working: returns 200 with the template unchanged. change_summary is ignored.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body
change_summarystring Β· max: 500Optional

Optional note describing what changed in this version.

Responses
200

The template, unchanged.

application/json

Reusable message body. Channel-specific content fields (email uses body_html/body_text; SMS uses body; voice uses script + voice_id). Unused fields are null. subject is read-only/legacy - see its own description.

idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
objectconst: templateRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

Templates have no draft/publish lifecycle - same as the dashboard, every saved template is live: create and PATCH take effect immediately for the dashboard, campaigns, flows and sends. active β€” every live template (email templates are stored exactly as the dashboard's Save writes them: status: "active", drafted: false). archived β€” only templates flag-archived by an older API version (DELETE now really deletes); resolvable with ?include_archived=true. Earlier API versions returned draft / published; both now read as active, and filter[status]=draft|published|active all list every live template.

Possible values:
versionintegerOptional

The template's current (live) version number. Bumped by every save, from the API or the dashboard.

published_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate published version).

draft_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate draft).

subjectstring Β· nullableOptional

Read-only legacy field - not settable via create/update. Templates have no subject line in the dashboard (that's a campaign-level concept); any value here is leftover from before that was enforced. Will be null on every template going forward.

body_htmlstring Β· nullableOptional

Email only.

body_textstring Β· nullableOptional

Email only. Recommended even when body_html is set.

bodystring Β· nullableOptional

SMS only. Max 1600 chars.

scriptstring Β· nullableOptional

Voice only. TTS script.

voice_idstring Β· nullableOptional

Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.

reply_tostring Β· email Β· nullableOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels (not contact tags).

localestring Β· nullableOptional

BCP 47 locale tag.

Example: en-IN
created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
updated_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
published_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
archived_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
post/templates/{id}/publish
POST /v3/templates/{id}/publish HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 25

{
  "change_summary": "text"
}
{
  "id": "tpl_6ab24872ba90b88e270b4904",
  "object": "text",
  "name": "text",
  "channel": "email",
  "status": "active",
  "version": 1,
  "subject": "text",
  "body_html": "text",
  "body_text": "text",
  "body": "text",
  "script": "text",
  "voice_id": "text",
  "from": {
    "name": "text",
    "email": "[email protected]"
  },
  "reply_to": "[email protected]",
  "variables": [
    {
      "name": "text",
      "type": "string",
      "required": false,
      "default": null,
      "description": "text"
    }
  ],
  "tags": [
    "text"
  ],
  "locale": "en-IN",
  "created_at": "2026-05-27T14:23:11.482Z",
  "updated_at": "2026-05-27T14:23:11.482Z",
  "published_at": "2026-05-27T14:23:11.482Z",
  "archived_at": "2026-05-27T14:23:11.482Z",
  "metadata": {
    "our_crm_id": "cust_884321",
    "sync_batch": "2026-05-imports"
  }
}

Duplicate a template.

post

Creates a new, live template with a copy of the source's current content (including templates made in the dashboard). The source is not modified.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body
namestringOptional

Name for the duplicate. Defaults to "<source name> (copy)".

Responses
201

Duplicate created.

application/json

Reusable message body. Channel-specific content fields (email uses body_html/body_text; SMS uses body; voice uses script + voice_id). Unused fields are null. subject is read-only/legacy - see its own description.

idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
objectconst: templateRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

Templates have no draft/publish lifecycle - same as the dashboard, every saved template is live: create and PATCH take effect immediately for the dashboard, campaigns, flows and sends. active β€” every live template (email templates are stored exactly as the dashboard's Save writes them: status: "active", drafted: false). archived β€” only templates flag-archived by an older API version (DELETE now really deletes); resolvable with ?include_archived=true. Earlier API versions returned draft / published; both now read as active, and filter[status]=draft|published|active all list every live template.

Possible values:
versionintegerOptional

The template's current (live) version number. Bumped by every save, from the API or the dashboard.

published_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate published version).

draft_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate draft).

subjectstring Β· nullableOptional

Read-only legacy field - not settable via create/update. Templates have no subject line in the dashboard (that's a campaign-level concept); any value here is leftover from before that was enforced. Will be null on every template going forward.

body_htmlstring Β· nullableOptional

Email only.

body_textstring Β· nullableOptional

Email only. Recommended even when body_html is set.

bodystring Β· nullableOptional

SMS only. Max 1600 chars.

scriptstring Β· nullableOptional

Voice only. TTS script.

voice_idstring Β· nullableOptional

Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.

reply_tostring Β· email Β· nullableOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels (not contact tags).

localestring Β· nullableOptional

BCP 47 locale tag.

Example: en-IN
created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
updated_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
published_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
archived_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
post/templates/{id}/duplicate
POST /v3/templates/{id}/duplicate HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "name": "text"
}
{
  "id": "tpl_6ab24872ba90b88e270b4904",
  "object": "text",
  "name": "text",
  "channel": "email",
  "status": "active",
  "version": 1,
  "subject": "text",
  "body_html": "text",
  "body_text": "text",
  "body": "text",
  "script": "text",
  "voice_id": "text",
  "from": {
    "name": "text",
    "email": "[email protected]"
  },
  "reply_to": "[email protected]",
  "variables": [
    {
      "name": "text",
      "type": "string",
      "required": false,
      "default": null,
      "description": "text"
    }
  ],
  "tags": [
    "text"
  ],
  "locale": "en-IN",
  "created_at": "2026-05-27T14:23:11.482Z",
  "updated_at": "2026-05-27T14:23:11.482Z",
  "published_at": "2026-05-27T14:23:11.482Z",
  "archived_at": "2026-05-27T14:23:11.482Z",
  "metadata": {
    "our_crm_id": "cust_884321",
    "sync_batch": "2026-05-imports"
  }
}
Deprecated

List versions of a template (deprecated).

get

Deprecated β€” templates have no draft/publish lifecycle, so no new snapshots are taken. Returns the current version first (is_published: true β€” it is the live content), followed by any snapshots taken by the old publish endpoint (is_published: false), newest first. Fetch one via GET /v3/templates/{id}/versions/{version}.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

List of versions.

application/json
objectconst: listOptional
get/templates/{id}/versions
GET /v3/templates/{id}/versions HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "text",
  "data": [
    {
      "version": 1,
      "is_published": true,
      "created_at": "2026-05-27T14:23:11.482Z",
      "published_at": "2026-05-27T14:23:11.482Z",
      "created_by_user_id": "usr_01H8XL7...",
      "change_summary": "text"
    }
  ]
}
Deprecated

Retrieve a specific template version (deprecated).

get

Deprecated history. The current version number returns the live template; an older number returns the snapshot the old publish endpoint took at that version. No new snapshots are taken.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
versioninteger Β· min: 1Required
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

The version.

application/json

Reusable message body. Channel-specific content fields (email uses body_html/body_text; SMS uses body; voice uses script + voice_id). Unused fields are null. subject is read-only/legacy - see its own description.

idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
objectconst: templateRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

Templates have no draft/publish lifecycle - same as the dashboard, every saved template is live: create and PATCH take effect immediately for the dashboard, campaigns, flows and sends. active β€” every live template (email templates are stored exactly as the dashboard's Save writes them: status: "active", drafted: false). archived β€” only templates flag-archived by an older API version (DELETE now really deletes); resolvable with ?include_archived=true. Earlier API versions returned draft / published; both now read as active, and filter[status]=draft|published|active all list every live template.

Possible values:
versionintegerOptional

The template's current (live) version number. Bumped by every save, from the API or the dashboard.

published_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate published version).

draft_versionintegerOptionalDeprecated

Deprecated alias of version (there is no separate draft).

subjectstring Β· nullableOptional

Read-only legacy field - not settable via create/update. Templates have no subject line in the dashboard (that's a campaign-level concept); any value here is leftover from before that was enforced. Will be null on every template going forward.

body_htmlstring Β· nullableOptional

Email only.

body_textstring Β· nullableOptional

Email only. Recommended even when body_html is set.

bodystring Β· nullableOptional

SMS only. Max 1600 chars.

scriptstring Β· nullableOptional

Voice only. TTS script.

voice_idstring Β· nullableOptional

Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.

reply_tostring Β· email Β· nullableOptionalExample: [email protected]
tagsstring[]Optional

Free-form organizational labels (not contact tags).

localestring Β· nullableOptional

BCP 47 locale tag.

Example: en-IN
created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
updated_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
published_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
archived_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
get/templates/{id}/versions/{version}
GET /v3/templates/{id}/versions/{version} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "tpl_6ab24872ba90b88e270b4904",
  "object": "text",
  "name": "text",
  "channel": "email",
  "status": "active",
  "version": 1,
  "subject": "text",
  "body_html": "text",
  "body_text": "text",
  "body": "text",
  "script": "text",
  "voice_id": "text",
  "from": {
    "name": "text",
    "email": "[email protected]"
  },
  "reply_to": "[email protected]",
  "variables": [
    {
      "name": "text",
      "type": "string",
      "required": false,
      "default": null,
      "description": "text"
    }
  ],
  "tags": [
    "text"
  ],
  "locale": "en-IN",
  "created_at": "2026-05-27T14:23:11.482Z",
  "updated_at": "2026-05-27T14:23:11.482Z",
  "published_at": "2026-05-27T14:23:11.482Z",
  "archived_at": "2026-05-27T14:23:11.482Z",
  "metadata": {
    "our_crm_id": "cust_884321",
    "sync_batch": "2026-05-imports"
  }
}

Render the template with sample variables (no send).

post

Interpolates the template's live body with the provided variables and returns the rendered output, using the same merge-tag rules as the send workers (account timezone and default date formats, format="..." directives, managed links, static tags such as {workroom_name} / {responsible.name}). Caller variables win over everything else. Tags that need a contact (e.g. {first_name}, {total_visits}) render their default or empty here; {coupon.<id>} is never assigned by a preview. Nothing is sent. Rate limit bucket: read.

A read: requires templates:read (a token with only templates:write is also accepted) and, for OAuth tokens, the dashboard role's Templates β†’ View permission on this template.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body

Render the template with sample variables. Does not send anything.

versioninteger Β· nullableOptional

Which version to render. Defaults to the current draft.

Responses
200

Rendered preview.

application/json
objectconst: template_previewRequired
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
warningsstring[]Optional

Non-fatal rendering issues (undefined variables, formatting warnings).

post/templates/{id}/preview
POST /v3/templates/{id}/preview HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 44

{
  "variables": {
    "contact.first_name": "Alice"
  }
}
{
  "object": "text",
  "channel": "email",
  "rendered": {
    "subject": "text",
    "body_html": "text",
    "body_text": "text",
    "body": "text",
    "script": "text"
  },
  "warnings": [
    "text"
  ]
}

Send a test rendering to a specific address.

post

Renders the template and sends to a single recipient for QA. Bypasses opt-in enforcement (recipient assumed to be an admin/tester). Test sends are tagged category: transactional on the resulting Message and are excluded from campaign/template analytics. Idempotency-Key is required. Rate limit bucket: messaging.

Still a real send. Delivers to whichever address is given.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Idempotency-Keystring Β· max: 255Required
Body

Send a rendered test to a specific address. Bypasses opt-in checks (recipient is assumed to be an admin/tester).

versioninteger Β· nullableOptional

Which version to render. Defaults to the current draft.

Responses
201

Test send accepted. Returns the Message.

application/json

A single message record β€” the outcome of a notification send, an outbound message from a campaign or flow, or a message inside a conversation. Same shape regardless of origin.

idstringRequiredExample: msg_6a7eaec3505bea795709f897Pattern: ^msg_[0-9a-f]{24}$
objectconst: messageRequired
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

A v3 send lands in the shared messages collection as pending β€” that collection's own queued state β€” and a delivery worker moves it to success or failed.

Campaign-pipeline sends use the richer lifecycle: queued β†’ sending β†’ sent β†’ delivered (or bounced/failed/undelivered). opened / clicked follow delivered for email and for SMS with tracked links. Terminal states: success, delivered, opened, clicked, failed, bounced, undelivered. Not every channel produces all of them.

Possible values:
categorystring Β· enumRequired

Does NOT bypass opt-out. As in the dashboard's one-to-one sends, a contact who has opted out of SMS (STOP / optin_sms: 0) gets no SMS and a contact who has unsubscribed from email (optout_email: 1) gets no email, whatever the category β€” both return 422 compliance_block (opted_out_all likewise blocks every channel). marketing additionally suppresses addresses the dashboard's campaign audience excludes: invalid_email 2/3/4 (bounced, complained, inactive) and invalid_phone: 1, returning 422 compliance_block; marketing email also carries the workroom's unsubscribe/address footers. Voice opt-out (optout_voice) still blocks marketing only. Earlier versions let transactional (the default) bypass channel opt-out; that bypass is gone.

Possible values:
directionstring Β· enumOptionalPossible values:
conversation_idstring Β· nullableOptional

If this message is part of a conversation, its ID. Transactional sends default to null.

template_idstring Β· nullableOptionalExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
template_versioninteger Β· nullableOptional

Which version of the template was rendered.

subjectstring Β· nullableOptional

Email only.

body_snippetstring Β· nullableOptional

First ~200 chars of the rendered body, for previews.

providerstring Β· nullableOptional

Underlying delivery provider (twilio, telnyx, mailgun, etc.). Informational.

provider_message_idstring Β· nullableOptional
sent_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
delivered_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
opened_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
clicked_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
failed_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
updated_atstring Β· date-timeOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
post/templates/{id}/test_send
POST /v3/templates/{id}/test_send HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 166

{
  "to": {
    "contact_id": "con_6a7eaec3505bea795709f897",
    "phone": "+15558675309",
    "email": "[email protected]"
  },
  "variables": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "version": 1
}
{
  "id": "msg_6a7eaec3505bea795709f897",
  "object": "text",
  "channel": "sms",
  "status": "pending",
  "category": "transactional",
  "direction": "outbound",
  "conversation_id": "text",
  "to": {
    "contact_id": "con_6a7eaec3505bea795709f897",
    "phone": "+15558675309",
    "email": "[email protected]"
  },
  "from": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "template_id": "tpl_6ab24872ba90b88e270b4904",
  "template_version": 1,
  "subject": "text",
  "body_snippet": "text",
  "variables": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "provider": "text",
  "provider_message_id": "text",
  "error": {
    "code": "text",
    "message": "text"
  },
  "cost": {
    "amount": 1,
    "currency": "text"
  },
  "sent_at": "2026-05-27T14:23:11.482Z",
  "delivered_at": "2026-05-27T14:23:11.482Z",
  "opened_at": "2026-05-27T14:23:11.482Z",
  "clicked_at": "2026-05-27T14:23:11.482Z",
  "failed_at": "2026-05-27T14:23:11.482Z",
  "created_at": "2026-05-27T14:23:11.482Z",
  "updated_at": "2026-05-27T14:23:11.482Z"
}