Skip to content

Deployments API

Deployment auslösen

GET /deploy?uuid={app-uuid}&force={true|false}
POST /deploy

Startet ein neues Deployment für die angegebene Anwendung.

ParameterTypBeschreibung
uuidstringUUID der Anwendung
forcebooleantrue: Cache ignorieren, vollständigen Rebuild erzwingen
Terminal window
# 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.

Terminal window
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.

Terminal window
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}/cancel

Bricht ein aktuell laufendes Deployment ab. Hat keinen Effekt auf bereits abgeschlossene Deployments.

Terminal window
curl -s -X POST \
https://coolai.btc-ag.cloud/api/v1/deployments/<deployment-uuid>/cancel \
-H "Authorization: Bearer $COOLIFY_TOKEN"

Deployment-Status-Übersicht

StatusBeschreibung
queuedIn der Warteschlange
in_progressBuild oder Deploy läuft gerade
finishedErfolgreich abgeschlossen
failedFehlgeschlagen
cancelledManuell abgebrochen

Polling-Pattern

Für automatisierte Workflows, die auf den Abschluss eines Deployments warten müssen:

Terminal window
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 pollen
while 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 10
done