{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lightspark/main/json-schema/lightspark-api-token-create-request-schema.json",
  "title": "ApiTokenCreateRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lightspark-api-tokens-api-openapi.yml#/components/schemas/ApiTokenCreateRequest",
  "type": "object",
  "required": [
    "name",
    "permissions"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the token to help identify it"
    },
    "permissions": {
      "type": "array",
      "description": "A list of permissions to grant to the token",
      "items": {
        "$ref": "#/$defs/Permission"
      }
    }
  },
  "$defs": {
    "Permission": {
      "type": "string",
      "enum": [
        "VIEW",
        "TRANSACT",
        "MANAGE"
      ],
      "description": "Permission of an API token that determines what actions the token can perform: VIEW: Can view all data, including platform config, customers and transactions TRANSACT: Can send payments MANAGE: Can manage platform config, api tokens and customers"
    }
  }
}