Get Key
GEThttps://api.confident-ai.com/v2/projects/{projectId}/api-keys/{apiKeyId}
Retrieves one project-scoped API key by id. Its value is masked — the full value is only ever returned once, by the response that issues it. A rotatesAt in the past means the grace period is over and the outgoing value is already rejected on authentication, even though this endpoint still shows it; listing the keys completes the rotation.
curl -X GET "https://api.confident-ai.com/v2/projects/{projectId}/api-keys/{apiKeyId}" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>"{
"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.
Response
Get 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.