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

# Get Latest Phone Number Event

> Return the most recent event for a phone number (defaults to call.inbound).



## OpenAPI

````yaml get /webhooks/phone-numbers/{phoneNumberId}/events/latest
openapi: 3.0.1
info:
  title: ChatDash Webhook API Documentation
  description: >-
    Subscribe to call events for voice agents (Retell, Native and Vapi) and
    retrieve recent events. See the Webhook Events page for payloads and
    delivery behavior.
  version: 1.1.0
servers:
  - url: https://api.chat-dash.com/v1/public
    description: >-
      Or your white-label backend domain:
      https://<your-backend-domain>/v1/public
security: []
paths:
  /webhooks/phone-numbers/{phoneNumberId}/events/latest:
    get:
      tags:
        - Webhooks
      summary: Get Latest Phone Number Event
      description: >-
        Return the most recent event for a phone number (defaults to
        call.inbound).
      parameters:
        - name: Authorization
          in: header
          required: true
          description: >-
            A client API key (Agency dashboard → Clients → select a client → API
            Access tab) or the agency API key. Client keys can only manage their
            own client's subscriptions, agents and phone numbers.
          schema:
            type: string
        - name: phoneNumberId
          in: path
          required: true
          description: The phone number ID
          schema:
            type: string
        - name: event
          in: query
          required: false
          description: Only return events of this type (default call.inbound)
          schema:
            type: string
            enum:
              - call.started
              - call.missed
              - call.ended
              - call.inbound
      responses:
        '200':
          description: The latest event, or null if none
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoredEvent'
                nullable: true
        '403':
          description: The agent or phone number belongs to a different client or workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Phone number not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    StoredEvent:
      description: >-
        An event as returned by the polling endpoints: the webhook payload plus
        id and createdAt.
      allOf:
        - type: object
          properties:
            id:
              type: string
              description: Event ID
            createdAt:
              type: string
              format: date-time
              description: When the event was generated
        - $ref: '#/components/schemas/CallEvent'
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    CallEvent:
      type: object
      description: >-
        Webhook payload. call.inbound has agentNumber/customerNumber at the top
        level instead of a conversation object.
      properties:
        event:
          type: string
          enum:
            - call.started
            - call.missed
            - call.ended
            - call.inbound
        conversation:
          $ref: '#/components/schemas/CallConversation'
        agentNumber:
          type: string
          description: 'call.inbound only: the number that was called'
        customerNumber:
          type: string
          description: 'call.inbound only: the caller''s number'
    CallConversation:
      type: object
      description: >-
        Fields present depend on the event: call.started has the call
        identifiers only; call.missed adds endedReason and endedAt; call.ended
        has everything.
      properties:
        _id:
          type: string
          description: >-
            ChatDash conversation ID (use with the Conversations and Messages
            endpoints). Not present on call.started.
        platformId:
          type: string
          description: The call's ID on the underlying voice platform
        channel:
          type: string
          enum:
            - inbound
            - outbound
            - phone
            - web
            - unknown
          description: How the call was made
        agentNumber:
          type: string
          description: The agent's phone number
        customerNumber:
          type: string
          description: The customer's phone number
        cost:
          type: number
          description: Call cost
        duration:
          type: number
          description: Call duration in minutes
        url:
          type: string
          description: Call recording URL
        endedReason:
          type: string
          description: >-
            Why the call ended (e.g. user_hangup, agent_hangup,
            voicemail_reached)
        noAnswer:
          type: boolean
          description: Whether the call was not answered
        summary:
          type: string
          description: Post-call summary
        evaluation:
          type: object
          properties:
            isSuccess:
              type: boolean
          description: Post-call success evaluation
        sentiment:
          type: string
          nullable: true
          description: Caller sentiment from post-call analysis
        messages:
          type: array
          description: Call transcript
          items:
            $ref: '#/components/schemas/TranscriptMessage'
        customAnalysis:
          type: object
          additionalProperties: true
          description: Your agent's custom post-call analysis / extracted data
        metadata:
          type: object
          additionalProperties: true
          description: Dynamic variables / metadata passed into the call
        startedAt:
          type: string
          format: date-time
        endedAt:
          type: string
          format: date-time
    TranscriptMessage:
      type: object
      properties:
        _id:
          type: string
        sender:
          type: string
          enum:
            - bot
            - user
          description: bot = the agent, user = the caller
        type:
          type: string
          example: text
        content:
          type: object
          properties:
            text:
              type: string
        createdAt:
          type: string
          format: date-time

````

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