{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customdomain-ai/json-schema/customdomain-ai-agent-consent-request-schema.json",
  "title": "AgentConsentRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customdomain-ai-agents-api-openapi.yml#/components/schemas/AgentConsentRequest",
  "type": "object",
  "required": [
    "client_id",
    "client_name",
    "redirect_uri",
    "scopes",
    "redirect_host",
    "verified",
    "local",
    "registration"
  ],
  "properties": {
    "client_id": {
      "type": "string"
    },
    "client_name": {
      "type": "string"
    },
    "redirect_uri": {
      "type": "string",
      "description": "Where the authorization code goes if the person approves."
    },
    "scopes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AgentScope"
      },
      "description": "What the agent asked for."
    },
    "state": {
      "type": "string",
      "description": "The agent's own state value, echoed back to it."
    },
    "redirect_host": {
      "type": "string",
      "description": "The host of `redirect_uri`. The client cannot choose it freely the way it chooses its name, so show it."
    },
    "verified": {
      "type": "boolean",
      "description": "True when `redirect_host` is a known assistant's own callback host or a loopback address, and the name imitates no brand."
    },
    "verified_as": {
      "type": "string",
      "description": "The known assistant `redirect_host` belongs to."
    },
    "local": {
      "type": "boolean",
      "description": "True when the code goes to a program on the approver's own computer (a loopback redirect)."
    },
    "imitates": {
      "type": "string",
      "description": "The brand the name claims without owning the redirect host. Such a request cannot be approved."
    },
    "registration": {
      "type": "string",
      "enum": [
        "dynamic",
        "metadata_document"
      ],
      "description": "How the client identified itself, by RFC 7591 registration or by a Client ID Metadata Document."
    },
    "registered_at": {
      "type": "string",
      "format": "date-time",
      "description": "When a dynamically registered client registered."
    },
    "client_id_host": {
      "type": "string",
      "description": "The host that publishes a metadata document client's document."
    }
  },
  "$defs": {
    "AgentScope": {
      "type": "string",
      "enum": [
        "domains:read",
        "domains:connect",
        "domains:disconnect",
        "domains:purchase"
      ],
      "description": "What an agent grant may do. `domains:read` looks: availability, connections, records, certificates, diagnoses, orders and the billing standing. `domains:connect` changes: connect a domain, recheck it, reapply its records, start a one click setup. `domains:disconnect` removes a connected domain, and the call must name the domain. `domains:purchase` spends, up to the grant's monthly cap."
    }
  }
}