Campaigns
One-shot audience-driven sends. Reference a Template for content, a Segment (or explicit contact list) for audience, an optional schedule, and optional A/B split.
Paginated list. Common filters: ?filter[status]=scheduled, ?filter[channel]=email, ?filter[created_at][gte]=.... Archived campaigns (see POST /v3/campaigns/{id}/archive) are excluded by default β pass ?filter[include_archived]=true to include them. 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 campaigns.
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/campaigns HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
A page of campaigns.
{
"object": "text",
"data": [
{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}
],
"has_more": true,
"next_cursor": "text",
"prev_cursor": "text"
}Creates a draft campaign. Nothing sends until you call POST /v3/campaigns/{id}/schedule or /send_now. Referenced template_id must exist and match channel at send time.
Content is required unless the caller is intentionally creating a stub. For channel: "email" provide subject + message_body (or template_id). For channel: "sms" provide message_body (or template_id). Campaign channels are sms and email only. A campaign needs finished copy: subject and message_body are what gets delivered, and a campaign saved with them blank or stubbed sends that placeholder text. from_phone_number / from_name / from_email inherit from the workroom's app defaults when omitted. For SMS, from_phone_number selects the sending number; omitted, it falls back to the workroom default. listWorkroomPhoneNumbers returns the usable numbers.
Requires the audience, the content and when it should send. 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 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-7a907c4d4f8eCreates a drafted campaign. Nothing is sent until POST /v3/campaigns/{id}/schedule or /send_now is called. Provide either template_id (reference a template) OR message_body (inline content); not both.
Content is required for email and sms campaigns: pass template_id or message_body. When template_id is given, the template's saved body is copied onto the campaign at create time (the send path reads the campaign's own stored content, not the template reference), so the referenced template must have a non-empty body. If content can't be resolved (no message_body and the template is missing or empty), the request fails 422 validation_failed β a campaign is never created with an empty body.
channel must be sms or email. voice is rejected with 422: no send worker delivers voice campaigns (use POST /v3/messages for individual calls). Push does not exist in Gleantap.
objective is required for channel: "email" campaigns and ignored for SMS.
Campaign channel. voice is rejected (no campaign send worker for it); push does not exist.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Email subject line (alias for message_title on email campaigns). Legacy column: subject.
Campaign objective / category (matches the dashboard's objective picker). Legacy column: campaign_objective.
E.164 sender phone for SMS/voice. When omitted it resolves to the workroom's default number (the phone_numbers row marked is_default_number, else the app's provider number). If the workroom has more than one usable number and none is clearly the intended sender, do NOT guess β call listWorkroomPhoneNumbers and confirm which one with the user, then pass the chosen E.164 value here.
Email only. Sender address. Inherits the workroom's email-settings default when omitted. Must be a valid email address, and its domain must be verified for this account if it's a registered custom domain (a shared/Gleantap-managed domain is always allowed).
Email only. Sender display name. Inherits the workroom's email-settings default when omitted.
Email only. Reply-To address. Inherits the workroom's reply_to_email / default_email / from_email when omitted. Must be a valid email address.
Email only. Reply-To display name. Defaults to the sender name when omitted.
MMS attachment URL.
Draft campaign created.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
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/campaigns HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 217
{
"name": "May Promo β Annual Membership Discount",
"channel": "email",
"template_id": "tpl_may_promo_email",
"audience": {
"type": "segment",
"segment_ids": [
"seg_active_vips"
],
"exclude_segment_ids": [
"seg_recent_purchasers"
]
}
}{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Includes current stats and status. Use ?expand=template,audience.segment to inline related resources (segments also accepted as a shorthand for audience.segment). Expanded fields are always included even if ?fields= doesn't list them.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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.
Sparse fieldset β comma-separated list of fields to include in the response. Reduces payload size on high-volume reads. Nested field access is not supported; request the parent object.
id,email,phone,tagsComma-separated list of related resources to inline in the response. Without expand, a related field is just the ID string. With expand, it's the full sub-object. Up to two levels deep; max 4 expansions per request.
contact,pipeline,stage,assigneeMinor 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 campaign.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
GET /v3/campaigns/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Campaigns in drafted or paused status can edit any field; once launched only name, label, and tags are editable. channel and template_id are immutable β create a new campaign. Returns 409 campaign_locked otherwise (cancel first to unlock).
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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. Campaigns in drafted or paused status can edit any field; once launched only name, label, and tags are editable β 409 campaign_locked otherwise. Cancel first to unlock.
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Email subject line (alias for message_title). Legacy column: subject.
Campaign objective / category (matches the dashboard's objective picker). Legacy column: campaign_objective.
Email only. Omitting leaves the stored value unchanged β workroom defaults are NOT re-resolved on update. Must be a valid email address, and its domain must be verified for this account if it's a registered custom domain.
Email only. Omitting leaves the stored value unchanged β workroom defaults are NOT re-resolved on update.
Email only. Omitting leaves the stored value unchanged β workroom defaults are NOT re-resolved on update. Must be a valid email address.
Email only. Omitting leaves the stored value unchanged.
Updated.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
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.
Idempotency conflict, version conflict (If-Match), or state conflict.
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/campaigns/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 502
{
"name": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "Feedback / Review",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"label": "text",
"tags": [
"text"
]
}{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Only drafted and paused campaigns can be deleted this way β this is a permanent, irreversible hard delete (no audit copy), not an archive. Every other status (upcoming, scheduled, ongoing, sending, sent, failed, archived) returns 409 campaign_locked; use POST /v3/campaigns/{id}/archive instead to retire a campaign that isn't a draft or paused, or POST /v3/campaigns/{id}/cancel first to pause a scheduled/sending/ongoing one before deleting.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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.
Idempotency conflict, version conflict (If-Match), or state conflict.
DELETE /v3/campaigns/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Transitions status from draft to scheduled and locks the definition. send_at must be in the future (at least 1 min out). An offset-less send_at is interpreted in the account's own configured timezone and converted to UTC automatically β see its own schema description for the exact rule; there is no recipient-local scheduling option.
Goes live. Once live it keeps reaching real contacts on its own, with no further call.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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 Test1Body for POST /v3/campaigns/{id}/schedule. For "send right now" use POST /send_now instead (which is equivalent to mode: immediate with send_at: now).
send_at without an explicit offset is interpreted in the account's own configured timezone, not UTC. See send_at's own description below for the exact rule.
scheduledβ send at a specific futuresend_at.ongoingβ recurring send (weekly/daily/etc.) driven byfrequency+ optionaldays_of_week.
RFC 3339 timestamp. Required when mode: "scheduled". Must be in the future (at least 1 min out).
Read back as schedule.send_at, always the real UTC instant. (Storage note: for scheduled, the legacy date_time holds the workroom-local wall clock written as if it were UTC, plus time β exactly what the dashboard writes and the send worker reads. Don't compare raw date_time values to real instants.)
An offset-less value (no +HH:MM, -HH:MM, or Z) is interpreted in the scheduling timezone β the workroom's timezone, else the account's configured timezone (Settings), the same one the send worker uses β and converted to UTC automatically β send the local wall-clock time the user asked for as-is, with no manual conversion needed. E.g. "2026-09-16T20:00:00" for "8pm" schedules 8pm in whatever timezone the account has configured, not 8pm UTC. If you include an explicit offset or Z, it's always honored exactly as given and overrides the account's timezone β use this when you already know the intended instant precisely (e.g. "2026-09-16T14:30:00Z") rather than relying on account defaults.
2026-05-27T14:23:11.482ZFor ongoing. The send worker knows exactly two behaviors:
dailyβ once per run day, atsend_at's time of day.onceandweeklyare accepted aliases (weeklyrequiresdays_of_week). Read back asdaily.multipleβ continuously throughout the day, on every worker run. Which days run isdays_of_week. Monthly recurrence is not supported (422).
dailyPossible values: Scheduled.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
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.
Idempotency conflict, version conflict (If-Match), or state conflict.
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/campaigns/{id}/schedule HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"mode": "scheduled",
"send_at": "2026-05-27T14:23:11.482Z",
"frequency": "daily",
"days_of_week": [
"monday"
]
}{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Transitions drafted β upcoming (the worker picks it up and moves it to sending shortly after - status won't read sending instantly). Returns immediately; delivery happens asynchronously. Subscribe to campaign.sending / campaign.sent / campaign.failed webhooks. Idempotency-Key is strongly recommended.
Sends to real people the moment it is called. There is no recall. Reaches the full audience of the target segment or campaign. The test-send operations deliver to a single address instead.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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 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-7a907c4d4f8eSend started.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
Idempotency conflict, version conflict (If-Match), or state conflict.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
Rate limited.
POST /v3/campaigns/{id}/send_now HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"throttle": {
"messages_per_minute": 1
}
}{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Cancels an upcoming campaign before the cron picks it up (e.g. a send_now still waiting out quiet hours), a scheduled campaign before it starts, an ongoing campaign, or a sending campaign mid-send (already-queued messages continue to deliver β no rollback). Canceling moves the campaign to paused and clears its schedule - there is no separate canceled status. Terminal-state campaigns (sent, failed) return 409.
Affects something real. This cancels a scheduled send or a booking a person is expecting.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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 Test1Canceled.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
Idempotency conflict, version conflict (If-Match), or state conflict.
POST /v3/campaigns/{id}/cancel HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 17
{
"reason": "text"
}{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Creates a new draft campaign with the same template, audience, and A/B config as the source. Schedule and stats are NOT copied.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
POST /v3/campaigns/{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": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Soft-archives the campaign: sets status to archived and reversibly hides it from GET /v3/campaigns unless ?filter[include_archived]=true is passed. Unlike DELETE /v3/campaigns/{id}, this works from ANY lifecycle status β including sent, paused, and failed β so a campaign's history is never lost. The campaign's prior status is remembered internally and restored exactly by POST /v3/campaigns/{id}/unarchive. Idempotent β archiving an already-archived campaign is a no-op that returns its current state.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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 Test1Archived.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
POST /v3/campaigns/{id}/archive HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Reverses POST /v3/campaigns/{id}/archive: clears the archived state, restores status to whatever it was immediately before archiving (falls back to drafted if that isn't known β e.g. a campaign archived before this field existed), and makes the campaign visible again in GET /v3/campaigns's default list. Idempotent β unarchiving a campaign that isn't archived is a no-op that returns its current state.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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 Test1Unarchived.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$Delivery channel. Push is not supported by Gleantap.
Derived from the legacy campaign doc's (status, schedule, date_time) triple. Values mirror the dashboard UI:
draftedβ created, not launched.upcomingβ Send ASAP or Specific Date & Time; queued for the worker.scheduledβ Specific Date & Time withdate_timein the future (view-only convenience derived fromupcoming).ongoingβ recurring send (weekly/daily/etc.). Also the legacyrecurringstatus.sendingβ worker is actively dispatching. Also the dashboard'soptimized_sending.sentβ completed.pausedβ canceled/paused by the user. Stored as the dashboard's ownpausetoken (legacy docs may also carrypaused); both read aspaused.failedβ send worker errored terminally.archivedβ archived viaPOST /v3/campaigns/{id}/archive(or the dashboard's own Archive action). Takes priority over whatever the campaign's status was before archiving; restored to that prior status byPOST /v3/campaigns/{id}/unarchive.
The template used for content. On create/update the template's saved body is copied onto the campaign's own content (message_details) β the send path reads that, not this reference. Mutually exclusive with message_body (use one or the other).
tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$Inline message body β HTML for email, plain text for SMS/voice. Alternative to template_id; ignored if template_id is set (the template supplies the body). Legacy column: message_details.
Push/SMS message title; email subject line. Legacy column: message_title.
Email subject line (mirrors message_title for email campaigns). Legacy column: subject.
Campaign objective / category (dashboard picker values: Feedback / Review, Lead Engagement, Milestone, Nuture Customer, Referral, Survey, Up-sell / Cross-sell, Welcome, Win Back, Promotional, Newsletter / Announcement, Other). Not enum-constrained on read so older/free-form values still round-trip. Legacy column: campaign_objective.
SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β a raw phone string.
Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.
Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.
Email only. Reply-To address. Resolved at creation time from the workroom's reply_to_email / default_email / from_email when omitted. Legacy column: reply_to.
Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.
MMS attachment URL. Legacy column: full_path.
Optional organizational label (dashboard's campaign labels feature).
Campaign-level tags (not contact tags).
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.482ZSet when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
POST /v3/campaigns/{id}/unarchive HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "cam_6a7eaec3505bea795709f897",
"object": "text",
"name": "text",
"channel": "sms",
"status": "drafted",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"message_title": "text",
"subject": "text",
"objective": "text",
"from_phone_number": "text",
"from_email": "[email protected]",
"from_name": "text",
"reply_to": "[email protected]",
"reply_to_name": "text",
"attachment_url": "https://example.com",
"audience": {
"type": "segment",
"segment_ids": [
"seg_01H8XKE..."
],
"exclude_segment_ids": [
"seg_01H8XKE..."
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
},
"schedule": {
"mode": "immediate",
"send_at": "2026-05-27T14:23:11.482Z",
"end_at": "2026-05-27T14:23:11.482Z",
"frequency": "text",
"days_of_week": [
"monday"
]
},
"ab_test": {
"is_master": true,
"master_id": "cam_6a7eaec3505bea795709f897",
"split_field": "template_id",
"variants": [
{
"label": "text",
"template_id": "tpl_6ab24872ba90b88e270b4904",
"message_body": "text",
"subject": "text"
}
],
"variant_label": "text"
},
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"label": "text",
"tags": [
"text"
],
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z",
"scheduled_at": "2026-05-27T14:23:11.482Z",
"started_at": "2026-05-27T14:23:11.482Z",
"completed_at": "2026-05-27T14:23:11.482Z",
"archived_at": "2026-05-27T14:23:11.482Z"
}Renders the campaign's template with sample variables and sends to up to 5 QA recipients. Excluded from campaign analytics. Idempotency-Key is required.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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 Test1QA-send to a small ad-hoc address list (up to 5). Renders the campaign's referenced template β or its inline content β and hands each recipient to the messaging pipeline, exactly like the per-template test send. Tagged category: transactional, so it bypasses marketing opt-out and is excluded from campaign analytics.
Test sends dispatched. Returns the created Messages.
Request could not be parsed or failed validation.
The resource doesn't exist or isn't visible to this caller.
Rate limited.
POST /v3/campaigns/{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: 64
{
"to": [
null
],
"variables": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}{
"object": "text",
"data": [
{
"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"
}
]
}The concrete recipient list is materialized at schedule time (or send time for send_now). Before that, this returns 422 not_materialized_yet β use POST /v3/segments/preview on the audience to estimate. Includes A/B variant assignment when applicable.
Before the first send the response is an estimate (total_estimate + audience_expression). When the audience has exclude_segment_ids, total_estimate is the live count of contacts in any included segment minus contacts in any excluded segment (the same filter the send worker uses), and each excluded segment appears in audience_expression with type: "excluded_segment".
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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.
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 recipients.
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.
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).
GET /v3/campaigns/{id}/recipients HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "text",
"data": [
{
"contact_id": "con_6a7eaec3505bea795709f897",
"variant_index": 1,
"status": "queued",
"message_id": "cmsg_6ac65ccbbe0d81f77e0165ec",
"skipped_reason": "text"
}
],
"has_more": true,
"next_cursor": "text",
"prev_cursor": "text"
}Returns delivery, engagement, and (if A/B) per-variant breakdown. Numbers stabilize hours after send as delivered/opened/clicked events roll in from providers.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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 Test1Analytics payload.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$RFC 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/campaigns/{id}/analytics HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "text",
"campaign_id": "cam_6a7eaec3505bea795709f897",
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"variants": [
{
"variant_index": 1,
"weight": 1,
"stats": {
"total_users": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"bounced": 1,
"failed": 1,
"converted": 1
},
"winner": true
}
],
"computed_at": "2026-05-27T14:23:11.482Z"
}Paginated list of Message records produced by this campaign. Use for per-recipient delivery inspection, bounce analysis, or reply tracking. Common filters: ?filter[status]=failed, ?filter[status]=bounced, ?filter[contact_id]=. filter[status] matches the returned (normalized) status, not a raw field: for SMS delivered / bounced / failed come from the carrier outcome (messagestatus), sent means handed off with no outcome yet; for email delivered includes the provider's success.
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.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[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.
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 messages.
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.
The resource doesn't exist or isn't visible to this caller.
GET /v3/campaigns/{id}/messages HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "text",
"data": [
{
"id": "cmsg_6ac65ccbbe0d81f77e0165ec",
"object": "text",
"campaign_id": "cam_6a7eaec3505bea795709f897",
"contact_id": "con_6a7eaec3505bea795709f897",
"channel": "sms",
"to": "text",
"status": "queued",
"clicked": true,
"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",
"error": "text",
"created_at": "2026-05-27T14:23:11.482Z"
}
],
"has_more": true,
"next_cursor": "text",
"prev_cursor": "text"
}