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

# List the calls of a contact

> Answers with a bare array of calls, newest first, without an envelope or pagination fields. A call is stored once it ends, with its recording copied a few seconds later. Answered calls up to one hour are transcribed on their own; each transcription is followed by an AI summary in `analysis`. That analysis also writes what the call said into the fields of the deal and the contact, filled ones included, so a call can raise the same update events and webhooks as any other edit. Includes the calls attached to the contact and to the deals of the contact the caller can see.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/contacts/{contactId}/calls
openapi: 3.0.3
info:
  title: Leadstaker API
  version: 1.0.0
  description: Public REST API for Leadstaker projects.
servers:
  - url: https://n-api.leadstaker.com
    description: Production
security: []
tags:
  - name: Calls
    description: >-
      Phone calls made through the telephony app, with their recording,
      transcript and AI summary.
  - name: Chats
    description: Conversations with a contact over a connected channel.
  - name: Contacts
    description: >-
      People inside a project, holding the custom field values collected about
      them.
  - name: Deals
    description: Opportunities moving through a pipeline, each tied to a contact.
  - name: Field groups
    description: Sections that organize custom fields in the interface.
  - name: Fields
    description: >-
      Custom field definitions, both the built-in ones and the ones a project
      creates.
  - name: Leads
    description: >-
      Chatbot conversations captured in a project, with the answers given and
      where the visitor came from.
  - name: Loss reasons
    description: The catalog of reasons a deal can be marked as lost.
  - name: Messages
    description: Individual messages inside a chat, inbound and outbound.
  - name: Notes
    description: >-
      Free text attached to a contact or a deal, written by a user, an agent, or
      the system.
  - name: Pipelines
    description: Ordered sets of stages a deal travels through.
  - name: Stages
    description: Steps inside a pipeline, including the built-in open and closed ones.
  - name: Tags
    description: Free-form labels attached to deals.
  - name: Tasks
    description: >-
      Follow-up activities with a due date, attached to a deal and assigned to a
      user.
