Imports
CSV contact imports β history, contacts and the per-file segment.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Page size. Default 25, max 100.
25Minor 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 Test1Past imports.
True if additional records exist beyond this page.
Opaque cursor for the next page. Null on the last page.
Cursor for the previous page. Supported on listContacts and listSegmentContacts: pass it back as ?before=... to page backward; null on the first page. On every other list endpoint paging is forward-only and this is always null.
GET /v3/imports HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Past imports.
{
"object": "text",
"data": [
{
"id": "imp_6aac889bfa86c0fcd2091fa2",
"object": "import",
"filename": "text",
"status": "initializing",
"total": 1,
"imported": 1,
"failed": 1,
"unique_code": 1,
"segment_id": "seg_01H8XKE...",
"workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
"uploaded_by": "text",
"created_at": "2026-05-27T14:23:11.482Z",
"errors": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
}
],
"has_more": true,
"next_cursor": "text",
"prev_cursor": "text"
}Does what the dashboard's CSV upload screen does, so an import made here is indistinguishable from one made in the UI:
contacts are upserted: matched on
match_on(defaultemail) first, then β as the dashboard import does β by member id, phone and email in turn, whichever the row carries (phone/email legs also require the first name when the row has one). Deleted contacts never match;the import appears in Upload History;
a dynamic segment
Segment - <filename> - <code>is created holding exactly the contacts from this file.
That segment is the useful part β it is how you then message or enrol just this batch. Every contact is stamped with the import's code, and the stamp is appended, so a contact appearing in several imports stays in all of their segments.
Pass the file contents as csv (first line must be a header row) or pre-parsed rows. Recognized headers β email, phone, first/last name, external_id, timezone, locale, date_of_birth, in several spellings β become contact fields; source β the contact's source (default csv, as the dashboard writes), location β its location, member_id β its member id (user_id, and data.member_id), tags (comma-separated) β CRM tags. Every other column is kept as a custom field, coerced to its registered type, so nothing is silently dropped. New contacts count toward the workroom's contact total, and the import's segment gets its contact count (size) straight away, computed with the segment engine β membership itself is still computed by the dashboard the first time a campaign or flow uses the segment. Max 10,000 rows; split larger files.
Imports exactly the CSV content supplied. An omitted workroom imports every contact into the account default.
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.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1A unique key (β€255 chars) chosen by the client. Replays with the same key + same body return the cached response. Replays with the same key + different body return 409 idempotency_conflict. Required on messaging sends and bulk operations; recommended elsewhere.
8e3c7a90-7c4d-4f8e-8e3c-7a907c4d4f8eThe import, with the segment it created.
One CSV import, as it appears in the dashboard's Upload History.
imp_6aac889bfa86c0fcd2091fa2completed_with_errors = finished with some rows failed (failed > 0); stored as completed so the dashboard's Upload History shows it. failed = no row imported.
Rows found in the file.
Contacts created or updated.
Rows that could not be imported; see errors.
The import's code, stamped onto each contact as csv_unique_code_array and matched by the segment.
The dynamic segment holding exactly this file's contacts.
seg_01H8XKE...Pattern: ^seg_[0-9A-HJKMNP-TV-Z]{26}$wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$RFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZThe contacts imported. Only on the create response.
The CSV could not be used β empty, header-only, or too many rows.
POST /v3/imports HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 143
{
"filename": "text",
"csv": "text",
"rows": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"match_on": "email",
"create_segment": true,
"segment_name": "text"
}{
"id": "imp_6aac889bfa86c0fcd2091fa2",
"object": "import",
"filename": "text",
"status": "initializing",
"total": 1,
"imported": 1,
"failed": 1,
"unique_code": 1,
"segment_id": "seg_01H8XKE...",
"workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
"uploaded_by": "text",
"created_at": "2026-05-27T14:23:11.482Z",
"errors": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
}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.
imp_<24-hex>.
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_59fca1e3d2a57d28a10b0442The import.
One CSV import, as it appears in the dashboard's Upload History.
imp_6aac889bfa86c0fcd2091fa2completed_with_errors = finished with some rows failed (failed > 0); stored as completed so the dashboard's Upload History shows it. failed = no row imported.
Rows found in the file.
Contacts created or updated.
Rows that could not be imported; see errors.
The import's code, stamped onto each contact as csv_unique_code_array and matched by the segment.
The dynamic segment holding exactly this file's contacts.
seg_01H8XKE...Pattern: ^seg_[0-9A-HJKMNP-TV-Z]{26}$wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$RFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZThe contacts imported. Only on the create response.
GET /v3/imports/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
The import.
{
"id": "imp_6aac889bfa86c0fcd2091fa2",
"object": "import",
"filename": "text",
"status": "initializing",
"total": 1,
"imported": 1,
"failed": 1,
"unique_code": 1,
"segment_id": "seg_01H8XKE...",
"workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
"uploaded_by": "text",
"created_at": "2026-05-27T14:23:11.482Z",
"errors": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"contact_ids": [
"con_6a7eaec3505bea795709f897"
]
}Deletes the history entry only. The contacts the import created and the segment it created are deliberately left in place: the contacts are real people who may already have been messaged, and the segment may already be wired into a flow or campaign.
This is bookkeeping, not an undo β there is no safe automatic undo for an import. To reverse one, delete the segment and the contacts explicitly.
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.
imp_<24-hex>.
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_59fca1e3d2a57d28a10b0442Removed from history.
No content
No such import in this account.
DELETE /v3/imports/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content