Upload a complete Dataprev custody
Stores the tenant’s ICP-Brasil A1 certificate (PEM cert+key) and OAuth2 client_credentials secret together, in one audited transaction, at new secret references. It is the only write a revoked custody accepts: it closes the revocation and opens a new custody generation, and the revoked material is never used again. A body that carries the revoked certificate is refused with 409 DATAPREV_CREDENTIAL_REVOKED; the gateway keeps no non-secret record of the revoked OAuth client to compare, so supplying a new one is the caller’s duty. On a custody that was not revoked it replaces both at once. The response NEVER carries secret material.
Authorizations
JWT bearer token issued by the identity provider.
Headers
Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the custody is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent.
"idem-1"
Body
PEM-encoded ICP-Brasil A1 client certificate chain.
1 - 1048576OAuth2 client_credentials client id.
1 - 512OAuth2 client_credentials client secret.
1 - 4096PEM-encoded private key for the client certificate.
1 - 1048576Response
OK
Whether a client certificate is stored for the tenant.
Whether OAuth2 client_credentials are stored for the tenant.
External rail the credentials belong to.
"dataprev"
Last-update timestamp (RFC 3339, UTC).
"2026-06-23T12:00:00Z"
SHA-256 hex fingerprint of the stored certificate (absent when none).
"3b1f...c0"
RFC 3339 cert expiry (UTC); absent when no cert is stored.
"2027-01-01T00:00:00Z"
Dataprev codigoSolicitante: the institution's BACEN COMPE code (3 digits, zero-padded, 001-999). Public, non-secret; absent when none is stored.
"341"
Base URL of the tenant's worker portal. Public, non-secret; absent when none is stored.
"https://portal.example.com/formalizacao"
Credential revocation timestamp (RFC 3339, UTC); absent when credentials were never revoked.
"2026-07-14T15:30:00Z"

