{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pricklymails-com/json-schema/pricklymails-com-token-request-schema.json",
  "title": "TokenRequest",
  "description": "`POST /oauth/token` request body (RFC 6749 sections 4.1.3 and 6), submitted as `application/x-www-form-urlencoded`,\nthe content type every RFC-conformant OAuth client uses for the token endpoint.\nFields are grouped by grant type: `code`, `redirect_uri`, and `code_verifier` apply only to\n`grant_type=authorization_code`; `refresh_token` applies only to `grant_type=refresh_token`.\nA field that does not apply to the presented grant type is ignored.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pricklymails-com-openapi.json#/components/schemas/TokenRequest",
  "type": "object",
  "required": [
    "grant_type",
    "client_id"
  ],
  "properties": {
    "client_id": {
      "type": "string",
      "description": "The client's public `client_id`."
    },
    "code": {
      "type": [
        "string",
        "null"
      ],
      "description": "The single-use authorization code to redeem (`authorization_code` grant only)."
    },
    "code_verifier": {
      "type": [
        "string",
        "null"
      ],
      "description": "The PKCE `code_verifier` (RFC 7636) proving possession of the `code_challenge` presented at `/oauth/authorize`\n(`authorization_code` grant only)."
    },
    "grant_type": {
      "type": "string",
      "description": "Either `\"authorization_code\"` or `\"refresh_token\"`."
    },
    "redirect_uri": {
      "type": [
        "string",
        "null"
      ],
      "description": "The redirect URI presented at `/oauth/authorize`, re-checked here per RFC 6749 section 4.1.3\n(`authorization_code` grant only)."
    },
    "refresh_token": {
      "type": [
        "string",
        "null"
      ],
      "description": "The refresh token to redeem (`refresh_token` grant only, RFC 6749 section 6)."
    }
  }
}