curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=disable" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"message": "API key disabled"
}
{
"success": false,
"result": { "code": "bad_request" },
"message": "Key ID and action (disable|enable) are required",
"request_id": "req_7f3a9c21",
"error": "Key ID and action (disable|enable) are required"
}
{
"success": false,
"result": { "code": "not_found" },
"message": "API key not found",
"request_id": "req_7f3a9c21",
"error": "API key not found"
}
API Keys
Enable or Disable API Key
Temporarily disable an API key or re-enable a disabled one.
PATCH
/
api
/
account
/
keys
curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=disable" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"message": "API key disabled"
}
{
"success": false,
"result": { "code": "bad_request" },
"message": "Key ID and action (disable|enable) are required",
"request_id": "req_7f3a9c21",
"error": "Key ID and action (disable|enable) are required"
}
{
"success": false,
"result": { "code": "not_found" },
"message": "API key not found",
"request_id": "req_7f3a9c21",
"error": "API key not found"
}
Authentication
Requires an API key in theAuthorization header.
Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request
The key’s database id, as returned by
List API keys. Not the
key_prefix.Disable a key
curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=disable" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Re-enable a key
curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=enable" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Response
{
"message": "API key disabled"
}
Disabling is reversible - re-enable the same key with
action=enable. A
disabled key immediately returns 401 on any request.Known issue:
action=enable can also re-enable a key that was soft-revoked.
Permanently delete a compromised key instead of relying on revocation.Permissions
readonly members get 403. A tech member can only toggle their own keys;
only a workspace admin can toggle another member’s key. A key that is out of
your scope returns 404, the same as an unknown id.
Errors
Errors return the shared envelope withsuccess, result.code, message, and
request_id. A legacy error key is included alongside it.
curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=disable" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"message": "API key disabled"
}
{
"success": false,
"result": { "code": "bad_request" },
"message": "Key ID and action (disable|enable) are required",
"request_id": "req_7f3a9c21",
"error": "Key ID and action (disable|enable) are required"
}
{
"success": false,
"result": { "code": "not_found" },
"message": "API key not found",
"request_id": "req_7f3a9c21",
"error": "API key not found"
}
Was this page helpful?