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

# Create Phone Call

> Create a new outbound phone call.



## OpenAPI

````yaml post /v1/create-phone-call
openapi: 3.1.0
info:
  title: OpenMic v1 External API
  description: >-
    API specification for OpenMic v1 External API, providing endpoints for bot
    management, call handling, and phone number operations.
  version: 1.0.0
servers:
  - url: https://api.openmic.ai
    description: Production Environment
security:
  - api_key: []
tags:
  - name: Calls
    description: Endpoints related to phone call creation and management.
  - name: Bots
    description: Endpoints related to bot management and configuration.
  - name: Phone Numbers
    description: Endpoints related to phone number management and bot linking.
  - name: Knowledge Bases
  - name: FAQs
  - name: Campaigns
  - name: Tools
  - name: Contact Lists
  - name: Contacts
  - name: Voices
    description: >-
      Endpoints for browsing available text-to-speech voices. Voices are
      read-only and can be filtered by gender, provider, language, and accent.
  - name: SMS
    description: Endpoints for sending SMS messages.
paths:
  /v1/create-phone-call:
    post:
      tags:
        - Calls
      summary: Create Phone Call
      description: Create a new outbound phone call.
      requestBody:
        description: Call creation details
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallRequest'
            example:
              from_number: '+1234567890'
              to_number: '+0987654321'
              override_agent_id: bvrg8wzi487w02m2bc7dh0ev
              customer_id: customer_001
              dynamic_variables:
                name: John
              callback_url: https://example.com/callback
      responses:
        '201':
          description: Call created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallResponse'
              example:
                call_type: phonecall
                from_number: '+1234567890'
                to_number: '+0987654321'
                direction: outbound
                call_id: cmbbvrg8wzi487w02m2bc7dji
                agent_id: bvrg8wzi487w02m2bc7dh0ev
                call_status: registered
                customer_id: customer_001
                dynamic_variables:
                  name: John
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid request format, please check API reference.
        '401':
          description: Unauthorized - missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Unauthorized
                message: Invalid or expired API key
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Bot with the specified override_agent_id was not found.
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: An unexpected error occurred. Please try again later.
components:
  schemas:
    CreateCallRequest:
      type: object
      properties:
        from_number:
          type: string
          pattern: ^\+[1-9]\d{1,14}$
          example: '+1234567890'
          description: >-
            The number you own in E.164 format. Must be a number purchased from
            OpenMic.
        to_number:
          type: string
          pattern: ^\+[1-9]\d{1,14}$
          example: '+0987654321'
          description: The number you want to call in E.164 format.
        override_agent_id:
          type: string
          example: bvrg8wzi487w02m2bc7dh0ev
          description: The bot ID to override the default agent.
        customer_id:
          type: string
          example: customer_001
          description: Customer identifier for tracking
        dynamic_variables:
          type: object
          example:
            name: John
          description: Send dynamic variables in key value pairs to replace in the prompt.
        callback_url:
          type: string
          example: https://example.com/callback
          description: Callback URL to receive call events.
      required:
        - from_number
        - to_number
    CallResponse:
      type: object
      properties:
        call_type:
          type: string
          enum:
            - phonecall
            - webcall
          description: Type of call
        from_number:
          type: string
          description: Originating phone number
        to_number:
          type: string
          description: Destination phone number
        direction:
          type: string
          enum:
            - inbound
            - outbound
          description: Call direction
        call_id:
          type: string
          description: Unique call identifier
        agent_id:
          type: string
          description: Bot/agent identifier
        call_status:
          type: string
          enum:
            - registered
            - ongoing
            - ended
            - error
          description: Current call status
        customer_id:
          type: string
          description: Customer identifier
        telephony_identifier:
          type: object
          description: Telephony system identifiers
        start_timestamp:
          type: integer
          description: Call start time (Unix timestamp in milliseconds)
        end_timestamp:
          type: integer
          description: Call end time (Unix timestamp in milliseconds)
        duration_ms:
          type: integer
          description: Call duration in milliseconds
        transcript:
          type: array
          items:
            type: array
            items:
              type: string
            minItems: 2
            maxItems: 2
            description: Transcript entry with [speaker, message] format
          description: Call transcript as array of [speaker, message] pairs
        recording_url:
          type: string
          description: URL to call recording
        latency:
          type: object
          properties:
            e2e_min_latency:
              type: number
              description: Minimum end-to-end latency in seconds
            e2e_median_latency:
              type: number
              description: Median end-to-end latency in seconds
            e2e_p90_latency:
              type: number
              description: 90th percentile end-to-end latency in seconds
            llm_min_latency:
              type: number
              description: Minimum LLM processing latency in seconds
            llm_median_latency:
              type: number
              description: Median LLM processing latency in seconds
            llm_p90_latency:
              type: number
              description: 90th percentile LLM processing latency in seconds
            tts_min_latency:
              type: number
              description: Minimum text-to-speech latency in seconds
            tts_median_latency:
              type: number
              description: Median text-to-speech latency in seconds
            tts_p90_latency:
              type: number
              description: 90th percentile text-to-speech latency in seconds
          description: Latency metrics for different components
        call_analysis:
          type: object
          properties:
            summary:
              type: string
              description: AI-generated summary of the call
            is_successful:
              type: boolean
              description: Whether the call was deemed successful
            success_evaluation:
              type: string
              description: Success evaluation result (e.g., 'good', 'excellent', 'poor')
            extracted_data:
              type: object
              nullable: true
              description: >-
                Structured data extracted from the call based on post-call
                settings
          description: Post-call analysis results including summary and success metrics
        call_cost:
          type: object
          properties:
            total_cost:
              type: number
              description: Total cost of the call in USD
            llm_cost:
              type: number
              description: Cost attributed to LLM usage in USD
            tts_cost:
              type: number
              description: Cost attributed to text-to-speech in USD
            stt_cost:
              type: number
              description: Cost attributed to speech-to-text in USD
          description: Detailed cost breakdown for the call
        dynamic_variables:
          type: object
          example:
            name: John
          description: Send dynamic variables in key value pairs to replace in the prompt.
      required:
        - call_type
        - from_number
        - to_number
        - direction
        - call_id
        - agent_id
        - call_status
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        message:
          type: string
          description: Additional error message (for certain error types)
      required:
        - error
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key authentication. Include your API key in the Authorization header
        as: `Authorization: Bearer <your-api-key>`

````