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

# Get latest call by phone number

> Get the most recent call for a phone number. Requires the `read:calls` permission.



## OpenAPI

````yaml /api-reference/openapi.json get /api/calls/latest-by-phone
openapi: 3.1.0
info:
  title: Avoca Enterprise API
  description: >-
    Read-only programmatic access to Avoca data: calls, transcripts, leads,
    coach evaluations, Simple Scheduler sessions and analytics, and outbound
    texting activity.
  version: 1.3.0
servers:
  - url: https://enterprise-api.avoca.ai
security:
  - bearerAuth: []
tags:
  - name: Calls
    description: Call records, transcripts, and pre-call transfers
  - name: Leads
    description: Unified leads (v0) and the canonical leads feed (v1)
  - name: Teams
    description: Teams accessible to the API key
  - name: Coach
    description: Coach (QA) call evaluations and rubrics
  - name: Scheduler Analytics (v0)
    description: Simple Scheduler analytics — legacy flat endpoints
  - name: Sessions & Bookings
    description: v1 scheduling-widget sessions and completed bookings
  - name: Analytics (v1)
    description: v1 funnel, UTM, service-area, and issue-type analytics
  - name: Outbound Texting
    description: Campaign text and subscription-event feeds for BI ingestion
paths:
  /api/calls/latest-by-phone:
    get:
      tags:
        - Calls
      summary: Get latest call by phone number
      description: >-
        Get the most recent call for a phone number. Requires the `read:calls`
        permission.
      operationId: getLatestCallByPhone
      parameters:
        - name: phone
          in: query
          required: true
          description: Phone number to search
          schema:
            type: string
        - $ref: '#/components/parameters/xTeamId'
      responses:
        '200':
          description: The most recent matching call
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Call'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    xTeamId:
      name: x-team-id
      in: header
      description: >-
        Target team ID. Required for multi-team (`enterprise_all_teams` /
        `portfolio_all_teams`) keys on v0 endpoints; single-team keys are locked
        to their team and omit it.
      schema:
        type: integer
  schemas:
    Call:
      type: object
      description: >-
        A call record. The exact columns returned on list endpoints are governed
        by the team's configured column allowlist; the fields below are the
        standard set.
      properties:
        call_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        duration_seconds:
          type: integer
          examples:
            - 245
        call_reason:
          type:
            - string
            - 'null'
          examples:
            - Service request
        call_outcome:
          type:
            - string
            - 'null'
          examples:
            - Appointment booked
        is_booked:
          type: boolean
        is_bookable:
          type: boolean
        booking_result:
          type: string
          enum:
            - Booked
            - Unbooked
            - Excused
          description: >-
            Computed from `is_booked` and `is_bookable`: Booked = call resulted
            in a booking; Unbooked = bookable but not booked; Excused = not a
            bookable opportunity
        is_transferred:
          type: boolean
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        phone_number:
          type:
            - string
            - 'null'
          examples:
            - '+11234567890'
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Human-readable description (newer endpoints)
      required:
        - error
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key in the format `avoca_<64 hex characters>`

````