> ## 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.

# Call Events Webhook

> Receives call status and action events



## OpenAPI

````yaml https://api.voice-agents.miraiminds.co/swagger.yaml post /v2/webhooks/call-events
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/webhooks/call-events:
    post:
      tags:
        - Call
      summary: Call Events Webhook
      description: Receives call status and action events
      operationId: callEventsWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent'
      responses:
        '200':
          description: Event received
        '400':
          description: Invalid event payload
components:
  schemas:
    WebhookEvent:
      type: object
      required:
        - event
      properties:
        event:
          type: object
          required:
            - type
            - data
          properties:
            type:
              allOf:
                - type: string
                - $ref: '#/components/schemas/EventType'
              description: The event type
            data:
              oneOf:
                - $ref: '#/components/schemas/CallEventData'
                - $ref: '#/components/schemas/ActionEventData'
          discriminator:
            propertyName: type
            mapping:
              call.initiate:
                $ref: '#/components/schemas/CallEventData'
              call.in-progress:
                $ref: '#/components/schemas/CallEventData'
              call.ended:
                $ref: '#/components/schemas/CallEventData'
              call.completed:
                $ref: '#/components/schemas/CallEventData'
              call.timeout:
                $ref: '#/components/schemas/CallEventData'
              call.failed:
                $ref: '#/components/schemas/CallEventData'
              call.validation-failed:
                $ref: '#/components/schemas/CallEventData'
              call.busy:
                $ref: '#/components/schemas/CallEventData'
              call.no-answer:
                $ref: '#/components/schemas/CallEventData'
              call.skip:
                $ref: '#/components/schemas/CallEventData'
              call.rescheduled:
                $ref: '#/components/schemas/CallEventData'
              call.aborted:
                $ref: '#/components/schemas/CallEventData'
              call.lifecycle-ended:
                $ref: '#/components/schemas/CallEventData'
              end-of-call:
                $ref: '#/components/schemas/CallEventData'
              action:
                $ref: '#/components/schemas/ActionEventData'
        metadata:
          type: object
          additionalProperties: true
    EventType:
      type: string
      description: Webhook event type
      enum:
        - call.initiate
        - call.in-progress
        - call.ended
        - call.completed
        - call.timeout
        - call.failed
        - call.validation-failed
        - call.busy
        - call.no-answer
        - call.skip
        - call.rescheduled
        - call.aborted
        - call.lifecycle-ended
        - end-of-call
        - action
    CallEventData:
      type: object
      properties:
        call:
          type: object
          properties:
            id:
              type: string
              example: call_123456
            status:
              $ref: '#/components/schemas/CallStatus'
            startedAt:
              type: string
              format: date-time
              nullable: true
            endedAt:
              type: string
              format: date-time
              nullable: true
            recordingUrl:
              type: string
              format: uri
              nullable: true
              description: Call audio recording URL
            detailUrl:
              type: string
              format: uri
              nullable: true
              description: Call details page URL
            durationSeconds:
              type: number
              description: Call duration in seconds
              example: 45
        analysis:
          type: object
          properties:
            success:
              type: boolean
            summary:
              type: string
              example: User expressed interest but requested a callback later.
            requiredActions:
              type: array
              description: >-
                Actions required after call eg. ['create-order',
                'send-whatsapp', 'send-email']
              items:
                type: string
            insights:
              type: object
              additionalProperties: true
              example:
                interested: true
                callback_requested: true
        credits:
          type: object
          properties:
            used:
              type: number
              example: 1.5
            available:
              type: number
              example: 98.5
        report:
          type: object
          properties:
            reAttemptCount:
              type: number
            rescheduledCount:
              type: number
    ActionEventData:
      type: object
      required:
        - action
      properties:
        action:
          type: string
          enum:
            - create-order
            - send-whatsapp
        call:
          type: object
          required:
            - id
          properties:
            id:
              type: string
        reason:
          $ref: '#/components/schemas/ActionReason'
          nullable: true
        payload:
          oneOf:
            - $ref: '#/components/schemas/SendWhatsapp'
            - $ref: '#/components/schemas/CreateOrderData'
    CallStatus:
      type: string
      description: Current call status
      enum:
        - initiate
        - in-progress
        - ended
        - completed
        - timeout
        - failed
        - validation-failed
        - busy
        - no-answer
        - skip
        - rescheduled
        - aborted
    ActionReason:
      type: string
      enum:
        - missing_address
        - missing_first_name
        - invalid_cart_data
    SendWhatsapp:
      type: object
      properties:
        number:
          type: string
          nullable: true
    CreateOrderData:
      type: object
      properties:
        email:
          type: string
        phone:
          type: string
        lineItems:
          type: array
          items:
            type: object
        shippingAddress:
          type: object
          properties:
            firstName:
              type: string
            lastName:
              type: string
            address1:
              type: string
            address2:
              type: string
            city:
              type: string
            province:
              type: string
            zip:
              type: string
            country:
              type: string
            phone:
              type: string
        cartTotal:
          type: number
        codCharge:
          type: number
        discount:
          type: object
          properties:
            code:
              type: string
            reason:
              type: string
        note:
          type: string
        abandonedCheckoutId:
          type: string
          nullable: true
  securitySchemes:
    PublicKeyAuth:
      type: apiKey
      in: header
      name: x-public-key
    PrivateKeyAuth:
      type: apiKey
      in: header
      name: x-private-key

````