Endpoints
Deploy
Deploy a chat to production
POST
/api/chat/{chatId}/deployDeploy a chat to production. Starts a deployment to Vercel and returns immediately.
Request
POST /api/chat/{chatId}/deployHeaders
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer macaly_... |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
chatId | string | The chat ID to deploy |
Example Request
curl -X POST https://www.macaly.com/api/chat/abc123/deploy \
-H "Authorization: Bearer macaly_abc123..."Response
{
"id": "jzga0sttml37v6mbizb8tk1x",
"url": "https://macaly-staging-abc123.macaly.app",
"status": "QUEUED",
"deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw"
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Database deployment ID |
url | string | The deployment URL |
status | "QUEUED" | "BUILDING" | Initial status |
deploymentId | string | Vercel deployment ID |
Status Codes
| Status | Description |
|---|---|
| 200 | Deployment started |
| 400 | Bad request (e.g., no messages in chat) |
| 401 | Invalid or missing API key |
| 403 | No permission to deploy OR chat doesn’t belong to team |
| 404 | Chat not found |
| 500 | Internal server error |
Notes
- Use
GET /api/chat/{chatId}/deploymentwithdeploymentIdset to the returnedidto poll for completion - Requires the
hosting.publish_macalypermission
Next Steps
After starting a deployment:
- Poll for completion using
GET /api/chat/{chatId}/deploymentwithdeploymentIdset to the returnedid - Wait for
statusto becomeREADY