v66

OpenAPI 3.1.0raw.githubusercontent.com2026-08-0174265626.3 KB
keys

Add key permissions

Add permissions to a key without affecting existing permissions.

Use this for privilege upgrades, enabling new features, or plan changes that grant additional capabilities. Permissions granted through roles remain unchanged.

Important: Changes take effect immediately with up to 30-second edge propagation.

Required Permissions

Your root key must have one of the following permissions:

  • api.*.update_key (to update keys in any API)
  • api.<api_id>.update_key (to update keys in a specific API)

Side Effects

Invalidates the key cache for immediate effect, and makes permissions available for verification within 30 seconds across all regions.

post/v2/keys.addPermissions

Request body

keyIdstring required

Specifies which key receives the additional permissions using the database identifier returned from keys.createKey. Do not confuse this with the actual API key string that users include in requests.

permissionsstring[] required

Grants additional permissions to the key through direct assignment or automatic creation. Duplicate permissions are ignored automatically, making this operation idempotent.

Adding permissions never removes existing permissions or role-based permissions.

Any permissions that do not exist will be auto created if the root key has permissions, otherwise this operation will fail with a 403 error.

Example request

{
  "keyId": "key_2cGKbMxRyIzhCxo1Idjz8q"
}

Response

Permissions added successfully. Returns all permissions currently assigned to the key.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": [
    {
      "id": "perm_1234567890abcdef",
      "name": "users.read",
      "slug": "users-read",
      "description": "Allows reading user profile information and account details"
    }
  ]
}