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

# Create a Web Call

> Create a browser-based DialNexa web call session.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. A public v1 replacement is not currently listed in the v1 reference. This endpoint remains available for existing integrations until then.
</Warning>

Creates a browser-based web call session for an agent. The v1 path is `/webcalls`. Legacy unversioned `/webcall` integrations can continue during the transition window, but new v1 integrations should use `/webcalls`.

## When to use this

* **Website embeds**: let a visitor start a voice conversation from a page.
* **Product demos**: launch a temporary web call without dialing a phone number.
* **Support flows**: collect web visitor context and pass it to the agent as metadata.

## Related endpoints

* [Terminate a Web Call](/docs/api-reference/webcalls/terminate): end an active web call session.
* [Create an Outbound Call](/docs/api-reference/calls/create-outbound): create a phone-based outbound call.


## OpenAPI

````yaml POST /webcall
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /webcall:
    post:
      tags:
        - Webcall
      summary: Create and initiate a webcall session
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 


        Creates a new webcall session by creating a call log entry and
        processing it to initiate the actual call. Requires a valid API key in
        the X-API-Key header belonging to the organization making the request.
        If agent_version_number is provided, that specific version is used
        (webcalls allow unpublished versions, unlike regular outbound calls);
        otherwise the latest published version of the agent is used.
        Organization, agent, and phone number are validated before the session
        is created. A call log entry with type 'web' is created and processed
        through the outbound call processor with isWebCall=true, which updates
        the call's status from 'created' to 'initiated' on success. Returns
        session_id (the call log ID) for webcall tracking.
      operationId: WebcallController_createWebcall
      parameters:
        - name: X-API-Key
          in: header
          description: API key for authentication (alternative to JWT token)
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebcallDto'
      responses:
        '201':
          description: Webcall session created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebcallResponseDto'
        '400':
          description: >-
            Bad request - validation error (invalid phone number, agent_id, or
            metadata format)
        '401':
          description: Unauthorized - invalid or missing API key
        '404':
          description: Not found - organization, agent, or agent version not found
        '500':
          description: Internal server error
      deprecated: true
components:
  schemas:
    CreateWebcallDto:
      type: object
      properties:
        phone_number:
          type: string
          example: '+1234567890'
          description: >-
            Phone number to call (must include country code). Format: +[country
            code][phone number]
        agent_id:
          type: string
          example: ag_12345678901234
          description: >-
            Agent ID to use for the call. Must belong to the authenticated
            organization.
        agent_version_number:
          type: number
          example: 2
          description: >-
            Specific agent version number to use (optional). If provided, must
            be a published version. If not provided, will use the latest
            published version.
        metadata:
          type: object
          example:
            customer_name: John Doe
            customer_email: john@example.com
            lead_source: website
            priority: high
          description: >-
            Metadata for the call including customer information and any
            additional context. This data will be available during the call for
            personalization.
      required:
        - phone_number
        - agent_id
        - metadata
    CreateWebcallResponseDto:
      type: object
      properties:
        session_id:
          type: string
          example: mf0x4riongyz6h
          description: >-
            Unique session ID for the webcall. This is the call log ID that can
            be used to track the webcall session.
        agent_id:
          type: string
          example: 0e709fd2-8339-46fa-8e28-ca8c66e00f43
          description: Agent ID used for the webcall
        call_id:
          type: string
          example: mf0x4riongyz6h
          description: Call ID from Nexa Speech API
        state:
          type: string
          example: created
          description: Current state of the webcall session
        websocket_url:
          type: string
          example: /webcall/ws/mf0x4riongyz6h
          description: WebSocket URL for connecting to the webcall session
        message:
          type: string
          example: Webcall session created successfully
          description: Success message from the API
      required:
        - session_id
        - agent_id
        - call_id
        - state
        - websocket_url
        - message
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````