{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clearout/json-schema/clearout-post-oauth2-token-request-schema.json",
  "title": "PostOauth2TokenRequest",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_ae-authored/clearout-openapi-generated.yml#/components/schemas/PostOauth2TokenRequest",
  "type": "object",
  "properties": {
    "grant_type": {
      "type": "string",
      "description": "`authorization_code` or `refresh_token`"
    },
    "code": {
      "type": "string",
      "description": "Authorization code (when grant_type=authorization_code)"
    },
    "redirect_uri": {
      "type": "string",
      "description": "Must match the one used in the authorization request"
    },
    "client_id": {
      "type": "string",
      "description": "Public client identifier (required for public clients or when not using Basic auth)"
    },
    "client_secret": {
      "type": "string",
      "description": "Confidential client secret (when not using Basic auth)"
    },
    "code_verifier": {
      "type": "string",
      "description": "PKCE verifier matching the original challenge"
    },
    "refresh_token": {
      "type": "string",
      "description": "Refresh token (when grant_type=refresh_token)"
    },
    "scope": {
      "type": "string",
      "description": "Optional narrower scope request"
    }
  },
  "required": [
    "grant_type",
    "redirect_uri",
    "code_verifier"
  ]
}