---
title: "Create Message Route"
method: POST
path: "/api/threads/{thread_id}/messages/"
tags: ["message"]
---

# Create Message Route

`POST /api/threads/{thread_id}/messages/`

Creates a new message.

## Path parameters

- `thread_id` string, uuid, required

## Request body

- MessageCreateInput
  - `role` 'user' | 'assistant', required
  - `content` string, required
  - `metadata` MessageMetadata, required
    - `trustworthiness_score` number, nullable
    - `trustworthiness_explanation` string, nullable
    - `citations` string[], nullable

## Response `201`

Successful Response

- Message
  - `thread_id` string, uuid, required
  - `role` 'user' | 'assistant', required
  - `content` string, required
  - `metadata` MessageMetadata, required
    - `trustworthiness_score` number, nullable
    - `trustworthiness_explanation` string, nullable
    - `citations` string[], nullable
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2025-01-15** `92f517edd77d` — 2 info
  - added the new optional request property `metadata/anyOf[subschema #1: MessageMetadata]/trustworthiness_explanation`
  - added the optional property `metadata/trustworthiness_explanation` to the response with the `201` status
- **2024-12-12** `ba95a7c2fd2d` — 3 breaking, 1 info
  - removed `#/components/schemas/MessageMetadata-Input` from the `metadata` request property `anyOf` list
  - response property `metadata/citations` list-of-types was widened by adding types `array` to media type `application/json` of response `201`
  - the `metadata/citations/anyOf[subschema #1]/` response's property type/format changed from `string`/`` to `array`/`` for status `201`
  - added `#/components/schemas/MessageMetadata` to the `metadata` request property `anyOf` list
- **2024-12-10** `d53dc22c3558` — 1 breaking, 2 info
  - removed `#/components/schemas/MessageMetadata` from the `metadata` request property `anyOf` list
  - added `#/components/schemas/MessageMetadata-Input` to the `metadata` request property `anyOf` list
  - added the optional property `metadata/citations` to the response with the `201` status

[Change history](https://skmtc.dev/cleanlab/apis/agility/changes/api/threads/:thread_id/messages/post.md)

---

[API](https://skmtc.dev/cleanlab/apis/agility.md) · [All operations](https://skmtc.dev/cleanlab/apis/agility/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cleanlab/agility/revisions/d95b89c34a94/schema)
