Templates
Reusable message bodies for email, SMS, and voice. Draft/publish versioning; preview and test-send before shipping. Referenced by Campaigns, Flows, and Notifications.
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.
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.
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.
Case-insensitive substring match against a tag's value or label, across all three categories.
Narrow to one category instead of all three.
Cap on the Workroom Attributes group specifically (default 100, max 500). The special/static groups are always returned in full.
100Minor 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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1The merge tag catalog.
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.
wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$GET /v3/templates/merge_tags HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
]
}Backed by the dashboard's tags collection, filtered to campaign_type='template'.
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.
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.
Page size. Default 25, max 100.
25Opaque 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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1A page of folders.
True if additional records exist beyond this page.
Opaque cursor for the next page. Null on the last page.
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 /v3/templates/folders HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
}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.
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.
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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Folder created.
Template folder ID.
tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$Name conflict.
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"
}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.
Template folder ID.
tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Folder.
Template folder ID.
tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$The resource doesn't exist or isn't visible to this caller.
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"
}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.
Template folder ID.
tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Updated folder.
Template folder ID.
tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$The resource doesn't exist or isn't visible to this caller.
Name conflict.
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"
}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.
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.
Template folder ID.
tfd_66b3a91d0e5b7c1a4d8e2f1aPattern: ^tfd_[0-9a-fA-F]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Deleted.
No content
The resource doesn't exist or isn't visible to this caller.
DELETE /v3/templates/folders/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Paginated list. Common filters: ?filter[channel]=email, ?filter[status]=published, ?filter[name]=welcome (case-insensitive prefix), ?filter[tags]=onboarding. Rate limit bucket: read.
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.
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.
Page size. Default 25, max 100.
25Opaque 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.
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.
-created_at,emailSparse 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.
id,email,phone,tagsMinor 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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1A page of templates.
True if additional records exist beyond this page.
Opaque cursor for the next page. Null on the last page.
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.
Missing or invalid credentials.
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"
}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 - PHPdate()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}(nocontact.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 optionalbody_textfor 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.
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.
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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1A 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.
8e3c7a90-7c4d-4f8e-8e3c-7a907c4d4f8eCreate 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.
Delivery channel. Push is not supported by Gleantap.
Required whenever script is set, and required before publish - there is no default voice.
[email protected]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.
BCP 47 locale tag.
en-INThe 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].
Template created (in draft status).
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
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.
The template's current (live) version number. Bumped by every save, from the API or the dashboard.
Deprecated alias of version (there is no separate published version).
Deprecated alias of version (there is no separate draft).
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.
Email only.
Email only. Recommended even when body_html is set.
SMS only. Max 1600 chars.
Voice only. TTS script.
Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.
[email protected]Free-form organizational labels (not contact tags).
BCP 47 locale tag.
en-INRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRequest could not be parsed or failed validation.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
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"
}
}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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
Ignored - templates have no separate draft.
falseMinor 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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1The template.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
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.
The template's current (live) version number. Bumped by every save, from the API or the dashboard.
Deprecated alias of version (there is no separate published version).
Deprecated alias of version (there is no separate draft).
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.
Email only.
Email only. Recommended even when body_html is set.
SMS only. Max 1600 chars.
Voice only. TTS script.
Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.
[email protected]Free-form organizational labels (not contact tags).
BCP 47 locale tag.
en-INRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
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"
}
}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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Partial update, live immediately (no draft). channel is immutable.
TTS voice for the script - there is no default voice, so a voice template without one cannot be sent.
[email protected]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).
BCP 47 locale tag.
en-INMove 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].
Updated (live). Returns the template with its new version.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
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.
The template's current (live) version number. Bumped by every save, from the API or the dashboard.
Deprecated alias of version (there is no separate published version).
Deprecated alias of version (there is no separate draft).
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.
Email only.
Email only. Recommended even when body_html is set.
SMS only. Max 1600 chars.
Voice only. TTS script.
Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.
[email protected]Free-form organizational labels (not contact tags).
BCP 47 locale tag.
en-INRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRequest could not be parsed or failed validation.
The resource doesn't exist or isn't visible to this caller.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
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"
}
}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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Deleted.
No content
The resource doesn't exist or isn't visible to this caller.
DELETE /v3/templates/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Optional note describing what changed in this version.
The template, unchanged.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
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.
The template's current (live) version number. Bumped by every save, from the API or the dashboard.
Deprecated alias of version (there is no separate published version).
Deprecated alias of version (there is no separate draft).
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.
Email only.
Email only. Recommended even when body_html is set.
SMS only. Max 1600 chars.
Voice only. TTS script.
Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.
[email protected]Free-form organizational labels (not contact tags).
BCP 47 locale tag.
en-INRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
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"
}
}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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Name for the duplicate. Defaults to "<source name> (copy)".
Duplicate created.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
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.
The template's current (live) version number. Bumped by every save, from the API or the dashboard.
Deprecated alias of version (there is no separate published version).
Deprecated alias of version (there is no separate draft).
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.
Email only.
Email only. Recommended even when body_html is set.
SMS only. Max 1600 chars.
Voice only. TTS script.
Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.
[email protected]Free-form organizational labels (not contact tags).
BCP 47 locale tag.
en-INRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
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 β 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}.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1List of versions.
The resource doesn't exist or isn't visible to this caller.
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 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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1The version.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
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.
The template's current (live) version number. Bumped by every save, from the API or the dashboard.
Deprecated alias of version (there is no separate published version).
Deprecated alias of version (there is no separate draft).
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.
Email only.
Email only. Recommended even when body_html is set.
SMS only. Max 1600 chars.
Voice only. TTS script.
Voice only. Provider-specific identifier. There is no default voice - required whenever script is set, and required before publish.
[email protected]Free-form organizational labels (not contact tags).
BCP 47 locale tag.
en-INRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
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"
}
}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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Render the template with sample variables. Does not send anything.
Which version to render. Defaults to the current draft.
Rendered preview.
Delivery channel. Push is not supported by Gleantap.
Non-fatal rendering issues (undefined variables, formatting warnings).
The resource doesn't exist or isn't visible to this caller.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
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"
]
}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.
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.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$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.
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.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$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=.
acc_59fca1e3d2a57d28a10b0442Which 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.
G Test1Send a rendered test to a specific address. Bypasses opt-in checks (recipient is assumed to be an admin/tester).
Which version to render. Defaults to the current draft.
Test send accepted. Returns the Message.
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.
msg_6a7eaec3505bea795709f897Pattern: ^msg_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
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.
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.
If this message is part of a conversation, its ID. Transactional sends default to null.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Which version of the template was rendered.
Email only.
First ~200 chars of the rendered body, for previews.
Underlying delivery provider (twilio, telnyx, mailgun, etc.). Informational.
RFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRequest could not be parsed or failed validation.
The resource doesn't exist or isn't visible to this caller.
Rate limited.
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"
}