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

Imports

CSV contact imports β€” history, contacts and the per-file segment.

Upload History β€” past CSV imports, newest first.

get
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
limitinteger Β· min: 1 Β· max: 100Optional

Page size. Default 25, max 100.

Default: 25
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

Past imports.

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/imports
GET /v3/imports HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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

Import contacts from a CSV.

post

Does what the dashboard's CSV upload screen does, so an import made here is indistinguishable from one made in the UI:

  1. contacts are upserted: matched on match_on (default email) 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;

  2. the import appears in Upload History;

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

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.

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
anyOptional
or
anyOptional
Responses
201

The import, with the segment it created.

application/json

One CSV import, as it appears in the dashboard's Upload History.

idstringRequiredExample: imp_6aac889bfa86c0fcd2091fa2
objectstring Β· enumRequiredPossible values:
filenamestring Β· nullableOptional
statusstring Β· enumRequired

completed_with_errors = finished with some rows failed (failed > 0); stored as completed so the dashboard's Upload History shows it. failed = no row imported.

Possible values:
totalintegerOptional

Rows found in the file.

importedintegerOptional

Contacts created or updated.

failedintegerOptional

Rows that could not be imported; see errors.

unique_codeinteger Β· nullableOptional

The import's code, stamped onto each contact as csv_unique_code_array and matched by the segment.

segment_idstring Β· nullableOptional

The dynamic segment holding exactly this file's contacts.

Example: seg_01H8XKE...Pattern: ^seg_[0-9A-HJKMNP-TV-Z]{26}$
workroom_idstring Β· nullableOptionalExample: wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$
uploaded_bystring Β· nullableOptional
created_atstring Β· date-timeOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
contact_idsstring[]Optional

The contacts imported. Only on the create response.

post/imports
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"
  ]
}

Retrieve one import.

get
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
idstringRequired

imp_<24-hex>.

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
Responses
200

The import.

application/json

One CSV import, as it appears in the dashboard's Upload History.

idstringRequiredExample: imp_6aac889bfa86c0fcd2091fa2
objectstring Β· enumRequiredPossible values:
filenamestring Β· nullableOptional
statusstring Β· enumRequired

completed_with_errors = finished with some rows failed (failed > 0); stored as completed so the dashboard's Upload History shows it. failed = no row imported.

Possible values:
totalintegerOptional

Rows found in the file.

importedintegerOptional

Contacts created or updated.

failedintegerOptional

Rows that could not be imported; see errors.

unique_codeinteger Β· nullableOptional

The import's code, stamped onto each contact as csv_unique_code_array and matched by the segment.

segment_idstring Β· nullableOptional

The dynamic segment holding exactly this file's contacts.

Example: seg_01H8XKE...Pattern: ^seg_[0-9A-HJKMNP-TV-Z]{26}$
workroom_idstring Β· nullableOptionalExample: wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$
uploaded_bystring Β· nullableOptional
created_atstring Β· date-timeOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
contact_idsstring[]Optional

The contacts imported. Only on the create response.

get/imports/{id}
GET /v3/imports/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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

Remove an import from Upload History.

delete

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.

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
idstringRequired

imp_<24-hex>.

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
Responses
204

Removed from history.

No content

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

No content