Skip to content
Sign in Create account

Partially update a dashboard API key

PATCH /api/keys/{id}

PATCH alias of PUT for selected settings on a key owned by the authenticated account. Requires keys.write and api-keys.create.

Authenticate with a portal session token.

Parameters

  • id integer path required

Request body

application/json object

  • allowed_ips array of string or null
    Items: at most 50 items
  • is_active boolean
  • name string
    Length: at most 100 characters
  • rate_limit_rpm integer
    Range: 1 to 600

Example

{
  "is_active": true
}

Responses

200 Selected key settings updated.

application/json object

Generated sample

{
  "api_key": {
    "allowed_ips": [
      "string"
    ],
    "created_at": "2026-01-01T00:00:00Z",
    "expires_at": "2026-01-01T00:00:00Z",
    "id": 0,
    "is_active": true,
    "is_default": true,
    "last_used_at": "2026-01-01T00:00:00Z",
    "mirrors_account_settings": true,
    "name": "string",
    "permissions": [
      "string"
    ],
    "prefix": "string",
    "privacy_tier_override": "balanced",
    "rate_limit_rpm": 0
  }
}
401 Missing or invalid bearer token.

application/json object

Any keys are accepted.

403 Authenticated caller lacks the required permission, ability, or role.

application/json object

Any keys are accepted.

404 Key was not found for this account.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

409 The Idempotency-Key cannot be used for this request because it conflicts with another request (idempotency_key_conflict), is still in progress (idempotency_request_in_progress), or its response was not retained (idempotency_response_not_retained).

application/json IdempotencyError

  • error object required
    • code string required
      One of: "idempotency_key_conflict", "idempotency_request_in_progress", "idempotency_response_not_retained"
    • message string required
    • type string required
      Value: "idempotency_error"
422 One or more key settings failed validation.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 The request was rate limited. API-generated responses are JSON;

Response headers

  • Retry-After string header

    Seconds to wait before retrying, when provided.

  • X-RateLimit-Scope string header

    Identifies the scope of the request limit, when provided.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string