Skip to main content
PATCH
/
v2
/
api-keys
/
{api_key_id}
Core - Disable a key
curl --request PATCH \
  --url 'https://api.orq.ai/v2/api-keys/01HZXW2K7Y8Q9M0N1P2R3S4T5V' \
  --header 'Authorization: Bearer $ORQ_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "status": "API_KEY_STATUS_DISABLED"
  }'
{
  "api_key": {
    "api_key_id": "<string>",
    "name": "<string>",
    "owner": {
      "user": {
        "user_id": "<string>"
      },
      "service_account": {}
    },
    "project_scope": {
      "all": {},
      "single": {
        "project_id": "<string>"
      }
    },
    "token_prefix": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "access": {},
    "created_by_id": "<string>",
    "updated_by_id": "<string>",
    "last_used_at": "2023-11-07T05:31:56Z",
    "expires_at": "2023-11-07T05:31:56Z",
    "legacy_key_id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

api_key_id
string
required

API key id to update.

Body

application/json
name
string

New name. Omit to keep current.

status
enum<string>

New lifecycle status. Omit to keep current.

Available options:
API_KEY_STATUS_UNSPECIFIED,
API_KEY_STATUS_ACTIVE,
API_KEY_STATUS_DISABLED,
API_KEY_STATUS_REVOKED
permission_mode
enum<string>

New permission preset. Omit to keep current.

Available options:
PERMISSION_MODE_UNSPECIFIED,
PERMISSION_MODE_ALL,
PERMISSION_MODE_RESTRICTED,
PERMISSION_MODE_READ_ONLY
access
object

Replacement access map. Required when changing to PERMISSION_MODE_RESTRICTED; ignored otherwise. Provide an empty map to clear. See ApiKey.access for the full catalog of valid keys (Domain.id) and AccessLevel string values, or fetch the live catalog via the capability catalog endpoint.

project_scope
object

New project scope. Omit to keep current.

expires_at
string<date-time>

New expiration. Omit to keep current. Set clear_expires_at = true to remove an existing expiration (a zero Timestamp here would still mean "no change" because of optional semantics).

clear_expires_at
boolean

Force-clear the expiration. Mutually exclusive with expires_at.

Response

200 - application/json

OK

api_key
object
required

Updated api-key.