Skip to main content
GET
https://macaly.com/
/
api
/
chat
/
{chatId}
/
deployment
Get Deployment
curl --request GET \
  --url https://macaly.com/api/chat/{chatId}/deployment \
  --header 'Authorization: Bearer <token>'
Get the current deployment status for a chat. If the deployment is not in a final state, this endpoint will sync the status with Vercel before returning.

Request

GET /api/chat/{chatId}/deployment

Headers

HeaderRequiredDescription
AuthorizationYesBearer macaly_...

Path Parameters

ParameterTypeDescription
chatIdstringThe chat ID

Example Request

curl https://www.macaly.com/api/chat/abc123/deployment \
  -H "Authorization: Bearer macaly_abc123..."

Response

Deployment Ready

{
  "id": "jzga0sttml37v6mbizb8tk1x",
  "url": "https://macaly-staging-abc123.macaly.app",
  "status": "READY",
  "deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw",
  "createdAt": "2025-01-12T21:18:54.906Z",
  "error": null,
  "domain": "macaly-staging-abc123.macaly.app",
  "domains": [
    {
      "domain": "macaly-staging-abc123.macaly.app",
      "verified": true,
      "isCustomDomain": false
    }
  ]
}

No Deployment

{
  "id": null,
  "url": null,
  "status": null,
  "deploymentId": null,
  "createdAt": null,
  "error": null,
  "domain": null,
  "domains": [
    {
      "domain": "macaly-staging-abc123.macaly.app",
      "verified": true,
      "isCustomDomain": false
    }
  ]
}

Deployment Failed

{
  "id": "jzga0sttml37v6mbizb8tk1x",
  "url": "https://macaly-staging-abc123.macaly.app",
  "status": "ERROR",
  "deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw",
  "createdAt": "2025-01-12T21:18:54.906Z",
  "error": ["Build failed: Module not found"],
  "domain": "macaly-staging-abc123.macaly.app",
  "domains": []
}

Response Fields

FieldTypeDescription
idstring | nullDatabase deployment ID (null if never deployed)
urlstring | nullThe deployment URL
statusstring | nullVercel deployment status (see below)
deploymentIdstring | nullVercel deployment ID
createdAtstring | nullISO timestamp of deployment creation
errorstring[] | nullError messages if deployment failed
domainstring | nullPrimary domain for the deployment
domainsarrayAll connected domains
domains[].domainstringDomain name
domains[].verifiedbooleanWhether the domain is verified
domains[].isCustomDomainbooleanWhether this is a custom domain

Deployment Status Values

StatusDescription
QUEUEDDeployment is queued
BUILDINGBuild is in progress
READYDeployment successful
ERRORDeployment failed
CANCELEDDeployment was cancelled

Status Codes

StatusDescription
200Success (even if no deployment exists, returns null fields)
401Invalid or missing API key
403Chat does not belong to your team
404Chat not found

Polling Pattern

while true; do
  DEPLOYMENT=$(curl -s https://www.macaly.com/api/chat/$CHAT_ID/deployment \
    -H "Authorization: Bearer macaly_...")

  STATUS=$(echo $DEPLOYMENT | jq -r '.status')
  echo "Status: $STATUS"

  if [[ $STATUS == "READY" ]]; then
    echo "Deployed: $(echo $DEPLOYMENT | jq -r '.url')"
    break
  elif [[ $STATUS == "ERROR" ]]; then
    echo "Failed: $(echo $DEPLOYMENT | jq -r '.error')"
    break
  fi

  sleep 3
done