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

# Get a message by id

> Answers 404 when the id does not exist or belongs to another project.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/messages/{id}
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: Fields
    description: >-
      Custom field definitions, both the built-in ones and the ones a project
      creates.
  - name: Field groups
    description: Sections that organize custom fields in the interface.
  - name: Deals
    description: Opportunities moving through a pipeline, each tied to a contact.
  - name: Contacts
    description: >-
      People inside a project, holding the custom field values collected about
      them.
  - name: Messages
    description: Individual messages inside a chat, inbound and outbound.
  - name: Chats
    description: Conversations with a contact over a connected channel.
  - name: Loss reasons
    description: The catalog of reasons a deal can be marked as lost.
  - 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: Notes
    description: >-
      Free text attached to a contact or a deal, written by a user, an agent, or
      the system.
paths:
  /v1/messages/{id}:
    get:
      tags:
        - Messages
      summary: Get a message by id
      description: Answers 404 when the id does not exist or belongs to another project.
      operationId: getMessagesById
      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
                  archivedAt:
                    type: string
                    format: date-time
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                  projectId:
                    type: string
                    minLength: 1
                  chatId:
                    type: string
                    minLength: 1
                  type:
                    type: string
                    minLength: 1
                  sender:
                    type: object
                    properties:
                      type:
                        type: string
                        minLength: 1
                      id:
                        type: string
                        minLength: 1
                      name:
                        type: string
                        minLength: 1
                    required:
                      - type
                    additionalProperties: false
                  timestamp:
                    type: string
                    format: date-time
                  status:
                    type: string
                    enum:
                      - PENDING
                      - SENT
                      - RECEIVED
                      - READ
                      - PLAYED
                      - FAILED
                  deletedAt:
                    type: string
                    format: date-time
                  editedId:
                    type: string
                    minLength: 1
                  repliedId:
                    type: string
                    minLength: 1
                  forwardedId:
                    type: string
                    minLength: 1
                  content:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - TEXT
                          content:
                            type: object
                            properties:
                              text:
                                type: string
                                minLength: 1
                            required:
                              - text
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - IMAGE
                          content:
                            type: object
                            properties:
                              caption:
                                type: string
                              media:
                                type: object
                                properties:
                                  url:
                                    type: string
                                    format: uri
                                  mimeType:
                                    type: string
                                    minLength: 1
                                  fileId:
                                    type: string
                                    minLength: 1
                                required:
                                  - url
                                additionalProperties: false
                            required:
                              - media
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - VIDEO
                          content:
                            type: object
                            properties:
                              caption:
                                type: string
                              media:
                                type: object
                                properties:
                                  url:
                                    type: string
                                    format: uri
                                  mimeType:
                                    type: string
                                    minLength: 1
                                  fileId:
                                    type: string
                                    minLength: 1
                                  isAnimated:
                                    type: boolean
                                    default: false
                                required:
                                  - url
                                additionalProperties: false
                            required:
                              - media
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - AUDIO
                          content:
                            type: object
                            properties:
                              caption:
                                type: string
                              media:
                                type: object
                                properties:
                                  url:
                                    type: string
                                    format: uri
                                  mimeType:
                                    type: string
                                    minLength: 1
                                  fileId:
                                    type: string
                                    minLength: 1
                                required:
                                  - url
                                  - fileId
                                additionalProperties: false
                            required:
                              - media
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - DOCUMENT
                          content:
                            type: object
                            properties:
                              caption:
                                type: string
                              media:
                                type: object
                                properties:
                                  url:
                                    type: string
                                    format: uri
                                  mimeType:
                                    type: string
                                    minLength: 1
                                  fileId:
                                    type: string
                                    minLength: 1
                                  filename:
                                    type: string
                                required:
                                  - url
                                additionalProperties: false
                            required:
                              - media
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - STICKER
                          content:
                            type: object
                            properties:
                              caption:
                                type: string
                              media:
                                type: object
                                properties:
                                  url:
                                    type: string
                                    format: uri
                                  mimeType:
                                    type: string
                                    minLength: 1
                                  fileId:
                                    type: string
                                    minLength: 1
                                  isAnimated:
                                    type: boolean
                                    default: false
                                required:
                                  - url
                                additionalProperties: false
                            required:
                              - media
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - CONTACT
                          content:
                            type: object
                            properties:
                              name:
                                type: string
                                minLength: 1
                              phones:
                                type: array
                                items:
                                  type: string
                              emails:
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  format: email
                              urls:
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  format: uri
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - LOCATION
                          content:
                            type: object
                            properties:
                              latitude:
                                type: number
                              longitude:
                                type: number
                              name:
                                type: string
                              address:
                                type: string
                            required:
                              - latitude
                              - longitude
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - REACTION
                          content:
                            type: object
                            properties:
                              value:
                                type: string
                            required:
                              - value
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - TEMPLATE
                          content:
                            type: object
                            properties:
                              templateId:
                                type: string
                                minLength: 1
                              variables:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      minLength: 1
                                    value:
                                      type: string
                                      minLength: 1
                                  required:
                                    - name
                                    - value
                                  additionalProperties: false
                            required:
                              - templateId
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - URL
                          content:
                            type: object
                            properties:
                              text:
                                type: string
                                minLength: 1
                              showPreview:
                                type: boolean
                            required:
                              - text
                            additionalProperties: false
                        required:
                          - type
                          - content
                        additionalProperties: false
                required:
                  - id
                  - createdAt
                  - updatedAt
                  - projectId
                  - type
                  - sender
                  - timestamp
                  - status
                additionalProperties: false
              example:
                id: 6716d2a57e63cc0015b9f4d1
                projectId: 665f1c2e8a94b70012d4e9a1
                chatId: 6713cc481f52bb0014a7d3e9
                type: TEXT
                sender:
                  type: CONTACT
                  id: 6712a4d95b38ee0011c9f2b4
                  name: Maria Andrade
                timestamp: '2026-01-15T09:31:40.000Z'
                status: RECEIVED
                content:
                  type: TEXT
                  content:
                    text: Oi! Vocês atendem no sábado?
                createdAt: '2026-01-15T09:31:41.000Z'
                updatedAt: '2026-01-15T09:31:41.000Z'
        '401':
          description: Missing or invalid credentials
          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

````