{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-create-oauth-client-request-schema.json",
  "title": "CreateOAuthClientRequest",
  "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/CreateOAuthClientRequest",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 255,
      "description": "Human-readable client name. At most 255 characters."
    },
    "type": {
      "type": "string",
      "enum": [
        "confidential",
        "public"
      ],
      "default": "confidential"
    },
    "grant_types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "client_credentials",
          "authorization_code",
          "refresh_token",
          "urn:ietf:params:oauth:grant-type:token-exchange",
          "urn:ietf:params:oauth:grant-type:device_code"
        ]
      },
      "description": "Grant types to enable. Defaults to `[\"client_credentials\"]`."
    },
    "allowed_scopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "redirect_uris": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Required when the `authorization_code` grant is enabled. Must use `https://`, or `http://` on a loopback host (`localhost`, `127.0.0.1`, `[::1]`) for native/CLI apps per RFC 8252 §7.3 — loopback IP-literal URIs match on any port at authorization time."
    },
    "require_dpop": {
      "type": "boolean",
      "default": false,
      "description": "Require DPoP-bound tokens."
    },
    "require_pkce": {
      "type": "boolean",
      "default": true,
      "description": "Require PKCE for the authorization-code flow."
    },
    "token_format": {
      "type": "string",
      "enum": [
        "opaque"
      ],
      "default": "opaque",
      "description": "Optional; the only accepted value is `opaque`. Any other value — including the withdrawn RFC 9068 `jwt` — is refused with 400."
    }
  }
}