{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/observeinc/json-schema/observeinc-api-token-create-request-schema.json",
  "title": "ApiTokenCreateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/observeinc-service-accounts-api-openapi.yml#/components/schemas/ApiToken-CreateRequest",
  "type": "object",
  "required": [
    "label",
    "lifetimeHours"
  ],
  "properties": {
    "label": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "lifetimeHours": {
      "type": "integer",
      "minimum": 1
    },
    "scopes": {
      "type": "array",
      "description": "Optionally constrains the token's effective permissions. An empty/omitted list leaves the token unscoped. Unknown scopes are rejected.",
      "items": {
        "$ref": "#/$defs/ApiTokenScope"
      }
    }
  },
  "$defs": {
    "ApiTokenScope": {
      "type": "string",
      "enum": [
        "api:read",
        "api:write",
        "unscoped"
      ]
    }
  }
}