ImportOS · Документація
Довідник API

POST /v1/leads

Register a lead

Register a lead

The single entry point for leads: finds an existing contact by phone/email/Telegram (and updates it) or creates one, assigns an owner (round-robin if enabled), creates a search request when search parameters are given and a "contact the lead" task. Supports Idempotency-Key and externalRef. Requires scope write:deals.

  • Автентифікація: заголовок Authorization: Bearer rv_live_... (API-ключі та scopes)
  • Потрібний scope: write:deals
Опис операції, параметрів і полів походить зі специфікації OpenAPI (openapi.json) і подається англійською, як у самому API.

Параметри

ПолеДеТипОбов’язк.Опис
idempotency-keyheaderstringніMakes a retry of this POST safe for 24 hours: the same key and body returns the stored response (Idempotent-Replay: true).

Тіло запиту

ПолеТипОбов’язк.Опис
formstringні
fullNamestring | nullні
phonestring | nullні
emailstring | nullні
telegramIdstring | number | nullні
telegramUsernamestring | nullні
viberIdstring | nullні
locale"uk" | "pl" | "en"ні
messagestring | nullні
utmobjectні
referrerstring | nullні
landingUrlstring | nullні
consentMarketingbooleanні
ownerUserIdstring | null (uuid)ні
requestobjectні
request.budgetMinnumber | string | nullні
request.budgetMaxnumber | string | nullні
request.currency"UAH" | "USD" | "EUR" | "PLN" | "GEL"ні
request.markets"us" | "eu" | "cn" | "kr" | "ua" | "ge"[]ні
request.makestring | nullні
request.modelstring | nullні
request.yearFrominteger | nullні
request.yearTointeger | nullні
request.body"sedan" | "hatchback" | "wagon" | "suv" | "crossover" | "coupe" | "convertible" | "minivan" | "van" | "pickup" | "truck" | "motorcycle" | "other"[]ні
request.fuel"petrol" | "diesel" | "hybrid" | "phev" | "ev" | "lpg" | "cng" | "hydrogen" | "other"[]ні
request.gearbox"manual" | "automatic" | "cvt" | "robot" | "other"[]ні
request.mileageMaxinteger | nullні
request.mustHaveobjectні
request.destinationCountrystring | nullні
request.destinationCitystring | nullні
request.searchQueryobjectні
request.searchQuery.textstringні
request.searchQuery.makestringні
request.searchQuery.modelstringні
request.searchQuery.yearFromintegerні
request.searchQuery.yearTointegerні
request.searchQuery.priceMinobjectні
request.searchQuery.priceMaxobjectні
request.searchQuery.mileageMaxKmnumberні
request.searchQuery.fuel"petrol" | "diesel" | "hybrid" | "phev" | "ev" | "lpg" | "cng" | "hydrogen" | "other"[]ні
request.searchQuery.gearbox"manual" | "automatic" | "cvt" | "robot" | "other"[]ні
request.searchQuery.body"sedan" | "hatchback" | "wagon" | "suv" | "crossover" | "coupe" | "convertible" | "minivan" | "van" | "pickup" | "truck" | "motorcycle" | "other"[]ні
request.searchQuery.drive"fwd" | "rwd" | "awd" | "4wd"[]ні
request.searchQuery.markets"us" | "eu" | "cn" | "kr" | "ua" | "ge"[]ні
request.searchQuery.countriesstring[]ні
request.searchQuery.noAccidentsbooleanні
request.searchQuery.sourceKeysstring[]ні
request.searchQuery.limitintegerні
request.searchQuery.pageintegerні
request.notesstring | nullні
quizobjectні
calculatorobjectні
listingIdstring | null (uuid)ні
externalRefstring | nullні

Відповіді

201

The lead was registered.

application/json · Схема: LeadResult

ПолеТипОбов’язк.Опис
contactIdstring (uuid)так
isNewbooleanтакfalse: an existing contact was found by phone/email/Telegram and updated.
ownerUserIdstring | null (uuid)так
requestIdstring | null (uuid)так
taskIdstring | null (uuid)так
replaybooleanтакtrue: the same externalRef was already processed; nothing changed.

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

На цій сторінці