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

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.

List campaigns.

get

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.

Authorizations
AuthorizationstringRequired

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

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

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

Query parameters
workroomstringOptional

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

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

Page size. Default 25, max 100.

Default: 25
cursorstringOptional

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

sortstringOptional

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

Example: -created_at,email
fieldsstringOptional

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

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

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
200

A page of campaigns.

application/json
objectconst: listRequired
has_morebooleanRequired

True if additional records exist beyond this page.

next_cursorstring Β· nullableRequired

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

prev_cursorstring Β· nullableRequired

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

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

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"
}

Create a draft campaign.

post

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.

Authorizations
AuthorizationstringRequired

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

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

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

Query parameters
workroomstringOptional

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

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

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

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

Creates 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.

namestring Β· max: 200Required
channelstring Β· enumRequired

Campaign channel. voice is rejected (no campaign send worker for it); push does not exist.

Possible values:
template_idstringOptionalExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystringOptional
message_titlestringOptional
subjectstringOptional

Email subject line (alias for message_title on email campaigns). Legacy column: subject.

objectivestring Β· enumOptional

Campaign objective / category (matches the dashboard's objective picker). Legacy column: campaign_objective.

Possible values:
from_phone_numberstringOptional

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.

from_emailstring Β· emailOptional

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).

from_namestringOptional

Email only. Sender display name. Inherits the workroom's email-settings default when omitted.

reply_tostring Β· emailOptional

Email only. Reply-To address. Inherits the workroom's reply_to_email / default_email / from_email when omitted. Must be a valid email address.

reply_to_namestringOptional

Email only. Reply-To display name. Defaults to the sender name when omitted.

attachment_urlstring Β· uriOptional

MMS attachment URL.

labelstringOptional
tagsstring[]Optional
Responses
201

Draft campaign created.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
post/campaigns
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"
}

Retrieve a campaign.

get

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

fieldsstringOptional

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

Example: id,email,phone,tags
expandstringOptional

Comma-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.

Example: contact,pipeline,stage,assignee
Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
200

The campaign.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
get/campaigns/{id}
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"
}

Update a campaign.

patch

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).

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Body

Partial update. 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.

namestring Β· max: 200Optional
template_idstring Β· nullableOptionalExample: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional
message_titlestring Β· nullableOptional
subjectstring Β· nullableOptional

Email subject line (alias for message_title). Legacy column: subject.

objectivestring Β· enum Β· nullableOptional

Campaign objective / category (matches the dashboard's objective picker). Legacy column: campaign_objective.

Possible values:
from_phone_numberstring Β· nullableOptional
from_emailstring Β· email Β· nullableOptional

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.

from_namestring Β· nullableOptional

Email only. Omitting leaves the stored value unchanged β€” workroom defaults are NOT re-resolved on update.

reply_tostring Β· email Β· nullableOptional

Email only. Omitting leaves the stored value unchanged β€” workroom defaults are NOT re-resolved on update. Must be a valid email address.

reply_to_namestring Β· nullableOptional

Email only. Omitting leaves the stored value unchanged.

attachment_urlstring Β· uri Β· nullableOptional
labelstring Β· nullableOptional
tagsstring[]Optional
Responses
200

Updated.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
patch/campaigns/{id}
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"
}

Hard-delete a draft or paused campaign.

delete

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
204

Deleted.

No content

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

No content

Schedule a draft campaign.

post

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Body

Body 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.

modestring Β· enumRequired
  • scheduled β€” send at a specific future send_at.
  • ongoing β€” recurring send (weekly/daily/etc.) driven by frequency + optional days_of_week.
Possible values:
send_atstring Β· date-timeOptional

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.

Example: 2026-05-27T14:23:11.482Z
frequencystring Β· enumOptional

For ongoing. The send worker knows exactly two behaviors:

  • daily β€” once per run day, at send_at's time of day. once and weekly are accepted aliases (weekly requires days_of_week). Read back as daily.
  • multiple β€” continuously throughout the day, on every worker run. Which days run is days_of_week. Monthly recurrence is not supported (422).
Default: dailyPossible values:
Responses
200

Scheduled.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
post/campaigns/{id}/schedule
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"
}

Send a campaign immediately.

post

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

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

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

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

Send started.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
post/campaigns/{id}/send_now
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"
}

Cancel a scheduled or sending campaign.

post

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Body
reasonstring Β· max: 500Optional
Responses
200

Canceled.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
post/campaigns/{id}/cancel
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"
}

