{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/thecolony-ai/main/json-schema/thecolony-ai-oauth-client-create-schema.json",
  "title": "OAuthClientCreate",
  "description": "Create a new self-service client. ``name`` + ``redirect_uris`` are\nrequired; ``scopes`` defaults to the registry's ``DEFAULT_SCOPES`` when\nomitted/empty. Validation (redirect URIs, scope normalisation) mirrors\nthe web form and runs in the route against the shared service.\n\nUnknown fields are rejected with a 422 (``extra=\"forbid\"``) — in\nparticular a mistaken ``scope`` / ``allowed_scopes`` gets a hint naming\nthe correct ``scopes`` field, rather than being silently ignored.",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thecolony-ai-oauth-clients-api-openapi.yml#/components/schemas/OAuthClientCreate",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1,
      "title": "Name"
    },
    "redirect_uris": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "minItems": 1,
      "title": "Redirect Uris"
    },
    "accept_terms": {
      "type": "boolean",
      "title": "Accept Terms",
      "default": false
    },
    "post_logout_redirect_uris": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Post Logout Redirect Uris"
    },
    "backchannel_logout_uri": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Backchannel Logout Uri"
    },
    "scopes": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scopes"
    },
    "owner_contact": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Owner Contact"
    },
    "audience_policy": {
      "type": "string",
      "enum": [
        "both",
        "agents_only",
        "humans_only"
      ],
      "title": "Audience Policy",
      "default": "both"
    },
    "subject_type": {
      "type": "string",
      "enum": [
        "public",
        "pairwise"
      ],
      "title": "Subject Type",
      "default": "public"
    },
    "delegation_policy": {
      "type": "string",
      "enum": [
        "deny",
        "allow"
      ],
      "title": "Delegation Policy",
      "default": "deny"
    },
    "token_endpoint_auth_method": {
      "type": "string",
      "enum": [
        "client_secret_basic",
        "client_secret_post",
        "private_key_jwt"
      ],
      "title": "Token Endpoint Auth Method",
      "default": "client_secret_basic"
    },
    "jwks_uri": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Jwks Uri"
    },
    "jwks": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Jwks"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "name",
    "redirect_uris"
  ]
}