POST /v1/contacts
Create a contact
Create a contact
Creates a contact with source "api". Supports Idempotency-Key. Requires scope write:deals.
- Автентифікація: заголовок
Authorization: Bearer rv_live_...(API-ключі та scopes) - Потрібний scope:
write:deals
openapi.json) і подається англійською, як у самому API.Параметри
| Поле | Де | Тип | Обов’язк. | Опис |
|---|---|---|---|---|
idempotency-key | header | string | ні | Makes a retry of this POST safe for 24 hours: the same key and body returns the stored response (Idempotent-Replay: true). |
Тіло запиту
| Поле | Тип | Обов’язк. | Опис |
|---|---|---|---|
type | "lead" | "client" | "partner" | ні | |
fullName | string | так | |
phones | string[] | ні | |
emails | string[] | ні | |
telegramId | string | number | null | ні | |
telegramUsername | string | null | ні | |
viberId | string | null | ні | |
ownerUserId | string | null (uuid) | ні | |
tags | string[] | ні | |
consentMarketing | boolean | ні | |
preferredChannel | "telegram" | "viber" | "email" | "sms" | "webhook" | "in_app" | null | ні | |
locale | "uk" | "pl" | "en" | ні | |
notes | string | null | ні | |
utm | object | null | ні | |
allowDuplicate | boolean | ні | Create even if a contact with the same phone/email/Telegram exists (otherwise 409 with duplicate_ids). |
Відповіді
201
The created contact.
application/json · Схема: Contact
| Поле | Тип | Обов’язк. | Опис |
|---|---|---|---|
id | string (uuid) | так | |
type | "lead" | "client" | "partner" | так | |
fullName | string | так | |
phones | string[] | так | E.164. |
emails | string[] | так | |
telegramId | string | null | так | |
telegramUsername | string | null | так | |
viberId | string | null | так | |
source | "site" | "telegram" | "instagram" | "referral" | "ads" | "manual" | "viber" | "widget" | "extension" | "api" | "import" | "marketplace" | так | |
ownerUserId | string | null (uuid) | так | |
tags | string[] | так | |
consentMarketing | boolean | так | |
preferredChannel | "telegram" | "viber" | "email" | "sms" | "webhook" | "in_app" | null | так | |
locale | "uk" | "pl" | "en" | так | |
notes | string | null | так | |
createdAt | string | так | ISO 8601 date-time (UTC). |
updatedAt | string | так | ISO 8601 date-time (UTC). |
400
Invalid request parameters or body (code validation_error).
application/problem+json · Схема: Problem
401
Missing, malformed, unknown, revoked or expired API key (code unauthorized).
application/problem+json · Схема: Problem
403
The API key lacks the scope required by this endpoint (code insufficient_scope).
application/problem+json · Схема: Problem
409
Conflict: duplicate contact (duplicate_ids), a request with this Idempotency-Key is still being processed, or the stage transition is blocked (missing[]).
application/problem+json · Схема: Problem
422
Well-formed but not acceptable data (unprocessable_input), or Idempotency-Key reused with a different request.
application/problem+json · Схема: Problem
429
Rate limit exceeded for the tenant plan (code rate_limited). Wait Retry-After seconds.
application/problem+json · Схема: Problem