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

# Initiate a Phone Call

> **Legacy — will be deprecated soon. Use the [versioned endpoint](/api-reference/endpoint/call_v1) (`POST /v1/call`) for new integrations.**

Starts an outbound phone call to the given number using the specified agent. The call is placed asynchronously — use `webhook_url` to receive a notification when the call completes. The request and response contract is identical to `POST /v1/call`.

To place the call later instead, pass `scheduled_at` as a 24-hour IST time (`11:00`) or ISO 8601 with offset (`2026-09-12T11:00:00+05:30`). The response returns immediately with the `call_id` the webhook will carry once the call is placed.



## OpenAPI

````yaml POST /call
openapi: 3.1.0
info:
  title: OSVI AI API
  description: REST API for the OSVI AI voice and chat platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.osvi.ai
security:
  - ApiToken: []
paths:
  /call:
    post:
      summary: Initiate a phone call
      description: >-
        **Legacy — will be deprecated soon. Use the [versioned
        endpoint](/api-reference/endpoint/call_v1) (`POST /v1/call`) for new
        integrations.**


        Starts an outbound phone call to the given number using the specified
        agent. The call is placed asynchronously — use `webhook_url` to receive
        a notification when the call completes. The request and response
        contract is identical to `POST /v1/call`.


        To place the call later instead, pass `scheduled_at` as a 24-hour IST
        time (`11:00`) or ISO 8601 with offset (`2026-09-12T11:00:00+05:30`).
        The response returns immediately with the `call_id` the webhook will
        carry once the call is placed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallRequest'
      responses:
        '200':
          description: Call initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallResponse'
        '400':
          description: >-
            Validation error — a required field is missing or a field failed
            validation (e.g. invalid `country_code`, implausible `phone_number`,
            `initial_greeting` over 2000 characters, out-of-range
            `call_config_overrides` values, a `data_extraction` item missing
            `description`, or `webhook_url` is set but Post-Call Analysis is not
            enabled on the agent).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
              example:
                success: false
                error: >-
                  webhook_url is set but post_call_analysis is not enabled on
                  this agent
                details: null
        '401':
          description: Invalid or missing API token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUnauthorized'
        '403':
          description: >-
            The agent does not exist or is not associated with the authenticated
            account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorForbidden'
        '422':
          description: >-
            The agent cannot place outbound calls right now.
            `details.error_code` identifies the cause and `details.action` names
            the fix:


            | `error_code` | Cause | `action` |

            | --- | --- | --- |

            | `NO_OUTBOUND_NUMBER_CONFIGURED` | No phone number is attached to
            the agent. | `attach_number` |

            | `OUTBOUND_TRUNK_REATTACH_REQUIRED` | Every attached number's
            telephony connection is broken and needs to be re-attached with its
            SIP password. | `reattach_number` |

            | `OUTBOUND_TRUNK_INACTIVE` | An attached number exists but is
            deactivated. | `reactivate_number` |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
              example:
                success: false
                error: >-
                  No phone number is attached to this agent. Attach an outbound
                  number under Agent → Telephony before placing calls.
                details:
                  error_code: NO_OUTBOUND_NUMBER_CONFIGURED
                  action: attach_number
      deprecated: true
