Skip to main content
POST
/
api
/
chat
/
{chatId}
/
publish
Publish Message
curl --request POST \
  --url https://macaly.com/api/chat/{chatId}/publish \
  --header 'Authorization: Bearer <token>'
Sends a new message to an existing chat, continuing the conversation.

Request

POST /api/chat/{chatId}/publish

Headers

HeaderRequiredDescription
AuthorizationYesBearer macaly_...
Content-TypeYesapplication/json

Path Parameters

ParameterTypeDescription
chatIdstringThe chat ID

Body Parameters

FieldTypeRequiredDefaultDescription
contentstringConditional-The user’s message. Required unless resume is true
streambooleanNotrueIf false, returns JSON instead of stream
agentMode"auto" | "fast" | "smart"No"auto"Controls the AI agent’s speed/quality tradeoff
executionMode"auto" | "planning" | "build"No"auto"Controls how the AI approaches the task
model"sonnet-4-5" | "sonnet-4-6" | "opus-4-5" | "opus-4-6"No-AI model to use. Defaults to team’s configured model
reasoningEffort"medium" | "high"No-Controls how deeply the AI reasons about the task
resumebooleanNofalseIf true, resumes a stopped conversation without adding new content
experimental_attachmentsarrayNo[]File attachments (see Create Chat for format)
When resume is true, you cannot include content or experimental_attachments. This is used to continue a conversation that was previously stopped.

Example Request

curl -X POST "https://www.macaly.com/api/chat/abc123def456/publish" \
  -H "Authorization: Bearer macaly_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Add a dark mode toggle to the header",
    "stream": false
  }'

Response

JSON Response (when stream: false)

{
  "chatId": "abc123def456",
  "streamId": "stream_xyz789",
  "assistantMessageId": "msg_123"
}
You can then poll the Get Status endpoint to wait for completion.

Streaming Response (when stream: true, default)

2:[{"chatId":"abc123def456"}]
0:"Analyzing your request..."
...

Status Codes

StatusDescription
200Success - Message sent
400Invalid request body
401Invalid or missing API key
402Insufficient credits
403Chat does not belong to this team
404Chat not found
429Rate limited
500Server error
503Service unavailable - The AI workspace is busy, try again shortly

Workflow

For non-streaming usage, the typical workflow is:
  1. Send message with stream: false
  2. Poll status using GET /api/chat/{chatId}/status until completed
  3. Repeat for additional messages