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

# Get a call transcript

> A call's transcript: the conversation and everything the agent did, in order.

Entries are the turns the agent and the customer spoke, the flows it entered and the blocks it
chose, the variables it stored, the knowledge it retrieved, the actions the flow ran, and
events on the line such as transfers. Each entry sets the one object its `type` names. While
the call is in progress, `entries` may be empty or partial; read it again after the call ends.
Actions that run after the call are added shortly after it ends. The same calls are readable
as for `GET /v1/calls/{id}`.



## OpenAPI

````yaml /api-reference/v1/openapi.json get /v1/calls/{id}/transcript
openapi: 3.1.0
info:
  description: >-
    Authenticate every request with an org API key: `Authorization: Bearer
    phk_…`.
  title: Phonely API
  version: '1'
servers:
  - description: US
    url: https://api.us.phonely.ai
  - description: AU
    url: https://api.au.phonely.ai
security: []
paths:
  /v1/calls/{id}/transcript:
    get:
      tags:
        - Calls
      summary: Get a call transcript
      description: >-
        A call's transcript: the conversation and everything the agent did, in
        order.


        Entries are the turns the agent and the customer spoke, the flows it
        entered and the blocks it

        chose, the variables it stored, the knowledge it retrieved, the actions
        the flow ran, and

        events on the line such as transfers. Each entry sets the one object its
        `type` names. While

        the call is in progress, `entries` may be empty or partial; read it
        again after the call ends.

        Actions that run after the call are added shortly after it ends. The
        same calls are readable

        as for `GET /v1/calls/{id}`.
      operationId: get_call_transcript
      parameters:
        - description: The call's ID.
          in: path
          name: id
          required: true
          schema:
            description: The call's ID.
            title: Id
            type: string
        - description: Optional. Must be the key's org.
          in: header
          name: Phonely-Organization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Optional. Must be the key's org.
            title: Phonely-Organization
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallTranscript'
          description: Successful Response
          headers:
            Phonely-Organization:
              description: The authorized organization for this request.
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            The request is invalid: a malformed body, a bad or unknown field, or
            an unknown query parameter.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The API key is missing, invalid or revoked.
          headers:
            WWW-Authenticate:
              description: Always `Bearer`.
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            The key can't do this: a read-only key writing, or
            `Phonely-Organization` naming another org.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The resource doesn't exist, or belongs to another organization.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Rate limited. Retry after the number of seconds in `Retry-After`.
          headers:
            Retry-After:
              description: Seconds until the request can be retried.
              schema:
                type: integer
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: An unexpected error. Contact support with the request ID.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Authentication, authorization or another required service is
            temporarily unavailable.
      security:
        - HTTPBearer: []
