API · Customers

Customers

A customer is a person in the organization's database.

  • POST /customers — creation with deduplication.
  • GET /customers/search — search by identities; not found is data: null, not an error: the “not found — register” scenario.
  • GET /customers/{id} — the card, include=history adds the change history; PATCH /customers/{id} — partial update of fields.
  • POST and DELETE /customers/{id}/identities — identities of custom types, without Idempotency-Key: the operations have a natural key, a repeat is harmless.
  • POST and DELETE /customers/{id}/labels[/{code}] — manual labels; active labels are always included in Customer.labels.
  • GET /customers/{id}/timeline — the customer timeline: interactions, consents, verifications, labels and field changes by time, with a cursor.
  • POST /customers/{id}/merge — merging duplicates (the “Customer merge” section of the introduction).

Create a customer with deduplication

POST/customers

Creation is synchronous: the response is either the customer card or CONFLICT. Ability customers:write; the Idempotency-Key header is required.

Body: type — the code of an active customer type (GET /schema/customer → types); attributes — customer schema fields under their codes, including fields on slots (GET /schema/customer → fields): they are validated and normalized by their definitions, required fields must be sent, an unknown field or a field not visible to the API is VALIDATION_FAILED with details.fields.<code>; identities — identities of custom types (qr_token, des_uuid, …) under the type code; identities of slot types (phone, email, national_id) are derived from the fields on slots automatically, and a key of such a type in identities is an error details.fields["identities.<type>"]; source — the channel code (snake_case, up to 64 characters; defaults to api).

Deduplication: a unique identity (by its normalized value — E.164, lowercase, digits only, as is — according to the type setting) already belongs to another customer → CONFLICT with details.identity: {type, value} and details.existing_id; the customer is not created. Two concurrent requests with the same identity create one customer — a database index enforces uniqueness. The 201 response is the customer card (Customer); assets is an empty array (a new customer has no assets); balances are zeros for all active account kinds.

Parameters

  • Idempotency-Keystringheaderrequired

    Idempotency key: unique within the client, lives for 24 hours. A repeat with the same key and request returns the saved response with meta.idempotent_replay: true; a different request with the same key gets IDEMPOTENCY_MISMATCH. A UUID is recommended.
    Constraints
    minLength: 1maxLength: 255

Request body

application/json

CustomerInput

