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

Messages

Individual message records β€” the result of a notification send or a conversation reply β€” plus /messages/report, which aggregates them into delivery and engagement figures.

Opens and clicks are unique-only. Only a contact's first open of a message is recorded, because mail clients, link scanners, and Apple Mail Privacy Protection trigger the tracking pixel repeatedly. SMS has no open tracking, so opened is always zero for SMS.

Delivery and engagement, aggregated.

get

How email and SMS sends performed β€” deliveries, bounces, drops, opens and clicks, with the rates derived from them. Aggregates the per-message send records, so it reflects individual messages rather than campaign-level rollups, and can therefore break down by day, location and flow.

Pass group_by for a breakdown β€” day, location, channel, campaign, flow or campaign_type. For campaign and flow the group key comes back as a prefixed id, so it can be passed straight back as a filter to drill in. Every grouping partitions the same population, so a grouping's sent values sum to the summary's.

sent / delivered use the dashboard's own definitions (see MessageMetrics); attempted is every dispatched message. For SMS, delivery is the carrier outcome, not the provider handoff.

group_by=day buckets by calendar day in the workroom timezone, like the dashboard's trend chart: sends by the day they were sent, and opened / clicked / unsubscribed by the day that event happened (inside the window, for messages sent in the window).

Filters and group_by compose, so "open rate by location for one flow last month" is a single call. Filters are accepted either bare (?channel=email) or as filter[channel]=email.

campaign_type separates sends someone launched as a campaign from sends a flow produced. Flow sends are shadow campaigns β€” a flow's message node has a paired campaign record β€” so both live together and are told apart by that link, not by where they are stored.

Always bounded. Without since/until this reports the last 30 days; the widest accepted window is 366 days. Bare dates are read in the workroom timezone (date-only until = end of that day), matching the dashboard's reports.

Opens and clicks are unique-only, and SMS has no open tracking β€” see the resource description before comparing these to another system's figures.

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.

group_bystring Β· enumOptional

Break the figures out on this dimension instead of returning totals only.

Possible values:
sincestring Β· date-timeOptional

Start of the window, inclusive. Defaults to 30 days before until. Read as UTC unless an offset is given.

untilstring Β· date-timeOptional

End of the window, inclusive. Defaults to now.

channelstring Β· enumOptionalPossible values:
campaign_typestring Β· enumOptional

campaign for sends launched directly; flow for sends a flow produced.

Possible values:
campaign_idstringOptionalExample: cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$
flow_idstringOptionalExample: flw_01H8XKV...Pattern: ^flw_[0-9A-HJKMNP-TV-Z]{26}$
locationstringOptional

The recipient's location, matched exactly and case-insensitively. Taken from the contact, since messages carry no location of their own.

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

Totals, or a breakdown when group_by was passed.

application/json
or
get/messages/report
GET /v3/messages/report HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "message_report",
  "window": {
    "since": "2026-01-01T00:00:00.000Z",
    "until": "2026-01-01T00:00:00.000Z"
  },
  "channels": [
    "email"
  ],
  "summary": {
    "attempted": 1,
    "sent": 1,
    "delivered": 1,
    "bounced": 1,
    "dropped": 1,
    "undelivered": 1,
    "delayed": 1,
    "failed": 1,
    "unaccounted": 1,
    "complaints": 1,
    "unsubscribed": 1,
    "campaigns": 1,
    "flows": 1,
    "opened": 1,
    "clicked": 1,
    "contacts": 1,
    "delivery_rate": 1,
    "bounce_rate": 1,
    "drop_rate": 1,
    "open_rate": 1,
    "click_rate": 1,
    "click_to_open_rate": 1,
    "spam_rate": 1,
    "unsubscribe_rate": 1
  }
}

Retrieve a message.

get

Fetch a single message record by ID. Works for messages produced by notifications, campaigns, flows, or inbound conversations β€” same shape everywhere.

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: msg_6a7eaec3505bea795709f897Pattern: ^msg_[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
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 message.

application/json

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

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

Delivery channel. Push is not supported by Gleantap.

Possible values:
statusstring Β· enumRequired

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

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

Possible values:
categorystring Β· enumRequired

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

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

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

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

Which version of the template was rendered.

subjectstring Β· nullableOptional

Email only.

body_snippetstring Β· nullableOptional

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

providerstring Β· nullableOptional

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

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

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

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
get/messages/{id}
GET /v3/messages/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "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"
}