{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alpaca/json-schema/alpaca-token-request-schema.json",
  "title": "token_request",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alpaca-us-authentication-api-openapi.yml#/components/schemas/token_request",
  "properties": {
    "client_assertion": {
      "description": "Client assertion JWT (if using private_key_jwt)",
      "maxLength": 16384,
      "type": "string"
    },
    "client_assertion_type": {
      "description": "Client assertion type (if using private_key_jwt)",
      "enum": [
        "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
      ],
      "type": "string"
    },
    "client_id": {
      "$ref": "#/$defs/client_id"
    },
    "client_secret": {
      "description": "Client secret (if using client_secret)",
      "maxLength": 128,
      "type": "string"
    },
    "grant_type": {
      "description": "Grant type",
      "enum": [
        "client_credentials",
        "urn:ietf:params:oauth:grant-type:jwt-bearer",
        "refresh_token"
      ],
      "type": "string"
    }
  },
  "required": [
    "grant_type"
  ],
  "type": "object",
  "$defs": {
    "client_id": {
      "description": "Client ID",
      "maxLength": 32,
      "minLength": 20,
      "pattern": "^[A-Z0-9]+$",
      "type": "string"
    }
  }
}