Conversions
Revenue attribution, read-only. A conversion definition (created in the dashboard) describes the outcome to count and which campaigns can earn credit. Gleantap periodically attributes matching activity to the last campaign or flow touch within the definition's window and records one conversion row per attribution. attribution_channel is email, sms, or flow; treat an empty value as unknown attribution.
The conversion rules configured for the workroom β what counts as a conversion, what each is worth, and which campaign it attributes to. Use this to find a conversion_id before filtering the report, or to explain why a conversion is or is not being recorded.
An unparseable campaign_id or an unrecognised event_type is rejected rather than ignored, so a mistyped filter cannot come back as a full unfiltered list.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.
Page size. Default 25, max 100.
25Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1Conversion definitions.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
GET /v3/conversions HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "list",
"data": [
{
"object": "conversion",
"id": "text",
"name": "text",
"value": 1,
"event_type": "became_a_customer",
"campaign_id": "cam_6a7eaec3505bea795709f897",
"workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
"criteria": {}
}
],
"has_more": true,
"next_cursor": "text"
}Which campaigns and flows earned conversions, and what they were worth. Reads the table a periodic job builds; it does not recompute attribution, so a conversion that happened minutes ago may not appear yet.
Returns one row per attributed conversion, plus a summary. Pass group_by to get a rollup instead of rows β channel, campaign, flow, location, event_type or day. 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 filter combines with every other, and group_by respects them, so "revenue by location for one flow since March" is one call. Filters are accepted either bare (?channel=email) or as filter[channel]=email.
total_value sums a field the writer stores as a string; a row whose value cannot be read as a number contributes 0 rather than failing the report.
Scoped to one workroom unless a workroom is named or workroom=all is passed.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.
Page size. Default 25, max 100.
25Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.
Return a rollup on this dimension instead of individual rows.
campaign for credit won by a campaign someone sent; flow for credit won by a flow step.
The channel the crediting message actually went out on, recovered from the sending campaign. Distinct from channel, which holds either a channel or flow and so loses email-vs-SMS on flow-attributed revenue. Combining the two gives a campaign-vs-flow by email-vs-SMS breakdown.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$flw_01H8XKV...Pattern: ^flw_[0-9A-HJKMNP-TV-Z]{26}$Prefixed cvn_, not cnv_ β that prefix already belongs to conversations.
^cvn_[0-9a-f]{24}$Exact match, case-insensitive. Matches numeric locations too.
flow is a peer of the message channels here, not a separate axis β it is what the writer stores when a flow step earned the credit. sms and email also include flow-won conversions whose sending campaign went out on that channel (the dashboard's per-channel definition); flow matches the stored value only. push and snailmail only appear on historic rows.
Inclusive lower bound on when the conversion was attributed. A date or offset-less time is read in the workroom's timezone, as the dashboard report does.
Inclusive upper bound. A date-only value (2026-10-31) includes that whole day in the workroom's timezone.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1The report β rows, or groups when group_by was passed.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
GET /v3/conversions/report HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "conversion_report",
"summary": {
"conversions": 1,
"conversion_events": 1,
"total_value": 1,
"contacts": 1
},
"data": [
{
"object": "conversion_report_row",
"conversion_id": "text",
"contact_id": "con_6a7eaec3505bea795709f897",
"value": 1,
"event_type": "text",
"attribution_channel": "",
"campaign_id": "cam_6a7eaec3505bea795709f897",
"flow_id": "flw_01H8XKV...",
"campaign_step": "text",
"location": "text",
"converted_at": "2026-01-01T00:00:00.000Z",
"workroom_id": "wrm_5ace370fd2a57d74d0548fb2"
}
],
"has_more": true,
"next_cursor": "text"
}One conversion rule, including its full criteria in the segment condition DSL. Use it to see exactly what a conversion requires and which campaign it credits.
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.
Prefixed cvn_, not cnv_ β that prefix already belongs to conversations.
^cvn_[0-9a-f]{24}$Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1The conversion definition.
A conversion definition β the rule that decides what counts as a conversion and what it is worth.
Prefixed cvn_, not cnv_ β that prefix already belongs to conversations.
^cvn_[0-9a-f]{24}$Money credited per conversion. Stored as a string by the dashboard; surfaced as a number because the report sums it.
Which kind of activity the rule keys on. The vocabulary below is taken from the values actually present in the collection.
cam_6a7eaec3505bea795709f897Pattern: ^cam_[0-9a-f]{24}$wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$The rule, in the same condition DSL segments use. The clause naming a campaign with "Targeted By" is what makes this attribution rather than a plain segment.
The resource doesn't exist or isn't visible to this caller.
GET /v3/conversions/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "conversion",
"id": "text",
"name": "text",
"value": 1,
"event_type": "became_a_customer",
"campaign_id": "cam_6a7eaec3505bea795709f897",
"workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
"criteria": {}
}