Customer creation body
  • typestringrequired

    Code of an active customer type (customer_type)
    Example
    consumer
  • attributesobject

    Customer schema fields under their codes (GET /schema/customer), including fields on slots. Values follow the field type: a phone in any notation (normalized to E.164 by the field's default_region), a date as Y-m-d, datetime — RFC 3339 with a time zone, decimal — as a string.
    Example
    {"passport":"N1234567","mobile":"8 701 123 45 67","full_name":"John Smith","favorite_product":"sku-1001"}
  • identitiesobject

    Identities of arbitrary types: type code → value as a string. Slot types (phone, email, national_id) are not accepted here — they are derived from the fields.
    Example
    {"qr_token":"7F3A-91C0"}

    Key values: string

  • sourcestring | null

    Channel code (snake_case in Latin letters, up to 64 characters); api when omitted
    Constraints
    pattern: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$
    Example
    mobile_app
  • consentsarray<ConsentInput> | null

    “Given” consents submitted at registration: recorded in one transaction with the customer (fact source — api, occurred_at defaults to the registration moment) and visible in the consents block of the response. A customer type can require consents (the type's settings.consents): without them — VALIDATION_FAILED under consents (“Consent "pdn" is required.”); if the type settings refer to a nonexistent consent type — VALIDATION_FAILED under type (an error in the organization's configuration, not in the body). Item errors are under consents.<i>.<field>: shape errors (no channel, not a list) — at once, value errors (type, version, attachment) — together with schema field errors in one response.
    Constraints
    maxItems: 100
    Example
    [{"type":"pdn","channel":"app","attachment_id":"01928c3e-7b1a-7c00-9d2e-5f7a1c2b3d4e"}]

Responses

  • 201

    Customer created

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 409

    CONFLICT — the unique identity already belongs to another customer (details.identity, details.existing_id); IDEMPOTENCY_IN_PROGRESS — a request with this key is still running (details.key).

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields: type, source, schema fields under their codes (passport, phone, …), identities.<type>, Idempotency-Key; IDEMPOTENCY_MISMATCH — the key has already been used for a different request (details.key).

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Find a customer by identities

GET/customers/search

A lookup for “does this customer exist”: the criteria are identities of unique types; the value is normalized by the type's rule (phone — E.164, a number without + is parsed in the default_region of the field on the phone slot; e-mail — lowercase; national_id — per the type setting; custom types — as configured), and the match is exact. System types are passed as the phone, email, national_id parameters; any type as identity[<type code>] (for system types both ways are equivalent). Several criteria must match the same customer. Ability customers:read.

The response is always 200: found — the Customer card in data; not found — data: null (not an error: the next step is registration via POST /customers). Only customers with the active status are found. A slot type can be searched only if the field on its slot is visible to the API (visibility.api) — otherwise the type does not exist for an API client.

VALIDATION_FAILED (details.fields, the key is the type code as in the request): no criteria (identity), a parameter outside the list (Unknown search parameter), an unknown or hidden type, a non-unique type (it cannot identify a customer unambiguously), an empty or unparseable value, a foreign include block.

Parameters

  • phonestringquery

    Phone in any format; without +, in the region of the field on the phone slot
    Example
    +7 (771) 123 45 678 771 123 45 67
  • emailstringquery

  • national_idstringquery

    ID document; normalized per the type setting (for example, digits — digits only)
    Example
    123 456 789 012
  • identityobjectquery

    Identities of any type — identity[<type code>]=<value>

    Sent as keys: name[key]=value

    Key values: string

    Example
    {"qr_token":"7F3A-91C0"}
  • includestringquery

    Comma-separated card extensions. labels, consents (consent state by type), balances, assets are always in data; history — the customer's change history (Customer.history, rows in write order, only for fields visible to the API; consent state changes — consents.<type>). An unknown block — VALIDATION_FAILED with details.fields.include.
    Example
    history

Responses

  • 200

    Search result — a customer or null

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields with errors by field

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Customer card by id

GET/customers/{id}

A customer of any status — a direct link, not a search. Ability customers:read. Not in the token's organization — NOT_FOUND with details.id; an id that is not a UUID is also 404.

Parameters

  • idstring (uuid)pathrequired

  • includestringquery

    Comma-separated card extensions. labels, consents (consent state by type), balances, assets are always in data; history — the customer's change history (Customer.history, rows in write order, only for fields visible to the API; consent state changes — consents.<type>). An unknown block — VALIDATION_FAILED with details.fields.include.
    Example
    history

Responses

  • 200

    Customer card

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — resource or route not found

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields with errors by field

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Partially update customer fields

PATCH/customers/{id}

Edits schema fields: attributes holds only the fields being changed, under their codes (including fields on slots, as on creation); null clears an optional field, a required field cannot be cleared with null; fields not sent are left untouched. The phone is normalized to E.164, e-mail to lowercase; identities of slot types follow the fields: changing the phone removes the old identity and adds the new one; if the new one belongs to another customer — CONFLICT with details.identity and details.existing_id, and the whole edit is rolled back. Each change is a history row with an author (the token's API client) and an event; an edit “to the same value” and an empty body are a no-op (200, updated_at does not change). type, source and identities are not accepted here: the type and source do not change, and identities of custom types have their own routes. Ability customers:write; no idempotency key is needed — repeating the same edit changes nothing. The type, source, identities keys are forbidden in the body (VALIDATION_FAILED), not silently dropped. Concurrent edits of the same customer: the last one wins for the whole row (attributes); only explicitly removed identities are deleted; there is no optimistic locking.

Parameters

  • idstring (uuid)pathrequired

Request body

The body is optional

An empty body is a no-op

application/json

CustomerPatch

Customer partial edit body
  • attributesobject

    Only the schema fields being changed, under their codes; null clears an optional field
    Example
    {"mobile":"8 701 000 00 01","favorite_product":null}

Responses

  • 200

    Customer card after the edit

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — resource or route not found

    Error format and codes

  • 409

    CONFLICT — a conflict with existing data. A request with the ID of a merged customer — both reads and writes — is redirected to the primary customer (meta.redirected_from). For writes, if the customer was merged while the request was waiting, the operation is restarted once on the primary customer; a second conflict in the restart is returned: the primary was merged too — details.customer_id, details.merged_into; the customer was changed concurrently with the edit — details.customer_id, re-read and retry

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields: attributes, schema fields under their codes

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Merge a duplicate customer into the primary one

POST/customers/{id}/merge

Merge “B into A”: {id} is the primary A, absorbed_id is the absorbed B. In one transaction A receives B's interactions, consents, verifications, limit usage, assets and all identities; manual labels are combined, rule labels are recalculated on A; empty fields of A are filled with B's values; balances are moved by pairs of transfer entries. B gets the merged status and a link to A; its history, accounts and entries stay with it. Irreversible. Requests by B's id after the merge are redirected to A (meta.redirected_from). Ids are not resolved: you cannot merge into an absorbed customer — re-read the primary one. Ability customers:merge (granted by the organization administrator; customers:read and customers:write are not needed), Idempotency-Key is required, the project plays no part — interactions of all projects are moved. The response is the card of A after the merge; a repeat with the same key and body returns the saved response and meta.idempotent_replay: true.

Parameters

  • Idempotency-Keystringheaderrequired

    Idempotency key: unique within the client, lives for 24 hours. A repeat with the same key and request returns the saved response with meta.idempotent_replay: true; a different request with the same key gets IDEMPOTENCY_MISMATCH. A UUID is recommended.
    Constraints
    minLength: 1maxLength: 255
  • idstring (uuid)pathrequired

    The primary customer A

Request body

application/json

object

  • absorbed_idstring (uuid)required

    The absorbed customer B of the same organization and the same type

No other keys

Responses

  • 200

    Merged — the primary customer's card after the merge

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — the primary or the absorbed customer is not in the organization (details.id); checked before “same customer”

    Error format and codes

  • 409

    IDEMPOTENCY_IN_PROGRESS — a request with this key is still running (details.key); CONFLICT — the primary or the absorbed customer is already merged: details.reason: already_merged, details.customer_id, details.merged_into (its primary; repeating the same merge with a new idempotency key also returns this)

    Error format and codes

  • 422

    VALIDATION_FAILED — body shape: details.fields.absorbed_id (missing, not a uuid), an extra key — under its own name, a list body — under body, Idempotency-Key; merge refusal (nothing is written) — details.reason and details.fields: same_customer (customer_id; under absorbed_id), not_active (customer_id, status; the primary under id, the absorbed under absorbed_id), type_mismatch (types — the types of A and B; under absorbed_id), balance_out_of_range (account_kind — A's balance of this kind after the transfer does not fit the account; under absorbed_id). IDEMPOTENCY_MISMATCH — the key has already been used for a different request (details.key).

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Add a custom-type identity to a customer

POST/customers/{id}/identities

Identities of custom types (qr_token, des_uuid, …). Slot types (phone, email, national_id) are not accepted here — they are set by the field on the slot via PATCH (VALIDATION_FAILED under type). The value is normalized per the type setting; if the customer already has the same identity — a 200 response with no changes (a repeat is safe); if it belongs to another customer (the type is unique) — CONFLICT with details.existing_id. Ability customers:write.

Parameters

  • idstring (uuid)pathrequired

Request body

application/json

CustomerIdentityInput

Identity of an arbitrary type to add to a customer
  • typestringrequired

    Identity type code; slot types phone, email, national_id are not accepted
    Constraints
    maxLength: 64
    Example
    qr_token
  • valuestringrequired

    Leading and trailing spaces are trimmed; spaces only — VALIDATION_FAILED
    Constraints
    minLength: 1maxLength: 255
    Example
    7F3A-91C0

Responses

  • 200

    Customer card with the identity

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — resource or route not found

    Error format and codes

  • 409

    CONFLICT — a conflict with existing data. A request with the ID of a merged customer — both reads and writes — is redirected to the primary customer (meta.redirected_from). For writes, if the customer was merged while the request was waiting, the operation is restarted once on the primary customer; a second conflict in the restart is returned: the primary was merged too — details.customer_id, details.merged_into; the customer was changed concurrently with the edit — details.customer_id, re-read and retry

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields.type (unknown or slot type), details.fields.value

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Remove a custom-type identity from a customer

DELETE/customers/{id}/identities/{identity}

By the identity id from the card (Customer.identities[].id). Already removed, belonging to someone else or nonexistent — NOT_FOUND with details.identity; a slot identity (phone, email, national_id) — VALIDATION_FAILED under identity: it follows the field on the slot and is cleared via PATCH. The value becomes free for other customers. Ability customers:write.

Parameters

  • idstring (uuid)pathrequired

  • identitystring (uuid)pathrequired

    Identity id

Responses

  • 200

    Customer card without the identity

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — the customer (details.id) or the identity on it (details.identity)

    Error format and codes

  • 409

    CONFLICT — a conflict with existing data. A request with the ID of a merged customer — both reads and writes — is redirected to the primary customer (meta.redirected_from). For writes, if the customer was merged while the request was waiting, the operation is restarted once on the primary customer; a second conflict in the restart is returned: the primary was merged too — details.customer_id, details.merged_into; the customer was changed concurrently with the edit — details.customer_id, re-read and retry

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields with errors by field

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Set a manual label on a customer

POST/customers/{id}/labels

The code is an active label type (entity_types:label), case-insensitive (BLOCK_DISCOUNT → block_discount); kind (block — blocks operations, segment — a group, flag — an attribute) comes from the type. reason is a human-readable reason, expires_at is an RFC 3339 expiry with a time zone, later than the current moment; without it the label never expires. The same active label with the same reason and expiry — 200 with no changes (a repeat is safe); a different reason or expiry — an update keeping the original setting moment; an expired label is set anew. Each setting is a labels.<code> history row with an author and an event. The response is the card with active labels, including rule labels recalculated by this setting (a rule that depends on a manual label fires in the same request). Ability customers:write; no idempotency key is needed.

Parameters

  • idstring (uuid)pathrequired

Request body

application/json

CustomerLabelInput

Setting a manual label
  • codestringrequired

    Code of an active label type (entity_types:label), case-insensitive
    Constraints
    maxLength: 64
    Example
    BLOCK_DISCOUNT
  • reasonstring | null

    Human-readable reason; leading and trailing spaces are trimmed, spaces only count as empty
    Constraints
    maxLength: 2000
    Example
    Suspected fraud
  • expires_atstring (date-time) | null

    Expiry — strictly RFC 3339 with a time zone (Z or ±hh:mm; a date without time and zone is rejected), later than the current moment; fractional seconds are dropped. Without it — no expiry.
    Constraints
    maxLength: 64

Responses

  • 200

    Customer card with labels

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — resource or route not found

    Error format and codes

  • 409

    CONFLICT — a conflict with existing data. A request with the ID of a merged customer — both reads and writes — is redirected to the primary customer (meta.redirected_from). For writes, if the customer was merged while the request was waiting, the operation is restarted once on the primary customer; a second conflict in the restart is returned: the primary was merged too — details.customer_id, details.merged_into; the customer was changed concurrently with the edit — details.customer_id, re-read and retry

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields.code (unknown or inactive type), reason, expires_at (not RFC 3339 or in the past)

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Remove a label from a customer

DELETE/customers/{id}/labels/{code}

Removes the manual row by the label code; a rule row is set and removed only by the rule. If the label also has a rule row, it stays active. The label is active only through a rule row — CONFLICT with details.label, details.sources: [rule], details.rule_id. No active label with this code — never set, already removed or expired — NOT_FOUND with details.label. A removal is a history row (snapshot → null) and an event. The response is the card with rule labels recalculated by this removal. Ability customers:write.

Parameters

  • idstring (uuid)pathrequired

  • codestringpathrequired

    Label type code, case-insensitive
    Constraints
    pattern: ^[A-Za-z0-9_]+$

Responses

  • 200

    Customer card after removing the manual row; if a rule row holds the label, it stays in labels (source: rule)

    application/json

    object

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — the customer (details.id) or the active label on it (details.label)

    Error format and codes

  • 409

    CONFLICT — the label is active only through a rule row, and the rule removes it: details.label (the code as sent), details.sources: [rule], details.rule_id; CONFLICT — the customer is merged into another: details.customer_id, details.merged_into — the primary

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Customer timeline

GET/customers/{id}/timeline

The customer timeline — events of seven kinds in one feed: interaction (an interaction, moment — started_at), consent (each “given”/“revoked” record, moment — occurred_at), verification (a code issued to the customer, moment — created_at), label (a label set, changed, removed), field (an edit of a field, identity, type or status — like an include=history row), ledger_entry (an account entry, moment — created_at; a reversing entry is a separate element) and asset_event (an asset history event, moment — created_at: registration, transition, owner change, cancellation on void — where the customer is the owner “before” or “after”; both customers see an owner change, a handed-in asset stays in the timeline of the customer who handed it in, a cancellation on void is seen by the owner at the moment of the void and by the customer the asset returned to). Order — moment descending; for equal moments — kind in the order interaction, consent, verification, then label/field, then ledger_entry, then asset_event, then ID descending. Cursor pagination: meta.cursor.next is passed as the cursor parameter with the same kind until it becomes null. Interaction and consent moments follow the client's clock: a row recorded retroactively during a traversal may land behind the cursor and appear only in a new traversal. Ability customers:read; the interaction kind also needs interactions:read, the ledger_entry kind also needs ledgers:read, the asset_event kind also needs assets:read: without the kind's ability its elements are absent from the timeline, and an explicit request for the kind gives FORBIDDEN with details.ability. Interactions of projects assigned to the API client are visible (including deactivated ones); a consent, verification, entry and asset event recorded together with an interaction (interaction_id; for an asset event — also its cancellation on void) are visible only together with it; asset events without an interaction and the asset itself — to everyone who sees the customer. Field edits — only of fields visible to the API (as in include=history); a verification has no address and no attempts. The customer is not in the organization — NOT_FOUND with details.id; parameter errors — VALIDATION_FAILED with details.fields.<parameter> before the customer check: first the shape (an array instead of a string, a non-numeric limit, a parameter outside the list — “Unknown parameter”, a numeric name — under query), then an explicitly requested interaction, ledger_entry or asset_event without the ability — FORBIDDEN (before value errors), then the values at once (kind, limit range); the cursor is checked only when kind and limit are valid.

Parameters

  • idstring (uuid)pathrequired

  • kindstringquery

    Comma-separated kinds, case-insensitive (interaction,consent); without the parameter — all kinds available to the API client. An unknown or empty element — VALIDATION_FAILED under kind.
    Constraints
    maxLength: 255
    Example
    interactionlabel,field
  • limitintegerquery

    List page size, 1…200; 50 when omitted
    Default
    50
    Constraints
    minimum: 1maximum: 200
  • cursorstringquery

    Opaque cursor from meta.cursor.next of the previous page; valid only with the same filters — otherwise VALIDATION_FAILED under cursor. Without the parameter — the first page.
    Constraints
    maxLength: 512

Responses

  • 200

    A page of the timeline

    application/json

    object

    • dataarray<TimelineEntry>required

    • metaobjectrequired

      Service data of the response; for lists it contains cursor
      Fields
      • cursorobjectrequired

        Fields
        • nextstring | nullrequired

          Cursor of the next page, null — there are no more pages
      • redirected_fromstring (uuid)

        Only on a redirect: the request came with the ID of a customer merged into another one (in the path or in the body's customer_id), the response is for the primary one; the value is the original ID (normalized, lower case). Without a redirect the key is absent. A retry with the same Idempotency-Key returns the response stored by the first execution as is.
      • idempotent_replayboolean

        Only on a retry: the response is taken from the idempotency store, data is byte-for-byte the same as in the first response; or a retry by the interaction's natural key external_id — data is the existing interaction in its current state; or a repeated void of an already voided one. The first execution has no such field.
        Always
        true
      • versioninteger

        Only in catalog lists: the catalog version — for items it is read before the rows of the first page of the traversal, for changes it is the upper bound of the feed. The next sync is changes?since=<version>.
        Constraints
        minimum: 0
      • recordedinteger

        Only when recording consents: how many rows were inserted; 0 — the whole batch was already recorded (a retry by natural key).
        Constraints
        minimum: 0
      • effectsInteractionEffects

  • 401

    UNAUTHENTICATED — the Bearer token is missing or invalid

    Error format and codes

  • 403

    FORBIDDEN — the token lacks an ability (details.ability) or a project (details.project)

    Error format and codes

  • 404

    NOT_FOUND — resource or route not found

    Error format and codes

  • 422

    VALIDATION_FAILED — details.fields with errors by field

    Error format and codes

  • 429

    RATE_LIMITED — the client's rate limit is exceeded: details.limit — the limit per minute, details.retry_after — in how many seconds to retry; the same values are in the headers X-RateLimit-Limit and Retry-After.

    Headers

    • Retry-Afterinteger

      Seconds until the window resets
    • X-RateLimit-Limitinteger

    • X-RateLimit-Remaininginteger

    Error format and codes

Schemas

ConsentInput

object

Consent batch item; the same item is used in the consents block at registration and in an interaction (there occurred_at defaults to the interaction's started_at). interaction_id is forbidden in the item — the server sets the link to the interaction.
  • typestringrequired

    Consent type code (entity_types:consent_type), case-insensitive
    Constraints
    maxLength: 64
    Example
    pdn
  • versioninteger | null

    Text version number from GET /consents/texts. Without it: “given” — the current version on the local date of occurred_at in the organization's time zone (without that — on the local today), “revoked” — the version of the customer's last record of the type, otherwise the current one. A nonexistent number — VALIDATION_FAILED.
    Constraints
    minimum: 1
    Example
    1
  • channelstringrequired

    Where the customer expressed their will — an arbitrary channel code in snake_case (app, office, paper, web); the CRM does not interpret it
    Constraints
    maxLength: 64
    Example
    app
  • agent_refstring | null

    External ID of the agent in whose presence consent was given (predates the agent registry); leading and trailing spaces are trimmed
    Constraints
    maxLength: 255
    Example
    AG-7
  • attachment_idstring (uuid) | null

    Signature attachment (POST /attachments) in this organization, not yet linked or linked to a record of the same batch (one signature for several types). Linking removes the retention period.
  • occurred_atstring (date-time) | null

    Moment of the fact by the client's clock — strictly RFC 3339 with a time zone (Z or ±hh:mm), no later than the request moment plus one minute (tolerance for the device clock); fractional seconds are dropped. Without it — the request moment. Part of the fact's natural key: a retry with the same value does not create a record.
    Constraints
    maxLength: 64

Customer

object

The customer card — one contract for POST /customers, GET /customers/search and GET /customers/{id}. attributes — every active schema field visible to the API, under its code (not set — null); identities — all identities with normalized values (slot types phone/email/national_id — only if the field of that slot is visible to the API, custom types — always); labels — active labels; in responses of customer operations they already include rule labels recalculated by this request. consents — consent state by type (the latest record of each type; types without records are absent); balances — one element for each active account kind of the organization (an account has no project — it is visible to everyone who can see the customer; a kind without entries shows zero; a disabled kind is not returned); assets — assets whose current owner is the customer, in any status, newest first (an asset has no project; assets of disabled types and of types with corrupted settings are not returned — the latter until the settings are fixed on the “Entity types” page); history — only with include=history.
  • idstring (uuid)required

  • typestringrequired

    Customer type code
  • statusstringrequired

    Record lifecycle; blocks and segments are labels, not a status
    Values
    activearchivedmerged
  • sourcestringrequired

    Code of the channel that created the record (api, admin, import or a custom one)
  • attributesobjectrequired

  • identitiesarray<CustomerIdentity>required

  • labelsarray<CustomerLabel>required

    Active labels, one element per code, in order of the code's first row; the top-level created_at is the moment of the manual row if there is one, so it can be later than that of the next label
  • consentsarray<Consent>required

    The latest record of each consent type, by type code
  • balancesarray<CustomerBalance>required

    By active account kinds, in ascending order of the kind code
  • assetsarray<Asset>required

  • created_atstring (date-time)required

    ISO 8601, UTC
  • updated_atstring (date-time)required

    ISO 8601, UTC
  • historyarray<CustomerHistoryEntry>

    Only with include=history; without it the key is absent

CustomerIdentity

object

A customer identity — the normalized value (E.164, lower case, digits only or as is — depending on the type); id is for DELETE /customers/{id}/identities/{identity}.
  • idstring (uuid)required

  • typestringrequired

    Identity type code (phone, email, national_id or a custom one)
  • valuestringrequired

CustomerLabel

object

Active customer label — one item per code; expired labels are not in the response. A label can have two rows — manual and rule; the label is active while at least one of them is. The top-level fields come from the manual row if there is one, otherwise from the rule row; sources — each active row.
  • codestringrequired

    Label type code (lower case)
  • kindstringrequired

    Kind from the type settings — blocking operations, a group, a flag
    Values
    blocksegmentflag
  • reasonstring | nullrequired

  • expires_atstring (date-time) | nullrequired

    ISO 8601, UTC; null — no expiry
  • sourcestringrequired

    Set manually or by a rule
    Values
    manualrule
  • created_byActorrequired

  • created_atstring (date-time)required

    Moment the label was set, ISO 8601, UTC
  • sourcesarray<CustomerLabelSource>required

    Active label rows by source — the manual one first

Actor

object

Who performed the operation — an API client, an admin panel user or the system
  • kindstringrequired

    Values
    api_clientusersystem
  • idstring | nullrequired

    ID of the API client (UUID) or user; null for system

CustomerLabelSource

object

Label row of one source: a person sets and removes the manual row, only the rule sets and removes the rule row (it cannot be removed via DELETE …/labels/{code}).
  • sourcestringrequired

    Values
    manualrule
  • rule_idstring (uuid) | nullrequired

    Rule that set the row; null for the manual one
  • reasonstring | nullrequired

  • expires_atstring (date-time) | nullrequired

    ISO 8601, UTC; null — no expiry
  • created_byActorrequired

  • created_atstring (date-time)required

    Moment the row was set, ISO 8601, UTC

object

Consent state by type — the last record
  • typestringrequired

    Consent type code
  • statusstringrequired

    Values
    givenrevoked
  • versionintegerrequired

    Number of the text version the record refers to
    Constraints
    minimum: 1
  • channelstringrequired

  • agent_refstring | nullrequired

  • occurred_atstring (date-time)required

    Moment of the fact by the client's clock, ISO 8601, UTC
  • sourcestringrequired

    How the fact reached the CRM (api, admin, import, …)
  • attachment_idstring (uuid) | nullrequired

    Signature attachment; link — GET /attachments/{id}/url
  • interaction_idstring (uuid) | nullrequired

    Interaction in which it was submitted; null before it
  • created_byActorrequired

  • created_atstring (date-time)required

    Record moment, ISO 8601, UTC

CustomerBalance

object

Customer balance by account kind. There is no kind label — as with the card's labels and consents, kind labels are in the schema (GET /v1/schema).
  • account_kindstringrequired

    Account kind code (entity_types:account_kind)
    Example
    points
  • balancestringrequired

    Balance — a decimal as a string with exactly the kind's number of decimal places (scale): "0" for a kind with no decimal places, "100.50" for a kind with two; can be negative (a minus allowed by the kind, or a reversal).
    Example
    100100.50-40.00
  • unitobject | nullrequired

    Unit label for displaying the balance — a “language → text” object with any languages; null — not set. One form per language, as set on the account kind: plural forms by number (“1 point”, “5 points”) are not returned by the API — the forms are in the account kind settings, and only the admin panel uses them.
    Example
    {"ru":"балл","en":"pts"}

    Key values: string

Asset

object

Customer asset — an item of the customer card's assets, of lists and of asset write responses. The status is a code without a label (status labels are in the asset type settings, as with balances and labels). attributes — each active field of the asset:<type> schema visible to the API, under its code (not set — null).
  • idstring (uuid)required

  • typestringrequired

    Asset type code (entity_types:asset_type)
    Example
    device
  • serialstringrequired

    Serial number as sent (without leading and trailing spaces, NFC); unique within the type by its normalized form
  • modelobject | nullrequired

    Model — an item of the type's catalog (catalog); null — no model specified
    Fields
    • idstring (uuid)required

    • codestringrequired

      Item code in the catalog
  • statusstringrequired

    Status code from the type settings
    Example
    owned
  • customer_idstring (uuid) | nullrequired

    Owner; null — the asset has no owner (after the registering interaction is voided or the owner is removed)
  • attributesobjectrequired

  • created_atstring (date-time)required

    ISO 8601, UTC
  • updated_atstring (date-time)required

    Moment of the last change (status, owner, attributes), ISO 8601, UTC

CustomerHistoryEntry

object

A change of one customer field: field — the path (type, status, a slot code — phone, national_id, …; attributes.<field code>; identities.<type> — the list of normalized values of the type; labels.<code> — labels), old_value/new_value — before and after (null — was not set / is no longer set). On creation — a row for each value set.
  • fieldstringrequired

    Example
    phoneattributes.favorite_productidentities.qr_token
  • old_valueany valuerequired

  • new_valueany valuerequired

  • created_byActorrequired

  • created_atstring (date-time)required

    ISO 8601, UTC

Meta

object

Service data of the response; for lists it contains cursor
  • cursorobject

    Fields
    • nextstring | nullrequired

      Cursor of the next page, null — there are no more pages
  • redirected_fromstring (uuid)

    Only on a redirect: the request came with the ID of a customer merged into another one (in the path or in the body's customer_id), the response is for the primary one; the value is the original ID (normalized, lower case). Without a redirect the key is absent. A retry with the same Idempotency-Key returns the response stored by the first execution as is.
  • idempotent_replayboolean

    Only on a retry: the response is taken from the idempotency store, data is byte-for-byte the same as in the first response; or a retry by the interaction's natural key external_id — data is the existing interaction in its current state; or a repeated void of an already voided one. The first execution has no such field.
    Always
    true
  • versioninteger

    Only in catalog lists: the catalog version — for items it is read before the rows of the first page of the traversal, for changes it is the upper bound of the feed. The next sync is changes?since=<version>.
    Constraints
    minimum: 0
  • recordedinteger

    Only when recording consents: how many rows were inserted; 0 — the whole batch was already recorded (a retry by natural key).
    Constraints
    minimum: 0
  • effectsInteractionEffects

InteractionEffects

object

Effects of the operation: what rules and accounts did in its transaction. On a retry by external_id the deltas are empty. Rules are recalculated when an interaction is created, edited and voided: labels_added and labels_removed are labels the customer gained and lost; a change of a rule row that did not make a label appear or disappear (a manual row exists alongside, a row of another rule is overwritten) is visible only in rules_fired. balances — changes to the customer's balances made by the operation (redemptions and accruals on create, offsetting entries on void), one element per kind in ascending order of the code; empty on a retry and an edit. assets — asset changes made by the operation (actions on item serial numbers on create, their reversal on void) in recording order; empty on a retry and an edit. labels and current_balances — the customer's state after the operation, returned on a retry too.
  • labels_addedarray<CustomerLabel>required

    Labels the customer gained in the operation
  • labels_removedarray<string>required

    Codes of labels the customer lost in the operation
  • balancesarray<BalanceChange>required

    Balance changes of the operation by account kind
  • assetsarray<AssetChange>required

    Asset changes of the operation
  • rules_firedarray<RuleFired>required

    Changes to label rows made by rules, in order of application
  • labelsarray<CustomerLabel>required

    The customer's active labels after the operation
  • current_balancesarray<CustomerBalance>required

    The customer's current balances after the operation — like balances of the customer card: one element for each active account kind, zero without entries

BalanceChange

object

A change of the customer's balance of one account kind in the operation: change — the sum of the operation's entries for the kind (signed; a redemption and an accrual of one kind make one element), balance — the balance after; decimal as a string with exactly the kind's scale, unit — as in CustomerBalance. A kind with corrupted settings (a void goes through for it as well) — in canonical form, unit: null.
  • account_kindstringrequired

  • changestringrequired

    Example
    -3000
  • balancestringrequired

    Example
    2000
  • unitobject | nullrequired

    As unit in CustomerBalance — one unit form per language, not inflected by number

    Key values: string

AssetChange

object

An asset change made by an interaction operation: registered — registration (status_from: null) or re-linking of an ownerless asset, transitioned — a transition of the customer's asset, reverted — undone on void; customer_id — the owner after the change
  • idstring (uuid)required

  • typestringrequired

    Asset type code
  • serialstringrequired

    Serial number as recorded
  • eventstringrequired

    Values
    registeredtransitionedreverted
  • status_fromstring | nullrequired

  • status_tostringrequired

  • customer_idstring (uuid) | nullrequired

RuleFired

object

A rule that fired: the rule's label row was set (set) or removed (removed).
  • rulestringrequired

    Rule code
  • rule_idstring (uuid)required

    Rule ID — same as sources[].rule_id of a customer label
  • labelstringrequired

    Label code
  • actionstringrequired

    Values
    setremoved

TimelineEntry

object

A customer timeline element. id — the ID of the source row: for interaction — the interaction ID (GET /interactions/{id}), for consent and verification — of the record and the verification, for label and field — of the history row, for ledger_entry — of the entry (POST /ledger-entries/{id}/reverse), for asset_event — of the asset history event (GET /assets/{id}, history). at — the moment of the event, actor — who recorded it, details — depends on the kind.

TimelineKind

string

Kind of a customer timeline element (closed list)
Values
interactionconsentverificationlabelfieldledger_entryasset_event

TimelineInteraction

object

details for kind: interaction — the interaction in its current state (voided — status: void)
  • typestringrequired

  • projectstringrequired

    Project code
  • statusstringrequired

    Values
    activevoid
  • resultstringrequired

    Values
    effectiveineffective
  • external_idstring | nullrequired

  • agent_refstring | nullrequired

    External agent ID as sent in the interaction; not checked against the registry
  • voided_atstring (date-time) | nullrequired

TimelineConsent

object

details for kind: consent — a “given” or “revoked” record
  • typestringrequired

  • statusstringrequired

    Values
    givenrevoked
  • versionintegerrequired

  • channelstringrequired

  • sourcestringrequired

  • agent_refstring | nullrequired

  • attachment_idstring (uuid) | nullrequired

  • interaction_idstring (uuid) | nullrequired

TimelineVerification

object

details for kind: verification — a code issued to the customer, without the address and attempts
  • purposestringrequired

  • channelstringrequired

    Values
    smswhatsapp
  • statusVerificationStatusrequired

  • verified_atstring (date-time) | nullrequired

  • interaction_idstring (uuid) | nullrequired

VerificationStatus

string

Verification state (closed list). pending — the code is issued and awaits input (delivery may not have happened yet); verified — confirmed; expired — the code has expired; failed — the provider did not send it (see failure_reason).
Values
pendingverifiedexpiredfailed

TimelineLabel

object

details for kind: label — a customer label row: a manual row and a rule row of the same code are separate records, the source is in the snapshot (source, for a rule row — rule_id); added (did not exist), changed (a different reason or expiry), removed (no longer exists); before/after — snapshots or null. Expiry is not an event.

TimelineLabelSnapshot

object

  • kindstringrequired

    Values
    blocksegmentflag
  • sourcestringrequired

    Values
    manualrule
  • reasonstring | nullrequired

  • expires_atstring (date-time) | nullrequired

  • rule_idstring (uuid)

    Only for a rule row — the rule that set the row

TimelineField

object

details for kind: field — a change of one field, like an include=history row (schema CustomerHistoryEntry): the path, before and after; customer creation gives rows with old_value: null.
  • fieldstringrequired

    Example
    phoneattributes.favorite_productidentities.qr_tokentype
  • old_valueany valuerequired

  • new_valueany valuerequired

TimelineLedgerEntry

object

details for kind: ledger_entry — an entry on a customer account: the LedgerEntry schema fields without the ID, author and moment (they are in the timeline element), without reversal_id and external_id.
  • account_kindstringrequired

    Example
    points
  • kindLedgerEntryKindrequired

  • amountstringrequired

    Signed amount — a decimal as a string with the kind's number of decimal places
    Example
    100-40.00
  • reasonstring | nullrequired

  • interaction_idstring (uuid) | nullrequired

  • decision_row_idstring (uuid) | nullrequired

  • reverses_entry_idstring (uuid) | nullrequired

LedgerEntryKind

string

Entry kind (closed list): manual — manual (API, customer card), redemption — a spend in an interaction request, accrual — an award by the account kind's decision table, reversal — the offsetting reversal entry, transfer — a balance transfer on a customer merge: a pair with an offsetting entry, minus on the absorbed customer, plus on the primary, without a cause, not reversible; in the entry list and timeline of the primary the pairs within the group “primary and those merged into it” are not returned, entries of merged customers are
Values
manualredemptionaccrualreversaltransfer

TimelineAssetEvent

object

details for kind: asset_event — an asset history event: the AssetEvent schema fields without the ID, author and moment (they are in the timeline element), plus the asset it belongs to (as in InteractionAssetEvent). Statuses are codes from the type settings, without labels; events of a disabled asset type remain.
  • asset_idstring (uuid)required

  • typestringrequired

    Asset type code
  • serialstringrequired

    Serial number as recorded
  • numberintegerrequired

    Event number of the asset — the history order
    Constraints
    minimum: 1
  • kindstringrequired

    Values
    registeredtransitionedowner_changedreverted
  • status_fromstring | nullrequired

    Status before the event; null for the first registration
  • status_tostringrequired

  • owner_from_idstring (uuid) | nullrequired

  • owner_to_idstring (uuid) | nullrequired

  • interaction_idstring (uuid) | nullrequired

    The interaction that changed the asset; for an undo on void — the voided one
  • reverts_event_idstring (uuid) | nullrequired

  • reasonstring | nullrequired