{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/skysay-ai/json-schema/skysay-ai-outbound-call-schema.json",
  "title": "OutboundCall",
  "description": "A workspace that holds a number calls out with no approval step. recipient_type, purpose and user_authorization are optional and recorded when sent, never enforced. Destination country is authorized against the org's active workspace capabilities (authorize_outbound), not a fixed platform allowlist.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/skysay-ai-openapi.json#/components/schemas/OutboundCall",
  "properties": {
    "agent_endpoint_id": {
      "description": "Backwards-compatible alias for the selected agent endpoint; new integrations should send agent_id.",
      "type": "string"
    },
    "agent_id": {
      "description": "Canonical saved agent selection. It must belong to the authenticated organization and selected project; the call starts from its stored voice stack.",
      "type": "string"
    },
    "call_context": {
      "description": "Small bounded, non-secret facts valid at call start: at most 32 keys and 4 KB, lists of at most 16 items. Never put endpoint credentials, mutable case history, or a requested voice-stack override here. A conversation workflow read tool is served from this object: put its declared projection fields under case_snapshot, or as top-level keys; every declared field must be present and non-empty or the workflow takes its case-unavailable path. `navigation_hint` is reserved: plain text of at most 500 characters telling the agent what the phone menu it will meet expects, for example \"Press 2 for English, then 1 for billing.\"; it reaches the agent as the built-in variable `call.navigation_hint`, and a longer or non-text hint refuses the call with `call_variables_invalid`. A variable you declared as a keypad field (`keypad` on the field, see PUT /v1/agents/{agent_id}/variables) is read from here too, but only to be keyed on a phone menu: it is never given to the agent as text, and a call whose texts name the field or carry its digits is refused.",
      "maxProperties": 32,
      "type": "object"
    },
    "country": {
      "description": "Optional. The destination country is derived from to_phone_number's calling code; a value sent here is used only when the destination cannot be attributed to a country, and never overrides it. Authorized per-organization by the active workspace capabilities.",
      "type": "string"
    },
    "external_group_reference": {
      "description": "Optional customer-owned batch/group reference.",
      "maxLength": 256,
      "type": "string"
    },
    "external_reference": {
      "description": "Customer-owned stable case/reference ID. Skysay stores it but does not interpret it.",
      "maxLength": 256,
      "type": "string"
    },
    "first_message": {
      "description": "Compatibility alias for runtime_config.first_message.",
      "maxLength": 1000,
      "type": "string"
    },
    "from_phone_number_id": {
      "type": "string"
    },
    "idempotency_key": {
      "description": "Optional body alternative to the Idempotency-Key header. Retries must reuse the same value with the same request.",
      "maxLength": 200,
      "type": "string"
    },
    "instructions": {
      "description": "Compatibility alias for runtime_config.instructions.",
      "maxLength": 8000,
      "type": "string"
    },
    "language": {
      "description": "Compatibility alias for runtime_config.language. When both are supplied, runtime_config.language takes precedence. A selected multilingual hosted language chooses one allowed published profile before reservation. An engine whose agent-catalog row says has_language_axis false (a voice-to-voice engine) publishes no profile per locale; it accepts any language the platform catalogue runs and speaks the call in it.",
      "maxLength": 35,
      "minLength": 2,
      "type": "string"
    },
    "organization_id": {
      "type": "string"
    },
    "project_id": {
      "type": "string"
    },
    "purpose": {
      "description": "Optional, free-form outbound purpose, recorded with the call or message when sent; no purpose, or any token, is ever refused. Documented catalog (pick one or send your own token): appointment, booking_confirmation, callback_requested, customer_outreach, delivery_notification, ops_alert, other, payment_reminder, personal_errand, reservation, status_check, support.",
      "type": "string"
    },
    "recipient_type": {
      "description": "Optional, never enforced or required -- outbound is not restricted to business recipients. Persisted verbatim on the call row if sent; SMS has no recipient_type column, so it is accepted but not stored there.",
      "type": "string"
    },
    "runtime_config": {
      "$ref": "#/$defs/OutboundCallRuntimeConfig"
    },
    "to_phone_number": {
      "type": "string"
    },
    "user_authorization": {
      "description": "Optional: who approved the call and why (`authorized_by`, `reason`). Recorded when sent; never required.",
      "type": "object"
    }
  },
  "required": [
    "organization_id",
    "project_id",
    "from_phone_number_id",
    "to_phone_number"
  ],
  "type": "object",
  "$defs": {
    "OutboundCallRuntimeConfig": {
      "additionalProperties": false,
      "description": "Bounded non-secret, per-call instructions. Clients cannot supply a frozen profile, credential ID, provider, model, or voice selection. runtime_config.language takes precedence over the top-level compatibility alias. For a multilingual hosted agent, language selects an allowed published profile before reserve and worker dispatch. An engine whose agent-catalog row says has_language_axis false (a voice-to-voice engine) publishes no profile per locale; it accepts any language the platform catalogue runs and speaks the call in it.",
      "properties": {
        "first_message": {
          "maxLength": 1000,
          "type": "string"
        },
        "instructions": {
          "maxLength": 8000,
          "type": "string"
        },
        "language": {
          "maxLength": 35,
          "minLength": 2,
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}