components:
  schemas:
    CallRequest:
      type: object
      required:
        - agent_uuid
        - phone_number
        - country_code
      properties:
        agent_uuid:
          type: string
          description: >-
            Unique identifier of the OSVI agent that will handle the call. Must
            belong to the account that owns the API token, otherwise the request
            is rejected with `403 Forbidden`.
          example: agent_IsxxxxSf_60EhxxxxMGbz-Rxxg
        phone_number:
          type: string
          description: >-
            Destination phone number (digits only, without country code).
            Normalized and validated against `country_code`; an implausible
            number returns `400 Bad Request`.
          example: '9876543210'
        country_code:
          type: string
          description: >-
            ISO 3166-1 alpha-2 country code of the destination number. Must be a
            recognized country code, otherwise the request is rejected with `400
            Bad Request`.
          example: IN
        system_prompt:
          type: string
          description: >-
            Optional runtime override for the agent's system prompt for this
            call only.
          example: >-
            You are calling to confirm the appointment scheduled for tomorrow at
            10 AM.
        webhook_url:
          type: string
          format: uri
          description: >-
            URL that OSVI will POST to when the call completes. Must be a valid
            HTTP or HTTPS URL that includes a host. The payload matches the
            webhook schema documented in the Webhooks section.
          example: https://yourdomain.com/osvi-webhook
        person_name:
          type: string
          description: >-
            Name of the person being called. Made available to the agent during
            the call.
          example: John Doe
        additional_data:
          type: object
          additionalProperties: true
          description: >-
            Arbitrary key-value object passed to the agent at runtime. Use this
            to provide context the agent can reference during the conversation.
            Must be a JSON object — arrays or scalar values are rejected with
            `400 Bad Request`.
          example:
            appointment_date: '2025-01-15'
            product_name: Premium Plan
        initial_greeting:
          type: string
          maxLength: 2000
          description: >-
            Opening line the agent speaks when the call connects. Maximum 2000
            characters.
          example: >-
            Hello John, this is a reminder about your appointment tomorrow at 10
            AM.
        call_config_overrides:
          type: object
          description: Per-call overrides for call behavior. All fields are optional.
          properties:
            max_call_duration_seconds:
              type: integer
              minimum: 30
              maximum: 1800
              description: >-
                Hard limit on the call length in seconds. Must be between 30 and
                1800 (30 minutes).
              example: 300
            enable_callback:
              type: boolean
              description: Whether the contact may trigger a callback for this call.
              example: false
            retry_config:
              type: object
              description: Controls automatic retries when the call is not answered.
              properties:
                enabled:
                  type: boolean
                  description: Whether automatic retries are enabled.
                  example: true
                max_attempts:
                  type: integer
                  minimum: 1
                  maximum: 10
                  description: Maximum number of retry attempts. Must be between 1 and 10.
                  example: 2
                interval_minutes:
                  type: integer
                  minimum: 1
                  maximum: 1440
                  description: >-
                    Minutes to wait between retry attempts. Must be between 1
                    and 1440 (24 hours).
                  example: 30
          example:
            max_call_duration_seconds: 300
            enable_callback: false
            retry_config:
              enabled: true
              max_attempts: 2
              interval_minutes: 30
        data_extraction:
          type: array
          description: >-
            List of data points the agent should attempt to extract during the
            conversation. Must be an array; each item requires a non-empty
            `description`.
          items:
            type: object
            required:
              - description
            properties:
              key:
                type: string
                description: Identifier under which the extracted value is returned.
                example: appointment_confirmed
              description:
                type: string
                description: >-
                  Instruction describing what the agent should ask or extract.
                  Required for every item.
                example: >-
                  Ask if they can confirm their appointment for tomorrow at 10
                  AM.
              required:
                type: boolean
                description: >-
                  Whether this data point must be collected for the call to be
                  considered successful.
                example: true
              output_format:
                type: string
                description: Expected format of the extracted value.
                example: yes or no
          example:
            - key: appointment_confirmed
              description: Ask if they can confirm their appointment for tomorrow at 10 AM.
              required: true
              output_format: yes or no
            - key: reschedule_preference
              description: If they cannot make it, ask what date and time works better.
              required: false
              output_format: date and time
        scheduled_at:
          type: string
          description: >-
            Optional. When set, the call is queued and placed at this time
            instead of immediately. A string in **24-hour** format, in one of
            two shapes:


            - `HH:MM` — a time in IST (Asia/Kolkata). Placed today at that time
            if it is still ahead, otherwise tomorrow at that time. Example:
            `11:00`.

            - `YYYY-MM-DDTHH:MM:SS+05:30` — ISO 8601 with an explicit UTC
            offset, used exactly as given. Use this for a specific date, or for
            a zone other than IST. Seconds are required, fractional seconds are
            accepted (`2026-09-12T05:30:00.000Z`, as JavaScript's
            `toISOString()` emits), and the offset may be `Z`, `±HH:MM` or
            `±HHMM` up to ±14:00. Example: `2026-09-12T11:00:00+05:30`.


            Must be in the future and at most 90 days ahead. Rejected with `400
            Bad Request`: Unix timestamps, 12-hour clocks (`11 am`), date-times
            without an offset, and any out-of-range field (`12:60`, `25:00`,
            `+15:00`, an invalid calendar date). Nothing is normalised silently.


            Calls scheduled for the same moment start together up to the agent's
            concurrency limit and the rest follow as slots free up. The agent's
            campaign calling window still applies. All other fields behave
            exactly as for an immediate call.
          example: '2026-09-12T11:00:00+05:30'
    CallResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            call_id:
              type: string
              description: >-
                Unique identifier for this call. Included in the webhook payload
                on completion.
              example: call_abc123xyz
            scheduled_at:
              type: string
              description: >-
                Only present when the call was scheduled. The resolved time the
                call will be placed, as ISO 8601 with UTC offset.
              example: '2026-09-12T11:00:00+05:30'
            scheduled_at_epoch:
              type: integer
              description: >-
                Only present when the call was scheduled. The same instant as a
                Unix timestamp in seconds.
              example: 1789191000
    ErrorBadRequest:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: max_call_duration_seconds must be between 30 and 1800
        details:
          type: object
          nullable: true
          example: null
    ErrorUnauthorized:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Invalid API token
    ErrorForbidden:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Agent not found or not associated with this account
        details:
          type: object
          nullable: true
          example: null
  securitySchemes:
    ApiToken:
      type: apiKey
      in: header
      name: API-Token
      description: >-
        16-character API token associated with your OSVI account. Find it in
        your dashboard under Settings → API.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.