Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Cipi Agent & AI
  3. Webhook & health check

Webhook & health check

The deploy webhook and health endpoint the agent provides.

Cipi Agent & AI

Push-to-deploy webhook#

POST /cipi/webhook verifies the push, checks the branch and drops a trigger file; within a minute the server deploys as the app user. The HTTP answer is instant, and the deploy never runs inside a web request. Full flow: Auto-deploy on push.

ProviderAuthenticationEvent
GitHubX-Hub-Signature-256 (HMAC-SHA256, secret = CIPI_WEBHOOK_TOKEN)push (ping answers pong)
GitLabX-Gitlab-TokenPush Hook
Bitbucket CloudX-Hub-Signature (HMAC)repo:push
Gitea / ForgejoX-Gitea-Signature (HMAC)push
Azure DevOpsX-Gitlab-Token (set by Cipi's service hook)git.push

Only pushes to CIPI_DEPLOY_BRANCH deploy (others answer skipped); other events answer 202 ignored. Get URL and token with cipi deploy myapp --webhook.

Each trigger records what the push claimed (provider, pusher, commit, delivery ID, IP) for the deploy audit:

json
{"source":"github","actor":"octocat","ip":"140.82.115.3","ref":"main@abcdef123456","request_id":"8d2f…"}

Health endpoint#

GET /cipi/health returns the state of app, database, cache, queue, storage and the deploy. Plug it into UptimeRobot, Better Stack, Grafana or a simple cron.

bash
php artisan cipi:generate-token health
curl -H "Authorization: Bearer $CIPI_HEALTH_TOKEN" https://myapp.com/cipi/health
json
{
  "status": "healthy",
  "environment": "production",
  "checks": {
    "app": { "ok": true, "debug": false, "maintenance": false },
    "database": { "ok": true, "driver": "mysql" },
    "cache": { "ok": true, "driver": "database" },
    "queue": { "ok": true, "pending_jobs": 0, "failed_jobs": 0 },
    "storage": { "ok": true, "disk_free_gb": 31.2, "disk_used_percent": 41 },
    "deploy": { "ok": true, "short_commit": "0123456", "in_progress": false,
                "last_deploy": { "status": "ok", "trigger": "webhook", "duration_seconds": 42 } }
  }
}
FieldUse
statusdegraded (HTTP 503) if database, cache, queue or storage fails
checks.queue.failed_jobs / pending_jobsAlert on stuck jobs or backlog
checks.storage.disk_used_percentDisk pressure
checks.deployLive release and commit; a failed last deploy is informational (the previous release is still serving)

Token order: CIPI_HEALTH_TOKEN, then CIPI_WEBHOOK_TOKEN. Disable with php artisan cipi:service health --disable.