> ## 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.

# Transcribe a call

> Queues the transcription of a call that has none yet, or whose last one failed, and answers with the call in `PENDING`. Calls over one hour are not transcribed on their own, so this is how to get theirs. A transcription already pending or done answers the call as it is, without queuing another. Answers 404 `RECORDING` while the recording is not `STORED`, and 422 `TELEPHONY_CALL_TOO_LONG` when it is over the size the transcription accepts (about 1h40).



## OpenAPI

````yaml /api-reference/openapi.json post /v1/telephony/calls/{id}/transcription
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/telephony/calls/{id}/transcription:
    post:
      tags:
        - Calls
      summary: Transcribe a call
      description: >-
        Queues the transcription of a call that has none yet, or whose last one
        failed, and answers with the call in `PENDING`. Calls over one hour are
        not transcribed on their own, so this is how to get theirs. A
        transcription already pending or done answers the call as it is, without
        queuing another. Answers 404 `RECORDING` while the recording is not
        `STORED`, and 422 `TELEPHONY_CALL_TOO_LONG` when it is over the size the
        transcription accepts (about 1h40).
      operationId: postTelephonyCallsByIdTranscription
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                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: PENDING
                analysis: null
                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'
        '422':
          description: The payload failed validation
          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.