Skip to content

Partial update of ATV credentials (no .p12 change)

PATCH
/v1/tenants/{tenantId}/credentials/{environment}
curl --request PATCH \
--url https://api.emite.cr/v1/tenants/example/credentials/sandbox \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "atvUsername": "cpf-12-3456-789012@stag.comprobanteselectronicos.go.cr", "atvPassword": "AtvP4ssw0rd!", "atvClientId": "api-stag", "atvClientSecret": "optional-client-secret" }'

Update individual ATV fields without re-uploading the certificate. Sensitive fields (atvPassword, atvClientSecret) are write-only — omit to keep the existing value. Saving credentials that Hacienda had refused clears the refusal, and the documents that waited for them go to Hacienda on their own.

tenantId
required
string
environment
required
string
Allowed values: sandbox production
Media typeapplication/json
object
atvUsername

New ATV user; omit it to keep the stored one. A new user in Hacienda's usual form must embed the company's cédula (400 ATV_USER_IDENTIFICATION_MISMATCH). Whatever is sent is merged with what is stored and tried against the IdP before saving (400 ATV_CREDENTIALS_REJECTED when Hacienda refuses it).

string
Example
cpf-12-3456-789012@stag.comprobanteselectronicos.go.cr
atvPassword

New password of the ATV user; omit it to keep the stored one.

string
Example
AtvP4ssw0rd!
atvClientId

New IdP client id (api-stag for sandbox, api-prod for production); omit it to keep the stored one.

string
Example
api-stag
atvClientSecret

New IdP client secret; omit it to keep the stored one.

string
Example
optional-client-secret
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.