---
title: "Get a message"
method: GET
path: "/messages/{message_id}"
tags: ["Message"]
---

# Get a message

`GET /messages/{message_id}`

## Request

- Base URL: `https://api.your-domain.com`
- URL: `https://api.your-domain.com/messages/{message_id}`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/docs/messages/:message_id/get.ts> (a function with typed inputs; its response is checked against the schema)

Canonical recovery endpoint: full composed state of a message.

## Path parameters

- `message_id` integer, required: ID of the message to fetch.

## Query parameters

- `cookie_name` string, nullable

## Response `200`

Successful Response

- MessageDetailOut: Composed message state — the recovery contract for dropped SSE streams. See backend/docs/streaming-architecture.md §6 requirement 4.
  - `id` integer, required: ID of the message.
  - `chat_id` integer, required: ID of the chat the message belongs to.
  - `parent_id` integer, nullable, required: ID of the parent user message for assistant replies, else null.
  - `role` string, required: Role of the message author.
  - `content` string, required: Text content of the message.
  - `state` string, nullable, required: Processing state of the message.
  - `error` string, nullable, required: Error string if generation failed, else null.
  - `hint` string, nullable, required: Optional hint about the message state.
  - `created_at` string, date-time, required: When the message was created.
  - `updated_at` string, date-time, required: When the message was last updated.
  - `usage` object, nullable, required: Token usage and cost metadata, if available.
  - `tool_calls` ToolCallOut[], required: Tool calls made while generating the message.
    - `id` integer, required: ID of the tool call.
    - `call_id` string, required: Provider-assigned identifier for the tool call.
    - `tool_name` string, required: Name of the invoked tool.
    - `call_group` integer, required: Group index for tool calls issued together.
    - `call_index` integer, required: Order of the call within its group.
    - `state` string, nullable, required: Current state of the tool call.
    - `is_error` boolean, nullable, required: Whether the tool call resulted in an error.
    - `description` string, nullable, required: Human-readable description of the tool call.
    - `progress_steps` ToolCallProgressStepOut[], required: Ordered progress steps emitted during the call.
      - `name` string, required: Name of the progress step.
      - `message` string, required: Human-readable progress message.
      - `step_index` integer, required: Zero-based order of the step within the tool call.
  - `files` MessageFileOut[], required: Files attached to the message.
    - `id` integer, required: ID of the attached document.
    - `filename` string, required: Original file name.
    - `content_type` string, nullable, required: MIME type of the file, if known.

## Other responses

- `401`: Missing or invalid authentication.
- `403`: No access to the chat the message belongs to.
- `404`: Message or its chat does not exist.
- `422`: Validation Error

---

[API](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api.md) - [All operations](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/revisions/b53e89b98c2b?raw)
