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

> Create app voice call through the Voice SDK integration. Use with the authentication and customer identity flow described in the app voice guide.

# Create an app voice call

See [Voice SDK integration](/phone/voice-sdk) for authentication, platform packages, routing, and preview availability.

Enable **Allow calls from apps** in **Settings → Voice & Telephony** for this organization. Disabling it blocks new calls and activation of pending calls; active calls can finish.

Call this endpoint from your authenticated server with a `phone:write` API key. Resolve `contactId` from the signed-in customer and choose an authorized `destination`: either `{ type: 'agent', id }` or `{ type: 'team', id }`.

Reuse the UUID `requestId` for identical retries until activation. Changed settings or retries after activation return 409. `maxDurationSeconds` defaults to 1800 and accepts integers from 60 to 3600; the duration starts at activation.

A successful response is HTTP 200 with `callId`, `sessionId`, `controlToken`, and `expiresAt`. Pass this object unchanged to the OpenCX SDK; it manages the audio connection internally. Audio connection URLs and participant credentials are not part of this response. Join and activate within two minutes. `expiresAt` is the outer call-control deadline, not an extension of that join window. Credentials must be returned only to the authenticated customer and must not be logged or cached.

Creation returns 400 for invalid settings or unsupported agent transfers, 401 for invalid authentication, 403 for missing scope, disabled app calling, or a blocked contact, 404 for an unavailable contact/destination, 409 for conflicting or active calls, and 429 when requests are throttled.


## OpenAPI

````yaml post /phone/web-calls
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /phone/web-calls:
    post:
      tags:
        - Phone
      summary: Create an app voice call
      description: >-
        Server-only. Requires phone:write and enabled Voice SDK access.
        Authenticate the customer before choosing their contact and destination.
        Return these temporary credentials only to that customer.
      operationId: createWebCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebCallDto'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebCallCredentialsDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    CreateWebCallDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/CreateWebCallDtoInput'
      type: object
      properties:
        requestId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: Reuse for retries of the same call creation request.
        contactId:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Verified contact belonging to your organization. Resolve this on
            your server.
        destination:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: agent
                id:
                  type: string
                  minLength: 1
                  maxLength: 100
              required:
                - type
                - id
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  const: team
                id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - type
                - id
              additionalProperties: false
        maxDurationSeconds:
          default: 1800
          type: integer
          minimum: 60
          maximum: 3600
      required:
        - requestId
        - contactId
        - destination
      additionalProperties: false
    WebCallCredentialsDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/WebCallCredentialsDto'
      type: object
      properties:
        callId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        sessionId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        controlToken:
          type: string
        expiresAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - callId
        - sessionId
        - controlToken
        - expiresAt
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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