{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudworldmodel-ai/json-schema/cloudworldmodel-ai-registration-token-summary-schema.json",
  "title": "RegistrationTokenSummary",
  "description": "Summary of a registration token as returned by GET /register-tokens (plain token value is never included)",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudworldmodel-ai-api-key-self-service-api-openapi.yml#/components/schemas/RegistrationTokenSummary",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "tokenPrefix": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "read",
          "write",
          "admin"
        ]
      }
    },
    "rateLimit": {
      "type": "integer"
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "usedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Set when the token was consumed. Null if still pending."
    },
    "isActive": {
      "type": "boolean"
    },
    "createdByKeyId": {
      "type": "string",
      "description": "ID of the admin API key that created this token"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "used",
        "expired",
        "revoked"
      ],
      "description": "Computed status of the token"
    }
  }
}