Skip to main content
POST
Create a consultation

Authorizations

Authorization
string
header
required

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

Headers

X-Idempotency
string
required

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.

Body

application/json
document
string
required

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})$
Example:

"52998224725"

documentType
string
required

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

Example:

"CPF"

motivation
object
required

Mandatory motivation context.

protectionTypes
string[] | null
required

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

Example:
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.

Example:

"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.

Example:

"representative"

Response

Accepted

acceptedAt
string<date-time>
required

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

id
string
required

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

Example:

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

status
string
required

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.

Example:

"pending"