Write the institution's connector credentials
Writes (or rotates) the connector credentials of an existing institution: the credentials subtree of connector_metadata is replaced, sealed under a fresh data key, audited as a credential rotation, and never echoed; every other metadata key is kept as stored. This is the ONLY credential write path: PATCH /v1/institutions/ refuses a credentials subtree with 400. Returns 404 when the institution has no configuration. A key that is not the one the key registry records (the institution’s key alias resolves to another key, or the registry records no ACTIVE key) maps to 409 SBJ-0012 and changes nothing: do not retry. A key being provisioned by another request, or a key registry that cannot be read, maps to 503 (retryable). 401 and 403 come from the /v1 auth chain and 429 from the rate limiter, as an application/json ErrorResponse; 413 has the two shapes described on the credentials KEK rotation route.
Authorizations
JWT bearer token issued by the identity provider.
Path Parameters
The institution's unique identifier (UUID).
"550e8400-e29b-41d4-a716-446655440000"
Body
The connector's credentials under their snake_case allowlisted names (ledger_client_id, ledger_client_secret, crm_client_id, crm_client_secret). Sealed under a fresh data key before the row is written and never echoed. Rotating does NOT revoke the previous credential upstream.
Response
OK
The outbound connector type for this institution.
"midaz"
RFC 3339 creation timestamp (UTC).
"2024-01-15T10:30:00Z"
Whether the connector configuration is active.
true
The institution's BACEN CNPJ (8 digits) for return-file headers and file header validation.
"12345678"
The institution's unique identifier (UUID).
"550e8400-e29b-41d4-a716-446655440000"
RFC 3339 last-update timestamp (UTC).
"2024-01-15T12:00:00Z"
The regular expression the institution declared for the account number of a court-indicated target; omitted when none is declared.
"^[0-9]{1,12}$"
The regular expression the institution declared for the branch (agência) number of a court-indicated target; omitted when none is declared.
"^[0-9]{4}$"
Connector-specific configuration bag. The non-secret connector-owned keys (baseUrl, authAddress, crmBaseUrl, crmMode, organizations[], blockableBalances, blockableAccountTypes, salaryAccountTypes) are preserved verbatim; secret-bearing keys — the whole credentials subtree included — are removed and never echoed. blockableBalances carries the LEDGER's balance-key values — for Midaz, balanceKey (default/overdraft/a client-registered key), not the available/onHold fields of a balance.
Present and false only when the stored connector metadata cannot be parsed by its connector; absent otherwise. The offending value is never echoed.
false
The CRM surface this institution resolves to (legacy|embedded): its own crmMode override when the connector metadata names one, the service-wide default otherwise. Derived and read-only; omitted when the connector metadata cannot be parsed.
legacy, embedded "legacy"
Operational retry policy (backoff/attempts) as arbitrary JSON.