Duplicate a campaign.

post

Creates a new draft campaign with the same template, audience, and A/B config as the source. Schedule and stats are NOT copied.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Body
namestringOptional

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

Responses
201

Duplicate created.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
post/campaigns/{id}/duplicate
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"
}

Archive a campaign.

post

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
200

Archived.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
post/campaigns/{id}/archive
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"
}

Restore an archived campaign.

post

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
200

Unarchived.

application/json
idstringRequiredExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
objectconst: campaignRequired
namestring Β· max: 200Required
channelstring Β· enumRequired

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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 with date_time in the future (view-only convenience derived from upcoming).
  • ongoing β€” recurring send (weekly/daily/etc.). Also the legacy recurring status.
  • sending β€” worker is actively dispatching. Also the dashboard's optimized_sending.
  • sent β€” completed.
  • paused β€” canceled/paused by the user. Stored as the dashboard's own pause token (legacy docs may also carry paused); both read as paused.
  • failed β€” send worker errored terminally.
  • archived β€” archived via POST /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 by POST /v3/campaigns/{id}/unarchive.
Possible values:
template_idstring Β· nullableOptional

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).

Example: tpl_6ab24872ba90b88e270b4904Pattern: ^tpl_[0-9a-f]{24}$
message_bodystring Β· nullableOptional

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.

message_titlestring Β· nullableOptional

Push/SMS message title; email subject line. Legacy column: message_title.

subjectstring Β· nullableOptional

Email subject line (mirrors message_title for email campaigns). Legacy column: subject.

objectivestring Β· nullableOptional

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.

from_phone_numberstring Β· nullableOptional

SMS/voice only. Sender phone (E.164). Legacy column: fromnumber. NOT a v3 PhoneNumber resource ID β€” a raw phone string.

from_emailstring Β· email Β· nullableOptional

Email only. Sender address. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_email.

from_namestring Β· nullableOptional

Email only. Sender display name. Resolved from the workroom's email-settings default at creation time when omitted. Legacy column: from_name.

reply_tostring Β· email Β· nullableOptional

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.

reply_to_namestring Β· nullableOptional

Email only. Reply-To display name. Defaults to the sender name when omitted. Legacy column: reply_to_name.

attachment_urlstring Β· uri Β· nullableOptional

MMS attachment URL. Legacy column: full_path.

labelstring Β· nullableOptional

Optional organizational label (dashboard's campaign labels feature).

tagsstring[]Optional

Campaign-level tags (not contact tags).

created_atstring Β· date-timeRequired

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

Set when the campaign was archived (POST /v3/campaigns/{id}/archive); null otherwise. Its presence is what drives status archived.

Example: 2026-05-27T14:23:11.482Z
post/campaigns/{id}/unarchive
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"
}

Send a test rendering to specific addresses.

post

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

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

QA-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.

Responses
200

Test sends dispatched. Returns the created Messages.

application/json
objectconst: listOptional
post/campaigns/{id}/test_send
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"
    }
  ]
}

List materialized recipients for a campaign.

get

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".

Authorizations
AuthorizationstringRequired

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

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

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

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

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

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

Page size. Default 25, max 100.

Default: 25
cursorstringOptional

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
200

A page of recipients.

application/json
objectconst: listRequired
has_morebooleanRequired

True if additional records exist beyond this page.

next_cursorstring Β· nullableRequired

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

prev_cursorstring Β· nullableRequired

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

get/campaigns/{id}/recipients
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"
}

Aggregate stats for a campaign.

get

Returns delivery, engagement, and (if A/B) per-variant breakdown. Numbers stabilize hours after send as delivered/opened/clicked events roll in from providers.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
200

Analytics payload.

application/json
objectconst: campaign_analyticsOptional
campaign_idstringOptionalExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
computed_atstring Β· date-timeOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
get/campaigns/{id}/analytics
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"
}

List per-recipient message records for a campaign.

get

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.

Authorizations
AuthorizationstringRequired

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

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

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

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

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

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

Page size. Default 25, max 100.

Default: 25
cursorstringOptional

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

Header parameters
Gleantap-VersionstringOptional

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

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

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

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

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

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

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

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

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

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

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

Example: G Test1
Responses
200

A page of messages.

application/json
objectconst: listRequired
has_morebooleanRequired

True if additional records exist beyond this page.

next_cursorstring Β· nullableRequired

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

prev_cursorstring Β· nullableRequired

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

get/campaigns/{id}/messages
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"
}