PermuteDocs
Go to Permute

Chats · chatTurnsCreate

Send a message

Continue a conversation using its prior context.

POST/v1/chats/{chatId}/turns
betauserworkspace

When to use

Continue a conversation using its prior context.

For agents

Use a new request ID for each message and keep it unchanged on retry.

Example

typescript
import { PermuteAppClient } from '@permute/sdk/app';

const client = new PermuteAppClient();
const result = await client.chats.send('chat_abcdefghijklmnopqrstuvwx', {
  "action": "send_message",
  "clientRequestId": "next_turn",
  "message": "Group it by stage"
});

Request body

json
{
  "action": "send_message",
  "clientRequestId": "next_turn",
  "message": "Group it by stage"
}

Response

json
{
  "data": {
    "id": "chat_abcdefghijklmnopqrstuvwx",
    "status": "running",
    "error": null,
    "conversation": [
      {
        "role": "user",
        "content": "Group it by stage"
      }
    ],
    "traceSteps": []
  }
}