Skip to main content
POST
Create a consultation

Autorizaciones

Authorization
string
header
requerido

The access token received from the authorization server in the OAuth 2.0 flow.

Encabezados

X-Idempotency
string
requerido

REQUIRED client-supplied idempotency key (1..255 chars). Its absence returns 400 with code SRC-0001. Idempotency describes the replay rules and how long Lerian SRC keeps a key.

Required string length: 1 - 255
X-Request-ID
string

Optional correlation id (UUID) propagated through logs/traces and into the evidence trail.

Cuerpo

application/json
document
string
requerido

CPF (11 numeric digits) or CNPJ (14 characters: 12 alphanumeric [0-9A-Z] positions plus 2 numeric check digits), unmasked. The alphanumeric CNPJ is the official BACEN class [0-9]{11}|[0-9A-Z]{12}[0-9]{2}. Check digits are validated before acceptance.

Pattern: ^([0-9]{11}|[0-9A-Z]{12}[0-9]{2})$
Ejemplo:

"52998224725"

documentType
string
requerido

Type of the consulted document: CPF or CNPJ. Must agree with the document's width.

Ejemplo:

"CPF"

motivation
object
requerido

Mandatory motivation context.

protectionTypes
string[] | null
requerido

One or more protection types to consult (account_opening, ownership_change): at least one, no duplicates, each within the official catalog domain.

Ejemplo:
companyConsultationId
string

The id of the company (CNPJ) consultation that this holder or representative belongs to: the id that the company's own request returned with its 202. Required when subjectRole is holder or representative (422 SRC-0006 when absent). Refused for individual and company (422 SRC-0007 when present). It must name a CNPJ consultation of this deployment, in any status, so you can send both requests at the same time. Otherwise the request returns 422 SRC-0008.

Ejemplo:

"8f14e45f-ceea-467a-9a36-dedd4bea2543"

subjectRole
string

The role the consulted document plays: individual | company | holder | representative. OPTIONAL — absent, it is inferred from documentType (CPF → individual, CNPJ → company). Unknown value returns 422 SRC-0004; a role the document type does not admit returns 422 SRC-0005. Declaring the inferred role explicitly does NOT change the idempotency fingerprint.

Ejemplo:

"representative"

Respuesta

Accepted

acceptedAt
string<date-time>
requerido

Acceptance instant (RFC3339, UTC). On an idempotent replay this is the ORIGINAL acceptance instant, never the replay instant.

id
string
requerido

Consultation identifier (poll via GET /v1/src/consultations/{id}).

Ejemplo:

"8f14e45f-ceea-467a-9a36-dedd4bea2543"

status
string
requerido

Lifecycle state of the consultation. A newly accepted consultation is always pending — a NORMAL state, never an error. An idempotent REPLAY reports the state the original consultation is in now, so it may be completed or failed.

Ejemplo:

"pending"