> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetecho.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger Notification

> Initiates an outbound voice call to the customer's primary phone.

**Agent path** — set `agent_id`. The agent's `system_prompt` is rendered
with the variable map. If the agent has an `output_schema`, structured
data is extracted after the call and stored in `call_result`, then
POSTed to your webhook URL.

**LLM path** — omit `agent_id`. Echo generates a call script using
the business context, message, and optional `collect_feedback` flag.




## OpenAPI

````yaml POST /notifications
openapi: 3.0.3
info:
  title: Echo API
  description: |
    Echo is a voice notification platform. Use your API key (returned on signup)
    in the `x-api-key` header for all `/v1/*` endpoints.

    The API key implicitly scopes every request to your project and business —
    no need to pass IDs in the URL.
  version: 1.0.0
servers:
  - url: https://api.meetecho.ai/v1
    description: Production
security: []
tags:
  - name: Auth
    description: Signup, login, token refresh
  - name: Customers
    description: Manage customers within your project
  - name: Agents
    description: Manage reusable voice agents
  - name: Notifications
    description: Trigger and inspect outbound calls
  - name: API Keys
    description: Create and revoke API keys for your project
  - name: Project
    description: Inspect and configure your project settings
  - name: Webhook Endpoints
    description: >-
      Create and manage webhook endpoints — each with its own URL, event
      subscriptions, and signing secret
  - name: Delivery Logs
    description: >-
      Inspect delivery history, per-attempt details, and manually retry failed
      deliveries
paths:
  /notifications:
    post:
      tags:
        - Notifications
      summary: Trigger outbound call
      description: |
        Initiates an outbound voice call to the customer's primary phone.

        **Agent path** — set `agent_id`. The agent's `system_prompt` is rendered
        with the variable map. If the agent has an `output_schema`, structured
        data is extracted after the call and stored in `call_result`, then
        POSTed to your webhook URL.

        **LLM path** — omit `agent_id`. Echo generates a call script using
        the business context, message, and optional `collect_feedback` flag.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNotificationRequest'
            examples:
              agent_path:
                summary: Agent path
                value:
                  customer_id: 8cc6199f-9466-46f2-9db7-936f3c2c1c0b
                  agent_id: ddb8be3b-a426-4122-b877-a0cba363c89d
                  variables:
                    agent_name: Echo Reminders
                    appointment_date: Monday, April 14
                    appointment_time: 10:00 AM
              llm_path:
                summary: LLM path
                value:
                  customer_id: 8cc6199f-9466-46f2-9db7-936f3c2c1c0b
                  message: Your appointment tomorrow at 10 AM has been confirmed.
                  collect_feedback: true
                  max_duration_seconds: 120
      responses:
        '201':
          description: Call queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  notification:
                    $ref: '#/components/schemas/Notification'
                  call:
                    type: object
                    properties:
                      callId:
                        type: string
                      status:
                        type: string
              example:
                notification:
                  id: 13eea9cc-dbad-897d-35d9-fa46a5e30971
                  project_id: e56b4c35-882d-4604-9944-9763d314ea59
                  agent_id: ddb8be3b-a426-4122-b877-a0cba363c89d
                  customer_id: 8cc6199f-9466-46f2-9db7-936f3c2c1c0b
                  target_phone_e164: '+971123456789'
                  message: ''
                  context: null
                  collect_feedback: false
                  max_duration_seconds: 180
                  status: in_progress
                  call_result: null
                  created_at: '2026-03-18T17:51:00.000Z'
                  updated_at: '2026-03-18T17:51:01.000Z'
                call:
                  callId: call-abc123
                  status: queued
        '404':
          description: Customer not found or no primary phone
      security:
        - ApiKey: []
components:
  schemas:
    CreateNotificationRequest:
      type: object
      required:
        - customer_id
      description: >
        `message` is required on the **LLM path** (when `agent_id` is omitted).

        On the **agent path** (when `agent_id` is set), `message` is optional —
        the

        agent's `system_prompt` drives the call. Supply `variables` to fill any

        `{{token}}` placeholders in the prompt.
      properties:
        customer_id:
          type: string
          format: uuid
          description: Must belong to your project
          example: 8cc6199f-9466-46f2-9db7-936f3c2c1c0b
        message:
          type: string
          description: Required for LLM path. Optional for agent path.
          example: Your appointment tomorrow at 10 AM has been confirmed.
        context:
          type: string
          nullable: true
          example: Patient has been a client for 3 years.
        agent_id:
          type: string
          format: uuid
          nullable: true
          description: If set, uses Agent path. Omit for LLM-generated call.
          example: ddb8be3b-a426-4122-b877-a0cba363c89d
        variables:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom variables injected into the agent's system_prompt via {{key}}
            syntax.
          example:
            agent_name: Echo Reminders
            appointment_date: Monday, April 14
            appointment_time: 10:00 AM
        collect_feedback:
          type: boolean
          default: false
          description: LLM path only — ask the caller to confirm/cancel/reschedule.
        max_duration_seconds:
          type: integer
          minimum: 30
          maximum: 600
          default: 180
          description: LLM path only.
    Notification:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 13eea9cc-dbad-897d-35d9-fa46a5e30971
        project_id:
          type: string
          format: uuid
          example: e56b4c35-882d-4604-9944-9763d314ea59
        agent_id:
          type: string
          format: uuid
          nullable: true
          example: ddb8be3b-a426-4122-b877-a0cba363c89d
        customer_id:
          type: string
          format: uuid
          nullable: true
          example: 8cc6199f-9466-46f2-9db7-936f3c2c1c0b
        target_phone_e164:
          type: string
          example: '+971123456789'
        message:
          type: string
          example: ''
        context:
          type: string
          nullable: true
        collect_feedback:
          type: boolean
          example: false
        max_duration_seconds:
          type: integer
          example: 180
        status:
          type: string
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - canceled
          example: in_progress
        call_result:
          type: object
          nullable: true
        created_at:
          type: string
          format: date-time
          example: '2026-03-18T17:51:00.000Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-03-18T17:51:05.000Z'
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Echo API key — format: `echo_<64 hex chars>`. Returned once on signup.'

````