paths:
  /v1/contacts/{contactId}/calls:
    get:
      tags:
        - Calls
      summary: List the calls of a contact
      description: >-
        Answers with a bare array of calls, newest first, without an envelope or
        pagination fields. A call is stored once it ends, with its recording
        copied a few seconds later. Answered calls up to one hour are
        transcribed on their own; each transcription is followed by an AI
        summary in `analysis`. That analysis also writes what the call said into
        the fields of the deal and the contact, filled ones included, so a call
        can raise the same update events and webhooks as any other edit.
        Includes the calls attached to the contact and to the deals of the
        contact the caller can see.
      operationId: getContactsByContactIdCalls
      parameters:
        - name: contactId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
        - name: '[limit]'
          in: query
          required: false
          description: How many calls to return, at most 50. Defaults to 20.
          schema:
            type: integer
            minimum: 1
            maximum: 50
        - name: '[offset]'
          in: query
          required: false
          description: How many calls to skip.
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                    projectId:
                      type: string
                      minLength: 1
                    entityId:
                      type: string
                      minLength: 1
                      description: >-
                        The deal the call is attached to, or the contact when it
                        has no deal.
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    provider:
                      type: string
                      enum:
                        - API4COM
                    externalId:
                      type: string
                      minLength: 1
                      description: The call id on the telephony provider.
                    direction:
                      type: string
                      enum:
                        - OUTBOUND
                        - INBOUND
                    from:
                      anyOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - EXTENSION
                            number:
                              type: string
                              minLength: 1
                              description: >-
                                The extension on the telephony provider, e.g.
                                `1000`.
                            userId:
                              type: string
                              minLength: 1
                              description: >-
                                The user holding the extension; absent while the
                                extension is not mapped to anyone.
                          required:
                            - type
                            - number
                          additionalProperties: false
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - PHONE
                            number:
                              type: string
                              minLength: 1
                              description: >-
                                Digits with the country code, e.g.
                                `5548999998888`.
                          required:
                            - type
                            - number
                          additionalProperties: false
                    to:
                      anyOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - EXTENSION
                            number:
                              type: string
                              minLength: 1
                              description: >-
                                The extension on the telephony provider, e.g.
                                `1000`.
                            userId:
                              type: string
                              minLength: 1
                              description: >-
                                The user holding the extension; absent while the
                                extension is not mapped to anyone.
                          required:
                            - type
                            - number
                          additionalProperties: false
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - PHONE
                            number:
                              type: string
                              minLength: 1
                              description: >-
                                Digits with the country code, e.g.
                                `5548999998888`.
                          required:
                            - type
                            - number
                          additionalProperties: false
                    startedAt:
                      type: string
                      format: date-time
                    answeredAt:
                      type: string
                      format: date-time
                    endedAt:
                      type: string
                      format: date-time
                    durationInSeconds:
                      type: integer
                      description: Talk time, from the answer to the hang up.
                    outcome:
                      type: string
                      enum:
                        - ANSWERED
                        - NO_ANSWER
                        - BUSY
                        - VOICEMAIL
                        - FAILED
                    recording:
                      type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - PENDING
                            - STORED
                            - UNAVAILABLE
                            - FAILED
                          description: >-
                            `PENDING` while the recording is copied from the
                            provider; only a `STORED` one can be played or
                            transcribed.
                        mimeType:
                          type: string
                          minLength: 1
                      required:
                        - status
                      additionalProperties: false
                    transcription:
                      type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - AVAILABLE
                            - TOO_LONG
                            - PENDING
                            - DONE
                            - FAILED
                          description: >-
                            `AVAILABLE`: can be requested. `TOO_LONG`: the
                            recording is over the transcription limit.
                            `PENDING`, `DONE` or `FAILED` once requested.
                        text:
                          type: string
                          description: >-
                            The whole transcript in one block, when the call was
                            not split by speaker. Absent when `turns` is
                            present.
                        turns:
                          type: array
                          items:
                            type: object
                            properties:
                              speaker:
                                type: string
                                enum:
                                  - SELLER
                                  - CUSTOMER
                                description: >-
                                  `SELLER` is the extension side, `CUSTOMER` the
                                  phone side.
                              start:
                                type: number
                                description: Seconds from the start of the recording.
                              text:
                                type: string
                            required:
                              - speaker
                              - start
                              - text
                            additionalProperties: false
                          description: >-
                            Who said what, in order. Present when each side of
                            the call was transcribed from its own channel of the
                            recording.
                      required:
                        - status
                      additionalProperties: false
                      nullable: true
                      description: Null while there is no stored recording.
                    analysis:
                      type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - PENDING
                            - DONE
                            - FAILED
                        summary:
                          type: string
                          description: >-
                            Absent when the call had nothing worth summing up,
                            such as a voicemail.
                      required:
                        - status
                      additionalProperties: false
                      nullable: true
                      description: >-
                        The AI summary, written after each transcription; null
                        before the first one.
                    createdAt:
                      type: string
                      format: date-time
                    updatedAt:
                      type: string
                      format: date-time
                  required:
                    - id
                    - projectId
                    - entityId
                    - entityType
                    - provider
                    - externalId
                    - direction
                    - from
                    - to
                    - startedAt
                    - endedAt
                    - durationInSeconds
                    - outcome
                    - recording
                    - transcription
                    - analysis
                    - createdAt
                    - updatedAt
                  additionalProperties: false
              example:
                - id: 6abd10c5812811e995a28f1f
                  projectId: 665f1c2e8a94b70012d4e9a1
                  entityId: 6715be3a9c40aa0013d8e5c2
                  entityType: DEAL
                  provider: API4COM
                  externalId: '1759236412.4821'
                  direction: OUTBOUND
                  from:
                    type: EXTENSION
                    number: '1000'
                    userId: 664d9e0b7c83aa0010f1c2d3
                  to:
                    type: PHONE
                    number: '5548999998888'
                  startedAt: '2026-09-30T13:40:02.000Z'
                  answeredAt: '2026-09-30T13:40:11.000Z'
                  endedAt: '2026-09-30T13:42:34.000Z'
                  durationInSeconds: 143
                  outcome: ANSWERED
                  recording:
                    status: STORED
                    mimeType: audio/mpeg
                  transcription:
                    status: DONE
                    text: >-
                      Oi João, tudo bem? Vi que a proposta de 10 mil ficou com
                      você.

                      Tudo, gostei dos 10 mil. Me retorna amanhã?
                    turns:
                      - speaker: SELLER
                        start: 1.4
                        text: >-
                          Oi João, tudo bem? Vi que a proposta de 10 mil ficou
                          com você.
                      - speaker: CUSTOMER
                        start: 9.2
                        text: Tudo, gostei dos 10 mil. Me retorna amanhã?
                  analysis:
                    status: DONE
                    summary: >-
                      João aceitou a proposta de R$ 10 mil e pediu retorno
                      amanhã para fechar.
                  createdAt: '2026-09-30T13:42:40.000Z'
                  updatedAt: '2026-09-30T13:43:15.000Z'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed for this credential
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    Error:
      type: object
      required:
        - errorCode
        - message
        - status
      properties:
        errorCode:
          type: string
        message:
          type: string
        status:
          type: integer
        errors:
          type: array
          items:
            type: object
            required:
              - field
              - code
              - message
            properties:
              field:
                type: string
              code:
                type: string
              message:
                type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````

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