Deployments API
Manage and trigger deployment webhooks via the API.
List deployments
GET /api/v1/apps/:app_slug/deployments
Returns all deployment targets configured for the app.
curl -H "Authorization: Bearer $TOKEN" \
http://localhost:3000/api/v1/apps/my-app/deployments
Response:
[
{
"name": "Production",
"slug": "production",
"webhook_url": "https://api.example.com/hooks/deploy",
"include_drafts": false,
"auto_deploy": true,
"debounce_seconds": 300
}
]
Trigger a deployment
POST /api/v1/apps/:app_slug/deployments/:slug/fire
Fires the webhook for the specified deployment target. Requires editor role or above.
Example
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
http://localhost:3000/api/v1/apps/my-app/deployments/production/fire
Responses
Success:
{
"status": "triggered"
}
Deployment not found:
404 Not Found
{
"error": "Deployment not found"
}
Webhook endpoint returned an error:
502 Bad Gateway
{
"error": "Webhook returned HTTP 500"
}
Content publish/unpublish
Individual content entries can be published or unpublished via the API:
POST /api/v1/apps/:app_slug/content/:schema_slug/:entry_id/publish
POST /api/v1/apps/:app_slug/content/:schema_slug/:entry_id/unpublish
# Publish an entry
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
http://localhost:3000/api/v1/apps/my-app/content/blog-posts/my-post/publish
# Unpublish an entry
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
http://localhost:3000/api/v1/apps/my-app/content/blog-posts/my-post/unpublish
Publish response:
{
"status": "published",
"entry_id": "my-post"
}
Unpublish response:
{
"status": "draft",
"entry_id": "my-post"
}
See Deployments for details on how deployment webhooks work.