Endpoints

Deploy

Deploy a chat to production

POST/api/chat/{chatId}/deploy

Deploy a chat to production. Starts a deployment to Vercel and returns immediately.

Request

POST /api/chat/{chatId}/deploy

Headers

HeaderRequiredDescription
AuthorizationYesBearer macaly_...

Path Parameters

ParameterTypeDescription
chatIdstringThe 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

FieldTypeDescription
idstringDatabase deployment ID
urlstringThe deployment URL
status"QUEUED" | "BUILDING"Initial status
deploymentIdstringVercel deployment ID

Status Codes

StatusDescription
200Deployment started
400Bad request (e.g., no messages in chat)
401Invalid or missing API key
403No permission to deploy OR chat doesn’t belong to team
404Chat not found
500Internal server error

Notes

This endpoint returns immediately after starting the deployment. The deployment happens asynchronously on Vercel.

Next Steps

After starting a deployment:

  1. Poll for completion using GET /api/chat/{chatId}/deployment with deploymentId set to the returned id
  2. Wait for status to become READY