Skip to content
Last updated

Edit message content and metadata after creation. NEW endpoint for content modification with proper authorization and validation.

PATCHhttps://api.aitronos.com/v1/threads/{thread_id}/messages/{message_id}

Edit message content and metadata after creation. This is a new endpoint that provides content modification capabilities with proper authorization, validation, and audit trails.

Path Parameters

thread_id string required

The unique identifier of the thread containing the message.

message_id string required

The unique identifier of the message to update.

Request Body

content string optional

The new text content for the message. Content is automatically trimmed of leading/trailing whitespace. Cannot be empty or whitespace only.

metadata object optional

Custom key-value pairs for message metadata. Performs partial update - merges with existing metadata.

Bash
curl -X PATCH "https://api.aitronos.com/v1/threads/thread_abc123/messages/msg_123" \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Updated message content."
  }'

Response:

{
  "id": "msg_123",
  "created_at": "2025-11-17T10:00:00Z",
  "updated_at": "2025-11-17T11:30:00Z",
  "thread_id": "thread_abc123",
  "role": "user",
  "content": "Updated message content.",
  "attachments": [],
  "metadata": {
    "edited": true,
    "reason": "typo"
  }
}