/v1/src base path. The API Reference documents each operation, with its request and response.
Before you start
An operator deploys and configures Lerian SRC for your institution. Environment variables lists the settings, and Operating Lerian SRC covers the IBM MQ connection to BACEN.
Authentication and permissions
Every call to
/v1/src needs a bearer token from Access Manager. Use an application token for your onboarding systems and a user token for your back office. A request without a valid token returns 401. A token of another type returns 401 with code SRC-0201.
Each operation needs one permission on the src product. A token without that permission returns 403 with code SRC-0202.
Lerian SRC serves one institution, which
SRC_CNPJ_BASE8 sets in its configuration.
Roles
Lerian SRC declares these roles for your institution in Access Manager. Each role holds the permissions of the role before it. In BYOC, Lerian SRC publishes these roles only when you turn on its permission declaration. First create the M2M credential of Lerian SRC in Access Manager. Then setIDP_DECLARATION_ENABLED to true, with IDP_HOST, IDP_M2M_CLIENT_ID and IDP_M2M_CLIENT_SECRET. See Environment variables.
API surface
Operational endpoints sit outside
/v1/src.
Idempotency
POST /v1/src/consultations needs an X-Idempotency header, of at most 255 characters. A request without it returns 400 with code SRC-0001.
- The same key with the same body returns
202with the original consultation id. The response shows the current status of that consultation, so it can becompletedorfailed. - The same key with a different body returns
409with codeSRC-0003. - The same key from another caller returns
409with codeSRC-0003, also with the same body. Only the caller that sent the first request gets the original202.
src.retention.transient_purge_age, 24 hours by default. A request that reuses a deleted key starts a new consultation.
POST /v1/src/consultations/{id}/institution-record takes no idempotency key. A consultation holds one record, so a retry returns 409 with code SRC-0101.
An evidence correction is not idempotent. A retried request adds a second correction. Before you retry after a failure that you cannot confirm, read the evidence trail.
Polling and events
A consultation starts
pending, and pending is a normal state. Read the outcome in one of two ways:
- Poll
GET /v1/src/consultations?id={id}. It returns only that consultation, or an empty page with200when the id is unknown. Each row carriesattempts, withcount,lastAttemptAt, andbudgetExhausted. A value that is not a UUID returns400with codeSRC-0001. When the status leavespending, readGET /v1/src/consultations/{id}. Acompletedconsultation carriesverdictsandbcbControlCode. Afailedconsultation carriesrejection. - Consume the events that Lerian SRC publishes.
A
failed consultation with the rejection code SRC-OUTBOUND-INVALID is not always final. When BACEN answers an attempt that Lerian SRC sent before it refused a retry, the consultation becomes completed, and Lerian SRC publishes a completed event after the failed event. If BACEN rejects that attempt, the consultation stays failed.
The events travel on the topic lerian.streaming.br-src, with the CloudEvents source br-src. No variable changes the topic. See Streaming Hub.
Lerian SRC writes each event to an outbox in the same transaction as the change it reports. With no broker, the events stay pending in the outbox. When the broker refuses an event, Lerian SRC retries it for 7 days.
Errors
Errors follow RFC 9457 problem details, with the media type
application/problem+json. Branch on the code field, not on the detail text. The SRC error list gives each code, its meaning, and its HTTP status.
Integration conventions
- Request size. A request body larger than 1 MiB returns
413. - Pagination. A list or search returns a page with
nextCursor. To read the next page, send that value ascursor.nextCursorisnullon the last page. - Rate limit. Lerian SRC counts the requests of each client IP address in each replica. The default is 6000 requests per minute, set by
src.rate_limit.ip_maxandsrc.rate_limit.ip_window. Past the limit, the answer is429with codeSRC-0401.

