Update Key
PUThttps://api.confident-ai.com/v2/projects/{projectId}/api-keys/{apiKeyId}
Activates or deactivates a project-scoped API key. A deactivated key is rejected on authentication from the next request onwards, so anything still sending traces with it starts failing; its value is unchanged and reactivating it brings the same value back. Rotating is the only way to change the value.
curl -X PUT "https://api.confident-ai.com/v2/projects/{projectId}/api-keys/{apiKeyId}" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"valid": false
}'{
"success": true,
"data": {
"id": 1420,
"name": "CI pipeline",
"valid": true,
"created_at": "2025-01-15T09:30:00.000Z",
"expiresAt": "2025-04-15T09:30:00.000Z",
"value": "***************LmNoPq",
"shadowValue": "***************Tu6vWx",
"rotatesAt": "2025-03-01T12:00:00.000Z",
"lastUsed": "2025-02-28T18:45:12.000Z"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Path parameters
projectIdstringRequiredThe id of the project the key belongs to.
apiKeyIdintegerRequiredThe id of the API key.
Request body
validbooleanRequiredSend false to deactivate the key, true to reactivate it. A deactivated key is rejected on every request, and deactivating one takes effect immediately.
Response
Update Key succeeded.
successbooleanIndicates if the request was successful.
dataobjectAn API key as it reads after it has been issued, with both secrets masked. Organization-scoped and project-scoped keys have the same shape; a key's scope is fixed when it is created and shows in the prefix of its value (
confident_<region>_org_orconfident_<region>_proj_).Show 9 propertiesHide 9 properties
idintegerThe id of the API key, generated by Confident AI.
namestring | nullThe label for the key, shown on the Confident AI platform.
validbooleanWhether the key authenticates. A deactivated key is rejected on every request until it is reactivated.
created_atstringWhen the key was created.
expiresAtstring | nullThe instant the key stops authenticating, or null when it never expires. Confident AI computes it from the
expiresInDaysduration sent when the key was created or last rotated.valuestringThe key, masked: fifteen asterisks followed by its last six characters. The full value is returned only by the response that issues it — creating a key, or rotating one — and never again.
shadowValuestring | nullThe masked replacement value while a rotation's grace period is running, or null when no rotation is pending.
rotatesAtstring | nullWhen a pending rotation completes —
shadowValuebecomesvalueand the old value stops authenticating — or null when no rotation is pending.lastUsedstring | nullWhen the key last authenticated a request, or null when it never has.
deprecatedbooleanIndicates if this endpoint is deprecated.