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 isdata: null, not an error: the “not found — register” scenario.GET /customers/{id}— the card,include=historyadds the change history;PATCH /customers/{id}— partial update of fields.POSTandDELETE /customers/{id}/identities— identities of custom types, withoutIdempotency-Key: the operations have a natural key, a repeat is harmless.POSTandDELETE /customers/{id}/labels[/{code}]— manual labels; active labels are always included inCustomer.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-KeystringheaderrequiredIdempotency key: unique within the client, lives for 24 hours. A repeat with the same key and request returns the saved response withmeta.idempotent_replay: true; a different request with the same key getsIDEMPOTENCY_MISMATCH. A UUID is recommended.- Constraints
minLength: 1maxLength: 255
Request body
application/json
CustomerInput
typestringrequiredCode of an active customer type (customer_type)- Example
consumer
attributesobjectCustomer 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'sdefault_region), a date asY-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"}
identitiesobjectIdentities 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 | nullChannel code (snake_case in Latin letters, up to 64 characters);apiwhen 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_atdefaults to the registration moment) and visible in theconsentsblock of the response. A customer type can require consents (the type'ssettings.consents): without them —VALIDATION_FAILEDunderconsents(“Consent "pdn" is required.”); if the type settings refer to a nonexistent consent type —VALIDATION_FAILEDundertype(an error in the organization's configuration, not in the body). Item errors are underconsents.<i>.<field>: shape errors (nochannel, 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
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)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).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).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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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
phonestringqueryPhone in any format; without+, in the region of the field on thephoneslot- Example
+7 (771) 123 45 678 771 123 45 67
emailstringquerynational_idstringqueryID document; normalized per the type setting (for example,digits— digits only)- Example
123 456 789 012
identityobjectqueryIdentities of any type —identity[<type code>]=<value>Sent as keys: name[key]=value
Key values: string
- Example
{"qr_token":"7F3A-91C0"}
includestringqueryComma-separated card extensions.labels,consents(consent state by type),balances,assetsare always indata;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_FAILEDwithdetails.fields.include.- Example
history
Responses
200
Search result — a customer or null
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)422
VALIDATION_FAILED —
details.fieldswith errors by field429
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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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)pathrequiredincludestringqueryComma-separated card extensions.labels,consents(consent state by type),balances,assetsare always indata;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_FAILEDwithdetails.fields.include.- Example
history
Responses
200
Customer card
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — resource or route not found
422
VALIDATION_FAILED —
details.fieldswith errors by field429
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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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
attributesobjectOnly the schema fields being changed, under their codes;nullclears an optional field- Example
{"mobile":"8 701 000 00 01","favorite_product":null}
Responses
200
Customer card after the edit
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — resource or route not found
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 retry422
VALIDATION_FAILED —
details.fields:attributes, schema fields under their codes429
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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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-KeystringheaderrequiredIdempotency key: unique within the client, lives for 24 hours. A repeat with the same key and request returns the saved response withmeta.idempotent_replay: true; a different request with the same key getsIDEMPOTENCY_MISMATCH. A UUID is recommended.- Constraints
minLength: 1maxLength: 255
idstring (uuid)pathrequiredThe primary customer A
Request body
application/json
object
absorbed_idstring (uuid)requiredThe 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
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — the primary or the absorbed customer is not in the organization (
details.id); checked before “same customer”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)422
VALIDATION_FAILED — body shape:
details.fields.absorbed_id(missing, not a uuid), an extra key — under its own name, a list body — underbody,Idempotency-Key; merge refusal (nothing is written) —details.reasonanddetails.fields:same_customer(customer_id; underabsorbed_id),not_active(customer_id,status; the primary underid, the absorbed underabsorbed_id),type_mismatch(types— the types of A and B; underabsorbed_id),balance_out_of_range(account_kind— A's balance of this kind after the transfer does not fit the account; underabsorbed_id). IDEMPOTENCY_MISMATCH — the key has already been used for a different request (details.key).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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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
typestringrequiredIdentity type code; slot typesphone,email,national_idare not accepted- Constraints
maxLength: 64- Example
qr_token
valuestringrequiredLeading and trailing spaces are trimmed; spaces only —VALIDATION_FAILED- Constraints
minLength: 1maxLength: 255- Example
7F3A-91C0
Responses
200
Customer card with the identity
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — resource or route not found
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 retry422
VALIDATION_FAILED —
details.fields.type(unknown or slot type),details.fields.value429
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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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)pathrequiredidentitystring (uuid)pathrequiredIdentity id
Responses
200
Customer card without the identity
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — the customer (
details.id) or the identity on it (details.identity)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 retry422
VALIDATION_FAILED —
details.fieldswith errors by field429
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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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
codestringrequiredCode of an active label type (entity_types:label), case-insensitive- Constraints
maxLength: 64- Example
BLOCK_DISCOUNT
reasonstring | nullHuman-readable reason; leading and trailing spaces are trimmed, spaces only count as empty- Constraints
maxLength: 2000- Example
Suspected fraud
expires_atstring (date-time) | nullExpiry — strictly RFC 3339 with a time zone (Zor±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
401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — resource or route not found
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 retry422
VALIDATION_FAILED —
details.fields.code(unknown or inactive type),reason,expires_at(not RFC 3339 or in the past)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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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)pathrequiredcodestringpathrequiredLabel 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)401
UNAUTHENTICATED — the Bearer token is missing or invalid
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — the customer (
details.id) or the active label on it (details.label)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 primary429
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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
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)pathrequiredkindstringqueryComma-separated kinds, case-insensitive (interaction,consent); without the parameter — all kinds available to the API client. An unknown or empty element —VALIDATION_FAILEDunderkind.- Constraints
maxLength: 255
- Example
interactionlabel,field
limitintegerqueryList page size, 1…200; 50 when omitted- Default
50- Constraints
minimum: 1maximum: 200
cursorstringqueryOpaque cursor frommeta.cursor.nextof the previous page; valid only with the same filters — otherwiseVALIDATION_FAILEDundercursor. Without the parameter — the first page.- Constraints
maxLength: 512
Responses
200
A page of the timeline
application/jsonobject
dataarray<TimelineEntry>requiredmetaobjectrequiredService data of the response; for lists it containscursorFields
cursorobjectrequiredFields
nextstring | nullrequiredCursor 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'scustomer_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 sameIdempotency-Keyreturns the response stored by the first execution as is.idempotent_replaybooleanOnly on a retry: the response is taken from the idempotency store,datais byte-for-byte the same as in the first response; or a retry by the interaction's natural keyexternal_id—datais 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
versionintegerOnly 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 ischanges?since=<version>.- Constraints
minimum: 0
recordedintegerOnly 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
403
FORBIDDEN — the token lacks an ability (
details.ability) or a project (details.project)404
NOT_FOUND — resource or route not found
422
VALIDATION_FAILED —
details.fieldswith errors by field429
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 headersX-RateLimit-LimitandRetry-After.Headers
Retry-AfterintegerSeconds until the window resetsX-RateLimit-LimitintegerX-RateLimit-Remaininginteger
Schemas
ConsentInput
object
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.typestringrequiredConsent type code (entity_types:consent_type), case-insensitive- Constraints
maxLength: 64- Example
pdn
versioninteger | nullText version number fromGET /consents/texts. Without it: “given” — the current version on the local date ofoccurred_atin 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
channelstringrequiredWhere 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 | nullExternal 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) | nullSignature 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) | nullMoment of the fact by the client's clock — strictly RFC 3339 with a time zone (Zor±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
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)requiredtypestringrequiredCustomer type codestatusstringrequiredRecord lifecycle; blocks and segments are labels, not a status- Values
activearchivedmerged
sourcestringrequiredCode of the channel that created the record (api,admin,importor a custom one)attributesobjectrequiredidentitiesarray<CustomerIdentity>requiredlabelsarray<CustomerLabel>requiredActive 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 labelconsentsarray<Consent>requiredThe latest record of each consent type, by type codebalancesarray<CustomerBalance>requiredBy active account kinds, in ascending order of the kind codeassetsarray<Asset>requiredcreated_atstring (date-time)requiredISO 8601, UTCupdated_atstring (date-time)requiredISO 8601, UTChistoryarray<CustomerHistoryEntry>Only withinclude=history; without it the key is absent
CustomerIdentity
object
id is for DELETE /customers/{id}/identities/{identity}.idstring (uuid)requiredtypestringrequiredIdentity type code (phone,email,national_idor a custom one)valuestringrequired
CustomerLabel
object
sources — each active row.codestringrequiredLabel type code (lower case)kindstringrequiredKind from the type settings — blocking operations, a group, a flag- Values
blocksegmentflag
reasonstring | nullrequiredexpires_atstring (date-time) | nullrequiredISO 8601, UTC; null — no expirysourcestringrequiredSet manually or by a rule- Values
manualrule
created_byActorrequiredcreated_atstring (date-time)requiredMoment the label was set, ISO 8601, UTCsourcesarray<CustomerLabelSource>requiredActive label rows by source — the manual one first
Actor
object
kindstringrequired- Values
api_clientusersystem
idstring | nullrequiredID of the API client (UUID) or user; null forsystem
CustomerLabelSource
object
DELETE …/labels/{code}).sourcestringrequired- Values
manualrule
rule_idstring (uuid) | nullrequiredRule that set the row; null for the manual onereasonstring | nullrequiredexpires_atstring (date-time) | nullrequiredISO 8601, UTC; null — no expirycreated_byActorrequiredcreated_atstring (date-time)requiredMoment the row was set, ISO 8601, UTC
Consent
object
typestringrequiredConsent type codestatusstringrequired- Values
givenrevoked
versionintegerrequiredNumber of the text version the record refers to- Constraints
minimum: 1
channelstringrequiredagent_refstring | nullrequiredoccurred_atstring (date-time)requiredMoment of the fact by the client's clock, ISO 8601, UTCsourcestringrequiredHow the fact reached the CRM (api,admin,import, …)attachment_idstring (uuid) | nullrequiredSignature attachment; link —GET /attachments/{id}/urlinteraction_idstring (uuid) | nullrequiredInteraction in which it was submitted; null before itcreated_byActorrequiredcreated_atstring (date-time)requiredRecord moment, ISO 8601, UTC
CustomerBalance
object
GET /v1/schema).account_kindstringrequiredAccount kind code (entity_types:account_kind)- Example
points
balancestringrequiredBalance — 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 | nullrequiredUnit 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
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)requiredtypestringrequiredAsset type code (entity_types:asset_type)- Example
device
serialstringrequiredSerial number as sent (without leading and trailing spaces, NFC); unique within the type by its normalized formmodelobject | nullrequiredModel — an item of the type's catalog (catalog); null — no model specifiedFields
idstring (uuid)requiredcodestringrequiredItem code in the catalog
statusstringrequiredStatus code from the type settings- Example
owned
customer_idstring (uuid) | nullrequiredOwner; null — the asset has no owner (after the registering interaction is voided or the owner is removed)attributesobjectrequiredcreated_atstring (date-time)requiredISO 8601, UTCupdated_atstring (date-time)requiredMoment of the last change (status, owner, attributes), ISO 8601, UTC
CustomerHistoryEntry
object
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 valuerequirednew_valueany valuerequiredcreated_byActorrequiredcreated_atstring (date-time)requiredISO 8601, UTC
Meta
object
cursorcursorobjectFields
nextstring | nullrequiredCursor 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'scustomer_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 sameIdempotency-Keyreturns the response stored by the first execution as is.idempotent_replaybooleanOnly on a retry: the response is taken from the idempotency store,datais byte-for-byte the same as in the first response; or a retry by the interaction's natural keyexternal_id—datais 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
versionintegerOnly 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 ischanges?since=<version>.- Constraints
minimum: 0
recordedintegerOnly 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
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>requiredLabels the customer gained in the operationlabels_removedarray<string>requiredCodes of labels the customer lost in the operationbalancesarray<BalanceChange>requiredBalance changes of the operation by account kindassetsarray<AssetChange>requiredAsset changes of the operationrules_firedarray<RuleFired>requiredChanges to label rows made by rules, in order of applicationlabelsarray<CustomerLabel>requiredThe customer's active labels after the operationcurrent_balancesarray<CustomerBalance>requiredThe customer's current balances after the operation — likebalancesof the customer card: one element for each active account kind, zero without entries
BalanceChange
object
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_kindstringrequiredchangestringrequired- Example
-3000
balancestringrequired- Example
2000
unitobject | nullrequiredAsunitinCustomerBalance— one unit form per language, not inflected by numberKey values: string
AssetChange
object
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 changeidstring (uuid)requiredtypestringrequiredAsset type codeserialstringrequiredSerial number as recordedeventstringrequired- Values
registeredtransitionedreverted
status_fromstring | nullrequiredstatus_tostringrequiredcustomer_idstring (uuid) | nullrequired
RuleFired
object
set) or removed (removed).rulestringrequiredRule coderule_idstring (uuid)requiredRule ID — same assources[].rule_idof a customer labellabelstringrequiredLabel codeactionstringrequired- Values
setremoved
TimelineEntry
object
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.kindTimelineKindrequiredidstring (uuid)requiredatstring (date-time)requiredISO 8601, UTC, to the secondactorActorrequireddetailsTimelineInteraction | TimelineConsent | TimelineVerification | TimelineLabel | TimelineField | TimelineLedgerEntry | TimelineAssetEventrequired
TimelineKind
string
- Values
interactionconsentverificationlabelfieldledger_entryasset_event
TimelineInteraction
object
details for kind: interaction — the interaction in its current state (voided — status: void)typestringrequiredprojectstringrequiredProject codestatusstringrequired- Values
activevoid
resultstringrequired- Values
effectiveineffective
external_idstring | nullrequiredagent_refstring | nullrequiredExternal agent ID as sent in the interaction; not checked against the registryvoided_atstring (date-time) | nullrequired
TimelineConsent
object
details for kind: consent — a “given” or “revoked” recordtypestringrequiredstatusstringrequired- Values
givenrevoked
versionintegerrequiredchannelstringrequiredsourcestringrequiredagent_refstring | nullrequiredattachment_idstring (uuid) | nullrequiredinteraction_idstring (uuid) | nullrequired
TimelineVerification
object
details for kind: verification — a code issued to the customer, without the address and attemptspurposestringrequiredchannelstringrequired- Values
smswhatsapp
statusVerificationStatusrequiredverified_atstring (date-time) | nullrequiredinteraction_idstring (uuid) | nullrequired
VerificationStatus
string
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.codestringrequiredactionstringrequired- Values
addedchangedremoved
beforeTimelineLabelSnapshot | nullrequiredafterTimelineLabelSnapshot | nullrequired
TimelineLabelSnapshot
object
kindstringrequired- Values
blocksegmentflag
sourcestringrequired- Values
manualrule
reasonstring | nullrequiredexpires_atstring (date-time) | nullrequiredrule_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 valuerequirednew_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
kindLedgerEntryKindrequiredamountstringrequiredSigned amount — a decimal as a string with the kind's number of decimal places- Example
100-40.00
reasonstring | nullrequiredinteraction_idstring (uuid) | nullrequireddecision_row_idstring (uuid) | nullrequiredreverses_entry_idstring (uuid) | nullrequired
LedgerEntryKind
string
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)requiredtypestringrequiredAsset type codeserialstringrequiredSerial number as recordednumberintegerrequiredEvent number of the asset — the history order- Constraints
minimum: 1
kindstringrequired- Values
registeredtransitionedowner_changedreverted
status_fromstring | nullrequiredStatus before the event; null for the first registrationstatus_tostringrequiredowner_from_idstring (uuid) | nullrequiredowner_to_idstring (uuid) | nullrequiredinteraction_idstring (uuid) | nullrequiredThe interaction that changed the asset; for an undo on void — the voided onereverts_event_idstring (uuid) | nullrequiredreasonstring | nullrequired