# List calls with transcripts

`POST /calls/search`

> This is a subset of the full specification, limited to the `POST /calls/search` operation.
>
> You can find the full specification here: /_bundle/docs/references/@Preview/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: Preview
  description: This is a subset of the full specification, limited to the `POST /calls/search` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Calls
    description: Everything about your Calls
paths:
  /calls/search:
    post:
      summary: List calls with transcripts
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Calls
      operationId: listCallsWithTranscripts
      description: |
        Retrieve calls by a list of conversation ids and include transcripts when available.
        A maximum of 20 `conversation_ids` can be provided. If none are provided or more than 20 are provided, a 400 error is returned.

        Requires the `read_conversations` OAuth scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - conversation_ids
              properties:
                conversation_ids:
                  type: array
                  description: A list of conversation ids to fetch calls for. Maximum 20.
                  minItems: 1
                  maxItems: 20
                  items:
                    type: string
            examples:
              example:
                value:
                  conversation_ids:
                    - '64619700005694'
                    - '64619700005695'
      responses:
        '200':
          description: successful
          content:
            application/json:
              examples:
                successful:
                  value:
                    type: list
                    data:
                      - type: call
                        id: '123'
                        conversation_id: '64619700005694'
                        transcript:
                          - start_time: '0.0'
                            end_time: '3.00'
                            speaker_label: Teammate 1
                            speaker: Teammate 1
                            content: Hello, thanks for calling. How can I help today?
                            speaker_type: admin
                            speaker_id: '789'
                            speaker_name: Jane Doe
                        transcript_status: completed
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: list
                  data:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/call'
                        - type: object
                          properties:
                            transcript:
                              type: array
                              description: The call transcript if available, otherwise an empty array.
                              items:
                                $ref: '#/components/schemas/call_transcript_turn'
                            transcript_status:
                              type: string
                              nullable: true
                              description: The status of the transcript if available.
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                too_many_ids:
                  value:
                    type: error.list
                    errors:
                      - code: conversation_id_limit_exceeded
                        message: A list of up to 20 conversation IDs is required
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
                Token lacks required scope:
                  value:
                    type: error.list
                    request_id: a3e5b8e2-1234-5678-9abc-def012345678
                    errors:
                      - code: token_unauthorized
                        message: Not authorized to access resource
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    datetime:
      oneOf:
        - title: string
          type: string
          format: date-time
          description: A date and time following the ISO8601 notation.
        - title: integer
          type: integer
          description: A date and time as Unix timestamp notation.
    call:
      title: Call
      type: object
      x-tags:
        - Calls
      description: Represents a phone call in Intercom
      properties:
        type:
          type: string
          description: String representing the object's type. Always has the value `call`.
          example: call
        id:
          type: string
          description: The id of the call.
          example: '123'
        conversation_id:
          type: string
          nullable: true
          description: The id of the conversation associated with the call, if any.
          example: '456'
        admin_id:
          type: string
          nullable: true
          description: The id of the admin associated with the call, if any.
          example: '789'
        contact_id:
          type: string
          nullable: true
          description: The id of the contact associated with the call, if any.
          example: 6762f0dd1bb69f9f2193bb83
        state:
          type: string
          description: The current state of the call.
          example: ended
        initiated_at:
          $ref: '#/components/schemas/datetime'
        answered_at:
          $ref: '#/components/schemas/datetime'
        ended_at:
          $ref: '#/components/schemas/datetime'
        created_at:
          $ref: '#/components/schemas/datetime'
        updated_at:
          $ref: '#/components/schemas/datetime'
        recording_url:
          type: string
          format: uri
          nullable: true
          description: API URL to download or redirect to the call recording if available.
          example: https://api.intercom.io/calls/123/recording
        transcription_url:
          type: string
          format: uri
          nullable: true
          description: API URL to the call transcript if available.
          example: https://api.intercom.io/calls/123/transcript
        call_type:
          type: string
          description: The type of call.
          example: phone
        direction:
          type: string
          description: The direction of the call.
          example: outbound
        ended_reason:
          type: string
          nullable: true
          description: The reason for the call end, if applicable.
          example: missed
        phone:
          type: string
          nullable: true
          description: The phone number involved in the call, in E.164 format.
          example: '+15551234567'
        fin_recording_url:
          type: string
          format: uri
          nullable: true
          description: API URL to the AI Agent (Fin) call recording if available.
        fin_transcription_url:
          type: string
          format: uri
          nullable: true
          description: API URL to the AI Agent (Fin) call transcript if available.
        duration:
          type: integer
          nullable: true
          description: Total call duration in seconds from the caller's perspective. For inbound calls, measured from initiated to ended. For outbound calls, measured from answered to ended. Null until the call ends, and for outbound calls that were never answered.
          example: 900
        talk_time:
          type: integer
          nullable: true
          description: Total time in seconds the agent and customer were connected.
          example: 300
        queue_time:
          type: integer
          nullable: true
          description: Total time in seconds the caller waited in queue before connecting, when assigned to a team.
          example: 45
        hold_time:
          type: integer
          nullable: true
          description: Total time in seconds the caller was placed on hold during the call.
          example: 60
    call_transcript_turn:
      title: Call Transcript Turn
      type: object
      x-tags:
        - Calls
      description: A single turn in a call transcript.
      properties:
        start_time:
          oneOf:
            - type: string
            - type: number
          description: The start time of the turn, as a seconds offset from the start of the call. A string on calls transcribed by Amazon Transcribe, a number on Fin Voice calls.
          example: '0.0'
        end_time:
          oneOf:
            - type: string
            - type: number
          description: The end time of the turn, as a seconds offset from the start of the call. A string on calls transcribed by Amazon Transcribe, a number on Fin Voice calls.
          example: '3.00'
        speaker_label:
          type: string
          description: The diarization label for the speaker.
          example: Teammate 1
        speaker:
          type: string
          description: The diarization label for the speaker. Same value as `speaker_label`.
          example: Teammate 1
        content:
          type: string
          description: The transcribed text spoken during this turn.
          example: Hello, thanks for calling. How can I help today?
        speaker_type:
          type: string
          description: The type of the speaker - either `admin` for a teammate or `user` for a contact. Absent on Fin Voice call transcripts and on calls transcribed before speaker attribution shipped, where only `speaker_label` identifies the speaker.
          example: admin
        speaker_id:
          type: string
          description: The id of the teammate or contact who is the speaker. `-1` when the teammate who spoke has since been deleted, in which case `speaker_name` is `Deleted teammate`.
          example: '789'
        speaker_name:
          type: string
          description: The resolved display name of the speaker. A contact who has been merged into another resolves to the name on the surviving record. Omitted when the speaker cannot be resolved or has no name, for example a contact whose record was scrambled by a GDPR deletion request. Clients should fall back to `speaker_label` when this is absent.
          example: Jane Doe
        article_sources:
          type: array
          description: Sources Fin cited during this turn. Only present on Fin Voice call transcripts.
          example:
            - title: Password Reset Guide
              entity_type: 120
              entity_id: '8185560'
          items:
            type: object
            properties:
              title:
                type: string
                description: The title of the cited source.
                example: Password Reset Guide
              entity_type:
                type: integer
                description: The type of the cited entity.
                example: 120
              entity_id:
                type: string
                description: The id of the cited entity.
                example: '8185560'
        triggered_guidance:
          type: array
          description: Guidance rules that Fin matched during this turn. Only present on Fin Voice call transcripts.
          example:
            - match_type: clarification
              rule_id: '3'
              rule_text: If the customer asks about pricing, ask which plan they're interested in before answering
          items:
            type: object
            properties:
              match_type:
                type: string
                description: How the rule was matched.
                example: clarification
              rule_id:
                type: string
                description: The id of the matched guidance rule.
                example: '3'
              rule_text:
                type: string
                description: The text of the matched guidance rule.
                example: If the customer asks about pricing, ask which plan they're interested in before answering
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code.
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              data:
                type: object
                nullable: true
                additionalProperties: true
                description: Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
                example:
                  required_permissions:
                    - read_conversations
            required:
              - code
      required:
        - type
        - errors
    intercom_version:
      description: Intercom API version.</br>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.
      type: string
      example: Preview
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - '2.13'
        - '2.14'
        - '2.15'
        - '2.16'
        - '2.17'
        - '2.18'
        - Preview
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
