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

# Send session transcription

> Envia a conversa por e-mail para o endereço informado. O corpo do e-mail
traz a conversa renderizada; o arquivo `.txt` só é gerado e anexado quando
`attachTranscription` é `true` (padrão) — com `false`, nada é gravado no
storage.

O `transcriptionURL` da resposta (quando há anexo) é uma URL privada e
assinada, válida por 30 dias; o arquivo permanece, só o link expira.
Depois de 30 dias, chame o endpoint de transcrição de novo para obter um
link novo.

Com `includeContactHistory` em `true`, a transcrição deixa de ser só desta
sessão e passa a cobrir todas as conversas que o contato já teve com o
tenant, unificadas em ordem cronológica.

A conversa é carregada antes do envio: se isso falhar, nenhum e-mail sai.



## OpenAPI

````yaml /api/services-api.yaml post /v1/tenants/{tenantID}/sessions/{sessionID}/transcription/send
openapi: 3.0.3
info:
  description: >-
    Talqui is an omnichannel customer service platform that unifies
    conversations from WhatsApp, Instagram, Telegram, and many other channels
    into a single attendant panel, alongside a broader ecosystem of plugins and
    integrations. This API gives developers programmatic access to Talqui's
    services layer, exposing the operations needed to read and manage tenants,
    conversations, plugins, and related resources that power that platform.


    Authentication is available on behalf of an Operator (the default for this
    API), a Plugin Connection, or a Plugin — see the [Talqui authentication
    guide](https://docs.talqui.chat/guides/introduction/authentication/) for how
    each token is obtained and when to use it.


    Need help or have questions not covered here? Reach out to
    support@talqui.com.
  license:
    name: ISC
    url: https://opensource.org/license/isc-license-txt
  title: Talqui - Services API
  version: 0.69.1
servers:
  - description: Production
    url: https://services-api.talqui.chat
security: []
tags:
  - name: Tenants
  - name: Settings
  - name: Analytics/Reports
  - name: Analytics
  - name: Campaigns
  - name: Campaigns/Models
  - name: Contacts
  - name: Contacts/Imports
  - name: Handoff links
  - name: Inboxes
  - name: Messages
  - name: Notifications
  - name: Sessions
  - name: Operators/Shortcuts
  - name: Operators
  - name: Plugins
  - name: Setup
  - name: Uploads
paths:
  /v1/tenants/{tenantID}/sessions/{sessionID}/transcription/send:
    post:
      tags:
        - Sessions
      summary: Send session transcription
      description: >-
        Envia a conversa por e-mail para o endereço informado. O corpo do e-mail

        traz a conversa renderizada; o arquivo `.txt` só é gerado e anexado
        quando

        `attachTranscription` é `true` (padrão) — com `false`, nada é gravado no

        storage.


        O `transcriptionURL` da resposta (quando há anexo) é uma URL privada e

        assinada, válida por 30 dias; o arquivo permanece, só o link expira.

        Depois de 30 dias, chame o endpoint de transcrição de novo para obter um

        link novo.


        Com `includeContactHistory` em `true`, a transcrição deixa de ser só
        desta

        sessão e passa a cobrir todas as conversas que o contato já teve com o

        tenant, unificadas em ordem cronológica.


        A conversa é carregada antes do envio: se isso falhar, nenhum e-mail
        sai.
      operationId: SendSessionTranscriptionController
      parameters:
        - in: path
          name: tenantID
          required: true
          schema:
            description: The tenant the session belongs to.
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            type: string
        - in: path
          name: sessionID
          required: true
          schema:
            description: The session to transcribe and send.
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                attachTranscription:
                  default: true
                  description: >-
                    Whether to also generate the .txt transcript and attach it.
                    Defaults to true.
                  type: boolean
                destinationEmail:
                  description: Recipient address for the transcription e-mail.
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                  type: string
                includeContactHistory:
                  default: false
                  description: >-
                    Whether to widen the transcript to every session this
                    contact ever had with the tenant, merged chronologically.
                    Defaults to false (this session only).
                  type: boolean
              required:
                - destinationEmail
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  attached:
                    description: Whether the .txt transcript was attached.
                    type: boolean
                  destinationEmail:
                    description: Address the conversation was sent to.
                    format: email
                    pattern: >-
                      ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                    type: string
                  includedContactHistory:
                    description: >-
                      Whether the transcript covered the contact full history
                      instead of a single session.
                    type: boolean
                  providerMessageID:
                    description: Provider-side id of the accepted message.
                    nullable: true
                    type: string
                  sentAt:
                    description: When the e-mail was handed to the provider.
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    type: string
                  sessionID:
                    description: The transcribed session.
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    type: string
                  transcriptionURL:
                    description: >-
                      Private signed URL of the attached transcript, valid 30
                      days; null when no attachment was requested.
                    format: uri
                    nullable: true
                    type: string
                required:
                  - sessionID
                  - destinationEmail
                  - attached
                  - includedContactHistory
                  - transcriptionURL
                  - sentAt
                  - providerMessageID
                type: object
          description: Response for status 200.
        '400':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/MissingTenantIDError'
                        - $ref: '#/components/schemas/MissingSessionIDError'
                        - $ref: '#/components/schemas/RequestValidationError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: >-
            MissingTenantIDError (error_code 1001): tenantID absent from the
            URL. | MissingSessionIDError (error_code 1061): sessionID absent
            from the URL. | RequestValidationError (error_code 1002): params or
            body fail validation.
        '401':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/UnauthorizedError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: 'UnauthorizedError (error_code 1003): missing/invalid operator token.'
        '403':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/ForbiddenError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: 'ForbiddenError (error_code 1004): operator token rejected upstream.'
        '404':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/SessionNotFoundError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: >-
            SessionNotFoundError (error_code 1060): sessionID does not exist for
            this tenant.
        '500':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/UnknownError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: >-
            UnknownError (error_code 5999): Unexpected internal error not
            otherwise documented for this endpoint.
        '502':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/StorageUploadError'
                        - $ref: '#/components/schemas/EmailDeliveryFailedError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: >-
            StorageUploadError (error_code 5008): the transcript could not be
            written to storage. | EmailDeliveryFailedError (error_code 5010):
            the e-mail provider rejected the message.
      security:
        - operatorAuth: []
components:
  schemas:
    MissingTenantIDError:
      additionalProperties: false
      properties:
        error:
          enum:
            - MissingTenantIDError
          type: string
        error_code:
          enum:
            - 1001
          type: number
        message:
          example: tenantID is required.
          type: string
        statusCode:
          enum:
            - 400
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    MissingSessionIDError:
      additionalProperties: false
      properties:
        error:
          enum:
            - MissingSessionIDError
          type: string
        error_code:
          enum:
            - 1061
          type: number
        message:
          example: sessionID is required.
          type: string
        statusCode:
          enum:
            - 400
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    RequestValidationError:
      additionalProperties: false
      properties:
        error:
          enum:
            - RequestValidationError
          type: string
        error_code:
          enum:
            - 1002
          type: number
        fields:
          items:
            additionalProperties: false
            properties:
              allowed:
                type: string
              field:
                type: string
              received:
                type: string
            required:
              - field
              - received
              - allowed
            type: object
          type: array
        message:
          example: Invalid request data.
          type: string
        statusCode:
          enum:
            - 400
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
        - fields
      type: object
    UnauthorizedError:
      additionalProperties: false
      properties:
        error:
          enum:
            - UnauthorizedError
          type: string
        error_code:
          enum:
            - 1003
          type: number
        message:
          example: You are not authorized to perform this request.
          type: string
        statusCode:
          enum:
            - 401
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    ForbiddenError:
      additionalProperties: false
      properties:
        error:
          enum:
            - ForbiddenError
          type: string
        error_code:
          enum:
            - 1004
          type: number
        message:
          example: You do not have access to this resource.
          type: string
        statusCode:
          enum:
            - 403
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    SessionNotFoundError:
      additionalProperties: false
      properties:
        error:
          enum:
            - SessionNotFoundError
          type: string
        error_code:
          enum:
            - 1060
          type: number
        message:
          example: Session not found.
          type: string
        statusCode:
          enum:
            - 404
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    UnknownError:
      additionalProperties: false
      properties:
        error:
          enum:
            - UnknownError
          type: string
        error_code:
          enum:
            - 5999
          type: number
        message:
          example: For some unknown reason your request has not succeeded.
          type: string
        statusCode:
          enum:
            - 500
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    StorageUploadError:
      additionalProperties: false
      properties:
        error:
          enum:
            - StorageUploadError
          type: string
        error_code:
          enum:
            - 5008
          type: number
        message:
          example: Failed to upload file to storage.
          type: string
        statusCode:
          enum:
            - 502
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    EmailDeliveryFailedError:
      additionalProperties: false
      properties:
        error:
          enum:
            - EmailDeliveryFailedError
          type: string
        error_code:
          enum:
            - 5010
          type: number
        message:
          example: Failed to deliver e-mail.
          type: string
        statusCode:
          enum:
            - 502
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
  securitySchemes:
    operatorAuth:
      bearerFormat: JWT
      description: >-
        Behalf of an Operator (default). A JWT issued by Talqui Core when an
        operator signs in, scoped to every tenant that operator belongs to. Send
        as `Authorization: Bearer <jwt-token>`.
      scheme: bearer
      type: http

````

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