Endpoints
Get status
Poll the status of a chat workflow
GET
/api/chat/{chatId}/statusPoll the status of a chat workflow. Useful for checking if a chat has finished processing without needing to maintain a streaming connection.
Request
GET /api/chat/{chatId}/statusHeaders
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer macaly_... |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
chatId | string | The chat ID returned from POST /api/chat |
Example Request
curl https://www.macaly.com/api/chat/abc123/status \
-H "Authorization: Bearer macaly_abc123..."Response
{
"chatId": "abc123",
"url": "https://www.macaly.com/chat/abc123",
"status": "completed",
"result": {
"content": "Here's what I built for you..."
}
}Response Fields
| Field | Type | Description |
|---|---|---|
chatId | string | The chat ID |
url | string | URL to view the chat in browser |
status | string | Current workflow status (see below) |
result.content | string | Final assistant message (only when completed) |
error.message | string | Error description (only when failed) |
Status Values
| Status | Description |
|---|---|
running | Workflow is currently executing |
completed | Finished successfully |
failed | Encountered an error |
cancelled | Workflow was manually cancelled |
no_active_workflow | No workflow found for this chat |
Status Codes
| Status | Description |
|---|---|
| 200 | Success |
| 401 | Invalid or missing API key |
| 403 | Chat does not belong to your team |
| 404 | Chat not found |
Polling Pattern
while true; do
STATUS=$(curl -s https://www.macaly.com/api/chat/$CHAT_ID/status \
-H "Authorization: Bearer macaly_...")
echo "Status: $(echo $STATUS | jq -r .status)"
if echo "$STATUS" | grep -qE '"status":"(completed|failed|cancelled)"'; then
echo "Done!"
break
fi
sleep 2
doneNext Steps
Once status is completed, you can:
- Deploy the app using
POST /api/chat/{chatId}/deploy