{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-update-api-key-request-schema.json",
  "title": "UpdateApiKeyRequest",
  "description": "PATCH body for `PATCH /workspaces/{workspaceId}/api-keys/{keyId}`. Every field is\noptional and independent — send only what should change. A body with none of them\nis a 400.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-api-keys-api-openapi.yml#/components/schemas/UpdateApiKeyRequest",
  "type": "object",
  "properties": {
    "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "New label. Trimmed before storage."
    },
    "scopes": {
      "type": "array",
      "description": "Replaces the key's scope list wholesale. `[]` removes all restrictions.\nEach entry is `*` (full access), `<domain>:*`, `<domain>:read` or\n`<domain>:write`. Duplicates are collapsed. An unrecognised scope is refused at\nwrite time rather than stored — an unknown scope matches no route, so accepting\na typo would mint a key that silently reaches nothing.\n",
      "items": {
        "type": "string",
        "enum": [
          "*",
          "mapping:*",
          "mapping:read",
          "mapping:write",
          "testing:*",
          "testing:read",
          "testing:write",
          "digital:*",
          "digital:read",
          "digital:write",
          "data:*",
          "data:read",
          "data:write",
          "audio:*",
          "audio:read",
          "audio:write",
          "scheduling:*",
          "scheduling:read",
          "scheduling:write",
          "billing:*",
          "billing:read",
          "billing:write"
        ]
      }
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Three-valued. Omit to leave the current expiry alone, send `null` to clear it\n(never expires), or send an ISO-8601 timestamp in the future to set it. A past\nor unparseable value is a 400.\n"
    }
  }
}