Update an API key
PATCH
Changes a key's name, abilities, projects, limit, addresses or expiry. The body must be sparse. A revoked key cannot be edited. Only the key's creator can widen it (add abilities or projects, loosen its addresses, extend its expiry or raise its limit); anyone who manages keys can rename or narrow it.
bearerAuthheader
AuthorizationBearer <token>A Clerk session JWT, or a workspace API key (esk_live_…) created in workspace settings. A key acts as the member who created it, narrowed to its abilities, projects and credit limit.
api_key_id*stringFormat
uuidEndless-Api-Version?stringPin the caller to an API major (1). Omit to accept the current version. A major this deployment cannot serve is refused with 400 unsupported_api_version.
application/json- body
name?stringLength
1 <= length <= 100description?|nullscopes?array<>Items
1 <= items <= 100project_access?stringValue in
"all""selected"project_ids?array<>Items
items <= 100spending_limit?|nullallowed_ips?array<|||>Items
items <= 32expires_at?|nullOK
application/json- response
id*stringFormat
uuidorganization_id*stringname*stringdescription*string|nullproject_access*stringValue in
"all""selected"spending_limit*|nullallowed_ips*array<string>expires_at*|nulllast_used_at*|nullcreated_by_id*stringrevoked_at*|nullrevoked_by_id*string|nullrevoked_reason*|nullcreated_at*stringFormat
date-timeupdated_at*stringFormat
date-timetoken_prefix*stringtoken_hint*stringsecret_created_at*stringFormat
date-timeretiring_secrets*array<>scopes*array<>status*stringValue in
"active""expired""revoked"project_ids*array<>created_by*|nullcredits_used*integerRange
0 <= value <= 9007199254740991capabilities*curl -X PATCH 'https://api.endless.app/api-keys/0191e5a3-5ae6-76d0-9b18-7c934ef05a06' \ -H 'Content-Type: application/json' \ -d '{}'Example Response
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "organization_id": "string", "name": "string", "description": "string", "project_access": "all", "spending_limit": -2147483648, "allowed_ips": [ "string" ], "expires_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "created_by_id": "string", "revoked_at": "2019-08-24T14:15:22Z", "revoked_by_id": "string", "revoked_reason": "revoked", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "token_prefix": "string", "token_hint": "string", "secret_created_at": "2019-08-24T14:15:22Z", "retiring_secrets": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "token_hint": "string", "expires_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z" } ], "scopes": [ "models:read" ], "status": "active", "project_ids": [ "b5c0e7c3-d26d-4797-906b-f511ec4c5077" ], "created_by": { "id": "string", "first_name": "string", "last_name": "string", "email": "string", "image_url": "string" }, "credits_used": 0, "capabilities": { "can_rotate": true, "can_widen": true }}