API Reference background-services

Create a service

POST/projects/{project_id}/services/

Create a background service — a script that reacts to project-status changes.

Parameters

Body fieldRequiredDescription
nameyesDisplay name
scriptnoService source — defines the on_change handler
script_languagenopython (default) or typescript
descriptionnoWhat this service reacts to
workspace_idnoWorkspace the handler runs against
docker_image_idnoCustom environment for the handler
trigger_storesnoStatus-store names to watch; empty reacts to every store
enablednoReaction on/off (default true)

Request

curl -X POST "$ALLYBUILD_API_URL/projects/$PROJECT_ID/services/" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json"
  -d '{
    "name": "deploy-watcher",
    "script_language": "python",
    "script": "def on_change(mutation, state):\n    ...",
    "trigger_stores": ["project_status_deploy"]
  }'