components:
  schemas:
    CallTranscript:
      additionalProperties: false
      description: >-
        A call's transcript: the conversation and everything the agent did, in
        order.
      properties:
        call_id:
          description: The call this transcript belongs to.
          title: Call Id
          type: string
        entries:
          description: >-
            Every step of the call, in order. May be empty or partial while the
            call is in progress.
          items:
            $ref: '#/components/schemas/TranscriptEntry'
          title: Entries
          type: array
        object:
          const: call_transcript
          default: call_transcript
          description: The type of this object, always `call_transcript`.
          title: Object
          type: string
        text:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The conversation as plain text, one `Agent: …` or `Customer: …` line
            per turn. `null` when nobody spoke.
          title: Text
      required:
        - object
        - call_id
        - entries
        - text
      title: CallTranscript
      type: object
    ErrorResponse:
      additionalProperties: false
      description: The body of every `/v1` error.
      properties:
        error:
          $ref: '#/components/schemas/Error'
          description: What went wrong.
      required:
        - error
      title: ErrorResponse
      type: object
    TranscriptEntry:
      additionalProperties: false
      description: >-
        One step of the call. `type` names the one object that is set; the
        others are `null`.
      properties:
        action:
          anyOf:
            - $ref: '#/components/schemas/TranscriptAction'
            - type: 'null'
          description: 'Set when `type` is `action`: an action of the flow ran.'
        agent:
          anyOf:
            - $ref: '#/components/schemas/TranscriptAgent'
            - type: 'null'
          description: 'Set when `type` is `agent`: a turn the agent spoke.'
        block:
          anyOf:
            - $ref: '#/components/schemas/TranscriptBlock'
            - type: 'null'
          description: >-
            Set when `type` is `block`: the agent chose which block to continue
            in, a new one or the one it was in.
        customer:
          anyOf:
            - $ref: '#/components/schemas/TranscriptCustomer'
            - type: 'null'
          description: 'Set when `type` is `customer`: a turn the customer spoke.'
        event:
          anyOf:
            - $ref: '#/components/schemas/TranscriptEvent'
            - type: 'null'
          description: 'Set when `type` is `event`: something happened on the line.'
        flow:
          anyOf:
            - $ref: '#/components/schemas/TranscriptFlow'
            - type: 'null'
          description: 'Set when `type` is `flow`: the call entered a flow.'
        knowledge:
          anyOf:
            - $ref: '#/components/schemas/TranscriptKnowledge'
            - type: 'null'
          description: >-
            Set when `type` is `knowledge`: knowledge the agent used for the
            next turn.
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When this step started. `null` when not recorded.
          title: Started At
        type:
          description: >-
            Which object holds this entry. Known values: `agent`, `customer`,
            `flow`, `block`, `variables`, `knowledge`, `action`, `event`. More
            can be added, so handle values you don't recognize.
          title: Type
          type: string
          x-extensible-enum:
            - agent
            - customer
            - flow
            - block
            - variables
            - knowledge
            - action
            - event
        variables:
          anyOf:
            - $ref: '#/components/schemas/TranscriptVariables'
            - type: 'null'
          description: 'Set when `type` is `variables`: the agent stored variable values.'
      required:
        - type
        - started_at
        - agent
        - customer
        - flow
        - block
        - variables
        - knowledge
        - action
        - event
      title: TranscriptEntry
      type: object
    Error:
      additionalProperties: false
      properties:
        code:
          description: >-
            What went wrong, stable and machine-readable. Known values:
            `validation_failed`, `invalid_cursor`, `invalid_api_key`,
            `invalid_user_token`, `user_unavailable`, `insufficient_access`,
            `organization_mismatch`, `forbidden`, `not_found`,
            `method_not_allowed`, `conflict`, `agent_limit_reached`,
            `agent_too_large`, `sms_setup_required`,
            `opportunity_analysis_not_set_up`, `precondition_failed`,
            `payload_too_large`, `unsupported_media_type`,
            `precondition_required`, `rate_limited`, `internal_error`,
            `knowledge_processing_failed`, `bad_gateway`, `service_unavailable`,
            `gateway_timeout`. More can be added, so handle values you don't
            recognize.
          title: Code
          type: string
          x-extensible-enum:
            - validation_failed
            - invalid_cursor
            - invalid_api_key
            - invalid_user_token
            - user_unavailable
            - insufficient_access
            - organization_mismatch
            - forbidden
            - not_found
            - method_not_allowed
            - conflict
            - agent_limit_reached
            - agent_too_large
            - sms_setup_required
            - opportunity_analysis_not_set_up
            - precondition_failed
            - payload_too_large
            - unsupported_media_type
            - precondition_required
            - rate_limited
            - internal_error
            - knowledge_processing_failed
            - bad_gateway
            - service_unavailable
            - gateway_timeout
        details:
          description: One entry per problem field. Empty when the error has none.
          items:
            $ref: '#/components/schemas/ErrorDetail'
          title: Details
          type: array
        message:
          description: For people. Wording can change; branch on `code`.
          title: Message
          type: string
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Also in the `X-Request-Id` header. Quote it to support.
          title: Request Id
      required:
        - code
        - message
        - details
        - request_id
      title: Error
      type: object
    TranscriptAction:
      additionalProperties: false
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The action's name, as the flow labels it.
          title: Name
        stage:
          description: >-
            When it ran: before the call, during it, or after it ended. Known
            values: `pre_call`, `in_call`, `post_call`. More can be added, so
            handle values you don't recognize.
          title: Stage
          type: string
          x-extensible-enum:
            - pre_call
            - in_call
            - post_call
        status:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Whether it succeeded, as the action recorded. `null` when it
            recorded no outcome. Known values: `succeeded`, `failed`. More can
            be added, so handle values you don't recognize.
          title: Status
          x-extensible-enum:
            - succeeded
            - failed
        type:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            What kind of action ran, as recorded: usually the type of the block
            that ran it, such as `api_request`, `send_sms` or `transfer_call`,
            or a step the agent runs itself, such as `outbound_variables` before
            an outbound call. `null` when not recorded.
          title: Type
      required:
        - type
        - name
        - stage
        - status
      title: TranscriptAction
      type: object
    TranscriptAgent:
      additionalProperties: false
      properties:
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The prompt of the block the agent was answering from, as written in
            the flow, including its `[[…]]` placeholders.
          title: Instructions
        possible_blocks:
          anyOf:
            - items:
                $ref: '#/components/schemas/TranscriptBlockOption'
              type: array
            - type: 'null'
          description: The blocks the agent could move to on this turn.
          title: Possible Blocks
        response_type:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            What kind of message this is, when it is not a plain reply. `null`
            for a plain reply. Known values: `interim_message`, `silence_check`,
            `greeting`, `on_hold_music_reminder_message`,
            `on_hold_reminder_message`, `reminder_message`,
            `warm_transfer_chat`. More can be added, so handle values you don't
            recognize.
          title: Response Type
          x-extensible-enum:
            - interim_message
            - silence_check
            - greeting
            - on_hold_music_reminder_message
            - on_hold_reminder_message
            - reminder_message
            - warm_transfer_chat
        text:
          description: What the agent said, with speech markup removed.
          title: Text
          type: string
      required:
        - text
        - response_type
        - instructions
        - possible_blocks
      title: TranscriptAgent
      type: object
    TranscriptBlock:
      additionalProperties: false
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: The block's ID in the flow.
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The block's name, as shown in the flow editor.
          title: Name
        reason:
          anyOf:
            - type: string
            - type: 'null'
          description: Why the agent chose this block, as the agent explained it.
          title: Reason
        type:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            What kind of block it is, as the flow stores it: `prompt` for a Talk
            block, `transfer_call`, `api_request`, and so on. `primary` is the
            agent's main conversation, outside any flow block.
          title: Type
        variables_used:
          anyOf:
            - items:
                $ref: '#/components/schemas/TranscriptVariable'
              type: array
            - type: 'null'
          description: The variables the agent used to make this choice, with their values.
          title: Variables Used
      required:
        - id
        - name
        - type
        - reason
        - variables_used
      title: TranscriptBlock
      type: object
    TranscriptCustomer:
      additionalProperties: false
      properties:
        is_endpoint_detected:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether the agent detected that the customer had finished speaking.
            `false` means it waited for the silence timeout. `null` when not
            recorded.
          title: Is Endpoint Detected
        is_interruption:
          description: Whether the customer started this turn by cutting the agent off.
          title: Is Interruption
          type: boolean
        text:
          description: What the customer said, as transcribed.
          title: Text
          type: string
      required:
        - text
        - is_interruption
        - is_endpoint_detected
      title: TranscriptCustomer
      type: object
    TranscriptEvent:
      additionalProperties: false
      properties:
        recording_offset_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            When it happened, in whole seconds from the start of the call's
            recording. `null` when not recorded.
          title: Recording Offset Seconds
        type:
          description: >-
            What happened. Known values: `agent_disconnected`,
            `inbound_leg_transfer_initiated`, `inbound_leg_transferred`,
            `inbound_leg_ended_transfer`, `outbound_leg_entered`,
            `outbound_left_mid_transfer`, `human_detection_initiated`,
            `voice_failed_over`, `transcriber_failed_over`,
            `transcriber_failover_failed`, `call_ended_no_working_transcriber`.
            More can be added, so handle values you don't recognize.
          title: Type
          type: string
          x-extensible-enum:
            - agent_disconnected
            - inbound_leg_transfer_initiated
            - inbound_leg_transferred
            - inbound_leg_ended_transfer
            - outbound_leg_entered
            - outbound_left_mid_transfer
            - human_detection_initiated
            - voice_failed_over
            - transcriber_failed_over
            - transcriber_failover_failed
            - call_ended_no_working_transcriber
      required:
        - type
        - recording_offset_seconds
      title: TranscriptEvent
      type: object
    TranscriptFlow:
      additionalProperties: false
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: The flow's ID.
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The flow's name.
          title: Name
        type:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Whether it is an inbound or an outbound flow. `null` when not
            recorded. Known values: `inbound`, `outbound`. More can be added, so
            handle values you don't recognize.
          title: Type
          x-extensible-enum:
            - inbound
            - outbound
        version_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The ID of the flow version that ran. `null` when not recorded.
          title: Version Id
        version_name:
          anyOf:
            - type: string
            - type: 'null'
          description: That version's name. `null` when not recorded.
          title: Version Name
        version_number:
          anyOf:
            - type: integer
            - type: 'null'
          description: That version's number. `null` when not recorded.
          title: Version Number
      required:
        - id
        - name
        - type
        - version_id
        - version_number
        - version_name
      title: TranscriptFlow
      type: object
    TranscriptKnowledge:
      additionalProperties: false
      properties:
        context:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The knowledge text the agent had for this turn: the agent's fixed
            knowledge plus what it retrieved.
          title: Context
        sources:
          anyOf:
            - items:
                $ref: '#/components/schemas/TranscriptKnowledgeSource'
              type: array
            - type: 'null'
          description: >-
            The knowledge sources the agent retrieved content from for this
            turn.
          title: Sources
      required:
        - sources
        - context
      title: TranscriptKnowledge
      type: object
    TranscriptVariables:
      additionalProperties: false
      properties:
        captured:
          description: >-
            Variables whose value the agent stored at this point: each value
            appears once, where it was first stored or changed.
          items:
            $ref: '#/components/schemas/TranscriptVariable'
          title: Captured
          type: array
      required:
        - captured
      title: TranscriptVariables
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        field:
          description: >-
            The field the issue is about, as sent: `agent_id`, `limit`. Empty
            when none.
          title: Field
          type: string
        issue:
          description: >-
            What is wrong with the field. Known values: `required`,
            `unknown_field`, `invalid_json`, `invalid_type`, `invalid_value`,
            `out_of_range`, `invalid_cursor`, `read_only_field`. More can be
            added, so handle values you don't recognize.
          title: Issue
          type: string
          x-extensible-enum:
            - required
            - unknown_field
            - invalid_json
            - invalid_type
            - invalid_value
            - out_of_range
            - invalid_cursor
            - read_only_field
        message:
          description: 'For people: what is wrong with this field.'
          title: Message
          type: string
      required:
        - field
        - issue
        - message
      title: ErrorDetail
      type: object
    TranscriptBlockOption:
      additionalProperties: false
      properties:
        name:
          description: The block's name, as shown in the flow editor.
          title: Name
          type: string
      required:
        - name
      title: TranscriptBlockOption
      type: object
    TranscriptVariable:
      additionalProperties: false
      properties:
        name:
          description: The variable's name, as the agent's flow defines it.
          title: Name
          type: string
        value:
          description: Its value, as recorded.
          title: Value
      required:
        - name
        - value
      title: TranscriptVariable
      type: object
    TranscriptKnowledgeSource:
      additionalProperties: false
      properties:
        id:
          description: The knowledge source's ID.
          title: Id
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The knowledge source's name.
          title: Name
      required:
        - id
        - name
      title: TranscriptKnowledgeSource
      type: object
  securitySchemes:
    HTTPBearer:
      description: 'An org API key: `Authorization: Bearer phk_…`'
      scheme: bearer
      type: http

````

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