Skip to content

Replace only the `.p12` of one environment (a renewed key)

PUT
/v1/tenants/{tenantId}/credentials/{environment}/certificate
curl --request PUT \
--url https://api.emite.cr/v1/tenants/example/credentials/sandbox/certificate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form p12=@file \
--form pin=example

For a key renewed in Tribu-CR: the new .p12 and its PIN replace the stored ones, and the ATV user and password stay as they are (they are not presented to Hacienda again). The certificate must open with the PIN, belong to the company and still be valid (400 CERTIFICATE_EXPIRED). 404 CREDENTIALS_NOT_FOUND when the environment has no credentials yet: upload them whole with PUT …/credentials/{environment}.

tenantId
required
string
environment
required
string
Allowed values: sandbox production
Media typemultipart/form-data
object
p12
required
string format: binary
pin
required
string
Media typeapplication/json
object
message
required

A fixed confirmation, in English: Credentials uploaded successfully after PUT, Certificate replaced after PUT …/certificate, ATV credentials updated after PATCH. To read what is stored, use GET …/credentials.

string
Example
{
"message": "Credentials uploaded successfully"
}

Missing or invalid JWT / API key

:tenantId is not the caller's company, or insufficient scope — credentials:* is never granted to an API key.