Create a consultation
Accepts a restriction consultation for one CPF or CNPJ and returns 202 with the consultation id. The consultation starts as pending, which is a normal state. Read the outcome with GET /v1/src/consultations/{id} or from the events.
Lerian SRC validates the request before it accepts it, and a refused request sends nothing to BACEN. X-Idempotency is required. Idempotency describes the replay rules and how long Lerian SRC keeps a key.
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
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.
1 - 255Optional correlation id (UUID) propagated through logs/traces and into the evidence trail.
Body
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.
^([0-9]{11}|[0-9A-Z]{12}[0-9]{2})$"52998224725"
Type of the consulted document: CPF or CNPJ. Must agree with the document's width.
"CPF"
Mandatory motivation context.
One or more protection types to consult (account_opening, ownership_change): at least one, no duplicates, each within the official catalog domain.
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.
"8f14e45f-ceea-467a-9a36-dedd4bea2543"
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.
"representative"
Response
Accepted
Acceptance instant (RFC3339, UTC). On an idempotent replay this is the ORIGINAL acceptance instant, never the replay instant.
Consultation identifier (poll via GET /v1/src/consultations/{id}).
"8f14e45f-ceea-467a-9a36-dedd4bea2543"
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.
"pending"

