{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pyai-com/json-schema/pyai-com-agent-schema.json",
  "title": "Agent",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pyai-com-openapi.json#/components/schemas/Agent",
  "type": "object",
  "properties": {
    "object": {
      "type": "string"
    },
    "agent_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "persona_system_prompt": {
      "type": [
        "string",
        "null"
      ]
    },
    "platform_guidance": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 12000,
      "description": "Separate setup guidance published by an enrolled server integration; omitted on ordinary profiles."
    },
    "prompt_limit_characters": {
      "type": "integer",
      "enum": [
        8000,
        32000
      ],
      "readOnly": true,
      "description": "Current organization allowance for customer-authored agent instructions. Platform guidance is excluded."
    },
    "greeting": {
      "type": [
        "string",
        "null"
      ]
    },
    "greeting_variants": {
      "type": "array",
      "maxItems": 15,
      "items": {
        "type": "string"
      }
    },
    "voice_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "voice_instruct": {
      "type": "string",
      "description": "Effective TTS delivery direction for instruct-capable voice tiers. Renders PyAI's natural conversational pace when no override is stored."
    },
    "brain_model": {
      "type": "string"
    },
    "barge_sensitivity": {
      "type": [
        "string",
        "null"
      ],
      "deprecated": true
    },
    "ack_mode": {
      "type": [
        "string",
        "null"
      ],
      "deprecated": true
    },
    "idle_check_in": {
      "type": "string",
      "enum": [
        "auto",
        "patient",
        "off"
      ],
      "description": "Idle check-in patience. Renders `auto` when unset, except support agents render `patient`."
    },
    "persona_perspective": {
      "type": "string",
      "enum": [
        "agent",
        "caller"
      ],
      "description": "Which side of the call the persona is on. Renders the effective default (`agent`) when unset."
    },
    "mode": {
      "type": "string",
      "enum": [
        "default",
        "receptionist",
        "sales",
        "collections"
      ],
      "readOnly": true,
      "description": "Read-only runtime mode derived from the agent's role (`default`, `receptionist`, `sales`, or `collections`). Set indirectly via the writable `role` field."
    },
    "role": {
      "type": [
        "string",
        "null"
      ],
      "description": "Role archetype the agent runs as, or null. Writable on create and update."
    },
    "continuity": {
      "type": "boolean",
      "description": "Whether this agent reuses a prior-call caller card when a caller key is available. Default false."
    },
    "inherit_org_knowledgebases": {
      "type": "boolean",
      "description": "Whether an agent with no explicit knowledge bindings inherits organization defaults."
    },
    "knowledgebases": {
      "type": "array",
      "readOnly": true,
      "items": {
        "$ref": "#/$defs/KbBinding"
      },
      "description": "Explicit knowledge base bindings for this agent. Does not include inherited organization defaults. Replace bindings with PUT /v1/agents/{id}/knowledgebases."
    },
    "recordings_enabled": {
      "type": "boolean"
    },
    "consent_line": {
      "type": [
        "string",
        "null"
      ]
    },
    "language": {
      "type": "string",
      "enum": [
        "en",
        "fr",
        "es",
        "de",
        "hi",
        "zh",
        "it",
        "pt",
        "ja",
        "ko"
      ],
      "x-staged-language-ids": [
        "ht",
        "zh-CN",
        "ar-MSA",
        "ar-Gulf"
      ],
      "description": "Session language for this agent's calls. Renders the effective default (`en`) when unset. Canonical staged route identifiers remain excluded from the public enum until qualification."
    },
    "vocabulary": {
      "type": "array",
      "maxItems": 5,
      "items": {
        "type": "string",
        "minLength": 4,
        "maxLength": 64
      },
      "description": "Sanitized Agent vocabulary. An empty list means speech-recognition biasing is off."
    },
    "keyterms": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "deprecated": true
    },
    "goals": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "extraction_schema": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Post-call extraction JSON Schema, or null."
    },
    "extraction_webhook_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Signed delivery target for post-call extraction, or null."
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AgentToolBinding"
      }
    },
    "created_at": {
      "type": "integer",
      "description": "Unix seconds."
    }
  },
  "$defs": {
    "AgentToolBinding": {
      "type": "object",
      "required": [
        "tool_id"
      ],
      "properties": {
        "tool_id": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean",
          "default": true
        },
        "config": {
          "type": "object",
          "additionalProperties": true,
          "description": "Customer SETTINGS for this tool on this agent, keyed by the tool's config_schema field keys (e.g. { from_number, provider_api_key }). Fields marked secret are encrypted at rest and returned masked ('********'); re-send the mask (or omit) to keep the stored value."
        },
        "name": {
          "type": "string",
          "description": "Present on agent reads when the tool resolves."
        },
        "description": {
          "type": "string"
        },
        "input_schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "Per-call model argument schema. Present on agent reads when the tool resolves."
        },
        "execution": {
          "type": "string",
          "enum": [
            "hosted",
            "server",
            "engine",
            "client"
          ],
          "description": "Resolved execution mode. Present on agent reads when the tool resolves."
        }
      }
    },
    "KbBinding": {
      "type": "object",
      "required": [
        "kb_id"
      ],
      "properties": {
        "kb_id": {
          "type": "string",
          "description": "Knowledge base id."
        },
        "weight": {
          "type": "number",
          "default": 1,
          "description": "Retrieval weight relative to other bound bases."
        }
      }
    }
  }
}