Create institution config and provision keys
Creates a new institution configuration (create-only; 409 if one already exists for the id) and provisions its tokenization PRF + audit MAC keysets in the same flow. The institution id is supplied in the request body.
Authorizations
JWT bearer token issued by the identity provider.
Body
The outbound connector type for this institution.
"midaz"
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) that addresses the new configuration.
"550e8400-e29b-41d4-a716-446655440000"
Connector-specific configuration bag: routing (baseUrl required; organizations[] required — the only targeting form, at least one entry naming a Midaz organizationId with optional ledgers; authAddress required when credentials are present; crmBaseUrl optional; crmMode optional — legacy|embedded, where absent/null/blank INHERITS the service-wide MIDAZ_CRM_MODE, an unrecognised value is rejected, and embedded requires an EMPTY crmBaseUrl), admission sets (blockableBalances/blockableAccountTypes), and the connector's credentials under their snake_case allowlisted names: ledger_client_id + ledger_client_secret are always required when credentials are present; crm_client_id + crm_client_secret are an all-or-nothing pair that is REQUIRED when the effective crmMode is legacy and FORBIDDEN when it is embedded (an embedded bag carries the ledger pair only, e.g. credentials:{ledger_client_id,ledger_client_secret}); the example shows the legacy four-field shape. blockableBalances carries the LEDGER's balance-key values (for Midaz: balanceKey, e.g. default/overdraft/a client-registered key) — NOT available/onHold, which are fields of a balance, not keys; the set is open and unvalidated, so a wrong value is not rejected, it only makes the admission gate never match. The presence of the credentials subtree selects authentication; there is no authMode. crmMode is a cleartext routing selector, never a credential: it is preserved on GET, which also echoes the RESOLVED surface as the read-only effectiveCrmMode. Credential values are sealed before the row is written and are never echoed.
Operational retry policy (backoff/attempts) as arbitrary JSON.
Response
Created
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"
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.

