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

# Initiate AI Web Call



## OpenAPI

````yaml https://api.voice-agents.miraiminds.co/swagger.yaml post /v2/call/web
openapi: 3.0.3
info:
  title: Voice Agent by Mirai Minds
  version: 1.1.0
  contact:
    name: API Architecture Team
    url: https://miraiminds.co
  license:
    name: Mirai Minds Proprietary License
    url: >-
      https://github.com/MiraiMinds/voice-agent-integration-specs/blob/main/LICENSE.md
servers:
  - url: https://api.voice-agents.miraiminds.co
    description: Production Server
  - url: https://api.stage.voice-agent.miraiminds.co
    description: Staging Server
  - url: http://localhost:3000
    description: Local Server
security:
  - PublicKeyAuth: []
    PrivateKeyAuth: []
paths:
  /v2/call/web:
    post:
      tags:
        - Call
      summary: Initiate AI Web Call
      operationId: initiateWebCall
      parameters:
        - $ref: '#/components/parameters/PublicKeyHeader'
        - $ref: '#/components/parameters/PrivateKeyHeader'
        - $ref: '#/components/parameters/WorkspaceHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitiateWebCallRequest'
      responses:
        '201':
          description: Web Call Initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitiateWebCallResponse'
        '400':
          description: Validation Error
        '404':
          description: Assistant not found
components:
  parameters:
    PublicKeyHeader:
      name: x-public-key
      in: header
      required: true
      schema:
        type: string
    PrivateKeyHeader:
      name: x-private-key
      in: header
      required: true
      schema:
        type: string
    WorkspaceHeader:
      name: workspace
      in: header
      required: true
      schema:
        type: string
  schemas:
    InitiateWebCallRequest:
      type: object
      required:
        - assistant
      properties:
        assistant:
          type: string
          description: Assistant ID
        systemPrompt:
          type: string
          description: Optional system prompt to override the default assistant prompt.
        payload:
          anyOf:
            - $ref: '#/components/schemas/AbandonedCartPayload'
            - $ref: '#/components/schemas/CustomPayload'
          description: Payload structure depends on the assistant variant.
        metadata:
          type: object
          additionalProperties: true
    InitiateWebCallResponse:
      type: object
      properties:
        success:
          type: boolean
        token:
          type: string
          description: LiveKit token for joining the web call.
        error:
          type: object
          nullable: true
    AbandonedCartPayload:
      type: object
      description: >-
        Payload structure for abandoned cart recovery calls. Based on Shopify
        abandoned checkout webhook.
      additionalProperties: false
      required:
        - customer
        - lineItems
        - subtotalPriceSet
        - totalDiscountSet
        - totalPriceSet
      properties:
        id:
          type: string
          description: >-
            Shopify abandoned checkout ID (e.g.,
            gid://shopify/AbandonedCheckout/...)
          example: gid://shopify/AbandonedCheckout/66509168181329
        abandonedCheckoutUrl:
          type: string
          format: uri
          description: Recovery URL for the abandoned checkout
          example: >-
            https://example-store.myshopify.com/checkouts/ac/abc123xyz/recover?key=sample_recovery_key&locale=en-IN
        customer:
          type: object
          additionalProperties: false
          required:
            - firstName
            - phone
          properties:
            firstName:
              type: string
              example: John
            lastName:
              type: string
              example: Doe
            email:
              type: string
              format: email
              nullable: true
            phone:
              type: string
              description: Customer phone number (E.164 recommended)
              example: '+919876543210'
        discountCodes:
          type: array
          description: Array of discount codes applied to the cart
          items:
            type: string
          default: []
        totalDiscountSet:
          type: object
          additionalProperties: false
          properties:
            shopMoney:
              type: object
              additionalProperties: false
              properties:
                amount:
                  type: string
                  example: '0.0'
        subtotalPriceSet:
          type: object
          additionalProperties: false
          properties:
            shopMoney:
              type: object
              additionalProperties: false
              properties:
                amount:
                  type: string
                  example: '1895.0'
        totalPriceSet:
          type: object
          additionalProperties: false
          properties:
            shopMoney:
              type: object
              additionalProperties: false
              properties:
                amount:
                  type: string
                  example: '1895.0'
        taxesIncluded:
          type: boolean
          example: true
        taxLines:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              rate:
                type: number
                example: 0.05
              ratePercentage:
                type: number
                example: 5
              source:
                type: string
                nullable: true
              title:
                type: string
                example: IGST
              price:
                type: string
                example: '90.24'
        lineItems:
          type: array
          description: Products in the abandoned cart
          minItems: 1
          items:
            type: object
            additionalProperties: false
            required:
              - title
              - quantity
            properties:
              title:
                type: string
                example: Sample Product Name
              quantity:
                type: integer
                minimum: 1
                example: 1
              variant:
                type: object
                additionalProperties: false
                required:
                  - id
                  - title
                properties:
                  id:
                    type: string
                    example: gid://shopify/ProductVariant/58523289485393
                  title:
                    type: string
                    example: Default / Standard / Regular
        billingAddress:
          type: object
          additionalProperties: false
          properties:
            country:
              type: string
              example: India
            phone:
              type: string
              example: '+919876543211'
        shippingAddress:
          type: object
          additionalProperties: false
          properties:
            country:
              type: string
              example: India
            address1:
              type: string
              example: 123 Sample Street, Sample Area
            address2:
              type: string
              example: Apt 4B
            city:
              type: string
              example: Delhi
            province:
              type: string
              example: DL
            provinceCode:
              type: string
              example: DL
            zip:
              type: string
              example: '110001'
            phone:
              type: string
              example: '+919876543211'
    CustomPayload:
      type: object
      description: >-
        Flexible payload structure for custom assistant variants. Can include
        any fields relevant to the call.
      additionalProperties: true
      example:
        orderId: ORD-12345
        customerName: Jane Smith
        orderValue: 2500
        status: pending
        notes: Customer requested callback
  securitySchemes:
    PublicKeyAuth:
      type: apiKey
      in: header
      name: x-public-key
    PrivateKeyAuth:
      type: apiKey
      in: header
      name: x-private-key

````