{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/stackit/main/json-schema/stackit-access-token-schema.json",
  "title": "accessToken",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stackit-logs-openapi.yml#/components/schemas/accessToken",
  "properties": {
    "accessToken": {
      "description": "A generated access token. Only available on creation.",
      "type": "string"
    },
    "creator": {
      "description": "The user who created the access token.",
      "type": "string"
    },
    "description": {
      "description": "The description of the access token.",
      "maxLength": 100,
      "type": "string"
    },
    "displayName": {
      "description": "The displayed name of the access token.",
      "maxLength": 32,
      "minLength": 1,
      "pattern": "^[a-zA-Z][\\w -]*$",
      "type": "string"
    },
    "expires": {
      "description": "Indicates if the access token can expire.",
      "type": "boolean"
    },
    "id": {
      "description": "An auto generated unique id which identifies the access token.",
      "format": "uuid",
      "type": "string"
    },
    "permissions": {
      "$ref": "#/$defs/permissions"
    },
    "status": {
      "enum": [
        "active",
        "expired"
      ],
      "type": "string"
    },
    "validUntil": {
      "description": "The date and time util an access token is valid to (inclusively).",
      "format": "date-time",
      "type": "string"
    }
  },
  "required": [
    "id",
    "expires",
    "status",
    "permissions",
    "creator",
    "displayName"
  ],
  "$defs": {
    "permissions": {
      "description": "The access permissions granted to the access token or access policy.",
      "items": {
        "enum": [
          "read",
          "write"
        ],
        "type": "string"
      },
      "type": "array"
    }
  }
}