---
title: "Convert a message to a document"
method: GET
path: "/messages/{message_id}/convert"
tags: ["Message"]
---

# Convert a message to a document

`GET /messages/{message_id}/convert`

## Request

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

Convert a message to various document formats.

## Path parameters

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

## Query parameters

- `format` 'pdf' | 'docx' | 'html' | 'rtf' | 'odt' | 'xlsx' | 'csv', required
- `cookie_name` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `401`: Missing or invalid authentication.
- `403`: No access to the message's chat.
- `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)
