{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-api-key-schema.json",
  "title": "ApiKey",
  "description": "An API key. The secret is never returned after creation or rotation.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-api-keys-api-openapi.yml#/components/schemas/ApiKey",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "preview": {
      "type": "string",
      "description": "The first characters of the key (`ak_us_live_Ab3x`), to recognise it. Not usable as a credential."
    },
    "permissions": {
      "anyOf": [
        {
          "type": "string",
          "const": "all"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "`resource.action` permissions, or `\"all\"` (every permission, now and later)."
    },
    "nodeId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The location the key is pinned to (it can act only there and below). Null = workspace-wide."
    },
    "lastUsedAt": {
      "anyOf": [
        {
          "type": "string",
          "description": "ISO-8601 timestamp (UTC)."
        },
        {
          "type": "null"
        }
      ]
    },
    "expiresAt": {
      "anyOf": [
        {
          "type": "string",
          "description": "ISO-8601 timestamp (UTC)."
        },
        {
          "type": "null"
        }
      ],
      "description": "Null = never expires."
    },
    "expired": {
      "type": "boolean"
    },
    "revokedAt": {
      "anyOf": [
        {
          "type": "string",
          "description": "ISO-8601 timestamp (UTC)."
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when the key was revoked; a revoked key no longer authenticates."
    },
    "createdAt": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    }
  },
  "required": [
    "id",
    "name",
    "preview",
    "permissions",
    "nodeId",
    "lastUsedAt",
    "expiresAt",
    "expired",
    "revokedAt",
    "createdAt"
  ]
}