Deployments API
Deployment auslösen
GET /deploy?uuid={app-uuid}&force={true|false}POST /deployStartet ein neues Deployment für die angegebene Anwendung.
| Parameter | Typ | Beschreibung |
|---|---|---|
uuid | string | UUID der Anwendung |
force | boolean | true: Cache ignorieren, vollständigen Rebuild erzwingen |
# Standard-Deployment (mit Cache)curl -s "https://coolai.btc-ag.cloud/api/v1/deploy?uuid=<app-uuid>&force=false" \ -H "Authorization: Bearer $COOLIFY_TOKEN"
# Force-Rebuild (kein Cache)curl -s "https://coolai.btc-ag.cloud/api/v1/deploy?uuid=<app-uuid>&force=true" \ -H "Authorization: Bearer $COOLIFY_TOKEN"Response:
{ "deployments": [ { "message": "Application meine-app deployment queued.", "resource_uuid": "<app-uuid>", "deployment_uuid": "deploy-abc123" } ]}Deployment-Historie einer Anwendung
GET /deployments/applications/{app-uuid}Gibt alle Deployments einer Anwendung zurück, neueste zuerst.
curl -s https://coolai.btc-ag.cloud/api/v1/deployments/applications/<app-uuid> \ -H "Authorization: Bearer $COOLIFY_TOKEN" \ | jq '.deployments[] | {deployment_uuid, status, created_at}'Response — kein reines Array, sondern ein Objekt mit count und deployments:
{ "count": 3, "deployments": [ { "deployment_uuid": "deploy-abc123", "status": "finished", "commit": "b2a4ca66...", "created_at": "2026-03-05T20:13:00Z" }, { "deployment_uuid": "deploy-xyz789", "status": "failed", "created_at": "2026-03-05T20:10:00Z" } ]}Einzelnes Deployment abrufen
GET /deployments/{deployment-uuid}Gibt Details und den vollständigen Log eines einzelnen Deployments zurück.
curl -s https://coolai.btc-ag.cloud/api/v1/deployments/<deployment-uuid> \ -H "Authorization: Bearer $COOLIFY_TOKEN"Response:
{ "uuid": "deploy-abc123", "status": "finished", "created_at": "2026-03-05T10:00:00Z", "finished_at": "2026-03-05T10:02:34Z", "logs": "[INFO] Cloning repository...\n[INFO] Building image...\n[INFO] Done."}Laufende Deployments abbrechen
POST /deployments/{deployment-uuid}/cancelBricht ein aktuell laufendes Deployment ab. Hat keinen Effekt auf bereits abgeschlossene Deployments.
curl -s -X POST \ https://coolai.btc-ag.cloud/api/v1/deployments/<deployment-uuid>/cancel \ -H "Authorization: Bearer $COOLIFY_TOKEN"Deployment-Status-Übersicht
| Status | Beschreibung |
|---|---|
queued | In der Warteschlange |
in_progress | Build oder Deploy läuft gerade |
finished | Erfolgreich abgeschlossen |
failed | Fehlgeschlagen |
cancelled | Manuell abgebrochen |
Polling-Pattern
Für automatisierte Workflows, die auf den Abschluss eines Deployments warten müssen:
APP_UUID="<app-uuid>"COOLIFY_TOKEN="<token>"
# Deployment starten und UUID merken (deployment_uuid steckt in .deployments[0])DEPLOY_UUID=$(curl -s \ "https://coolai.btc-ag.cloud/api/v1/deploy?uuid=$APP_UUID&force=false" \ -H "Authorization: Bearer $COOLIFY_TOKEN" \ | jq -r '.deployments[0].deployment_uuid')
echo "Deployment gestartet: $DEPLOY_UUID"
# Status pollenwhile true; do STATUS=$(curl -s \ "https://coolai.btc-ag.cloud/api/v1/deployments/$DEPLOY_UUID" \ -H "Authorization: Bearer $COOLIFY_TOKEN" \ | jq -r '.status')
echo "Status: $STATUS"
if [[ "$STATUS" == "finished" ]]; then echo "Deployment erfolgreich." break elif [[ "$STATUS" == "failed" || "$STATUS" == "cancelled" ]]; then echo "Deployment fehlgeschlagen: $STATUS" exit 1 fi
sleep 10done