{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-oauth-token-request-schema.json",
  "title": "OAuthTokenRequest",
  "description": "OAuth 2.1 token request (RFC 6749 §4, RFC 8628 §3.4). Sent as `application/x-www-form-urlencoded`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-oauth-clients-api-openapi.yml#/components/schemas/OAuthTokenRequest",
  "type": "object",
  "required": [
    "grant_type"
  ],
  "properties": {
    "grant_type": {
      "type": "string",
      "enum": [
        "client_credentials",
        "authorization_code",
        "refresh_token",
        "urn:ietf:params:oauth:grant-type:device_code"
      ],
      "description": "The OAuth 2.1 grant type."
    },
    "client_id": {
      "type": "string",
      "description": "The OAuth client identifier. Required for public clients; confidential clients may instead use HTTP Basic auth."
    },
    "client_secret": {
      "type": "string",
      "description": "The OAuth client secret (confidential clients only)."
    },
    "scope": {
      "type": "string",
      "description": "Space-delimited list of requested scopes."
    },
    "code": {
      "type": "string",
      "description": "Authorization code (for `authorization_code` grant)."
    },
    "redirect_uri": {
      "type": "string",
      "format": "uri",
      "description": "Must match the redirect URI used in the authorization request (`authorization_code` grant)."
    },
    "code_verifier": {
      "type": "string",
      "description": "PKCE code verifier (RFC 7636). Required for public clients using the `authorization_code` grant."
    },
    "refresh_token": {
      "type": "string",
      "description": "The refresh token (for `refresh_token` grant)."
    },
    "device_code": {
      "type": "string",
      "description": "The device code (for the device-code grant)."
    }
  }
}