{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/call2me-app/json-schema/call2me-app-call2me-core-models-call-create-call-request-schema.json",
  "title": "CreateCallRequest",
  "description": "Request to create an outbound call.",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/call2me-app-openapi.json#/components/schemas/call2me_core__models__call__CreateCallRequest",
  "properties": {
    "agent_id": {
      "type": "string",
      "title": "Agent Id",
      "description": "Agent to use for this call"
    },
    "to_number": {
      "type": "string",
      "pattern": "^\\+[1-9]\\d{1,14}$",
      "title": "To Number",
      "description": "E.164 format phone number to call"
    },
    "from_number": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{1,14}$"
        },
        {
          "type": "null"
        }
      ],
      "title": "From Number",
      "description": "Caller ID (must be owned by account)"
    },
    "topic": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Topic",
      "description": "Why this call is being placed. Reaches the agent as `call_purpose` and is woven into both the opening line and the system prompt, so the agent states its reason instead of a generic greeting."
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata",
      "description": "Custom metadata for the call"
    },
    "dynamic_variables": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Dynamic Variables",
      "description": "Per-call values substituted into the agent's `{{placeholders}}` (system prompt, opening line, closing line). Up to 50 keys matching `^[A-Za-z_][A-Za-z0-9_]{0,63}$`; values are strings up to 1000 characters (numbers and booleans are converted to strings). Placeholders without a value are removed, never read aloud. The stored agent is not changed."
    },
    "begin_message": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Begin Message",
      "description": "Exact opening sentence for THIS call (variables are substituted). Without it, outbound calls generate a direction-aware opening."
    }
  },
  "type": "object",
  "required": [
    "agent_id",
    "to_number"
  ]
}