Skip to the content
Forge

Triggers

Git triggers that start a template or flow on pushes, tags and pull requests.

Every path is under /api/v1; see the API for authenticating, errors and rate limits, and the schemas for the bodies.

The template's Git triggers by name (project:read)

GET /api/v1/templates/{template}/triggers

Parameter In Description
template path ID
project_id query ID: The project whose triggers of it to list; required for an organization template.

Answers:

  • 200: OK, object with the fields below
Field Type Description
triggers array of Trigger, required

Errors: 400, 404 (how errors look).

Start runs of a template on Git events (trigger:write)

POST /api/v1/templates/{template}/triggers

An organization has at most its triggers quota (default 50).

Parameter In Description
template path ID

Body (application/json): TriggerInput.

Answers:

Errors: 400, 403, 404, 409, 422 (how errors look).

The project's Git triggers by name (project:read)

GET /api/v1/projects/{project}/triggers

Parameter In Description
project path ID

Answers:

  • 200: OK, object with the fields below
Field Type Description
triggers array of Trigger, required

Errors: 403, 404 (how errors look).

Start runs of a repository run file on Git events (trigger:write)

POST /api/v1/projects/{project}/triggers

The trigger reads file_path at each event's commit; it takes no params. A missing or invalid file is a failed fire with the reason. An organization has at most its triggers quota (default 50).

Parameter In Description
project path ID

Body (application/json): TriggerInput.

Answers:

Errors: 400, 403, 404, 409, 422 (how errors look).

A Git trigger (project:read)

GET /api/v1/triggers/{trigger}

Parameter In Description
trigger path ID

Answers:

Errors: 404 (how errors look).

Replace a Git trigger's settings (trigger:write)

PUT /api/v1/triggers/{trigger}

Parameter In Description
trigger path ID

Body (application/json): TriggerInput.

Answers:

Errors: 400, 403, 404, 409, 422 (how errors look).

Delete a Git trigger and its fire history; its runs stay (trigger:write)

DELETE /api/v1/triggers/{trigger}

Parameter In Description
trigger path ID

Answers:

  • 204: Deleted

Errors: 403, 404 (how errors look).

A Git trigger's latest fires, newest first (project:read)

GET /api/v1/triggers/{trigger}/fires

Parameter In Description
trigger path ID
limit query integer

Answers:

  • 200: OK, object with the fields below
Field Type Description
fires array of TriggerFire, required

Errors: 400, 404 (how errors look).

Start the trigger's template or file on a branch or tag (trigger:write and the right to grant its service account's role)

POST /api/v1/triggers/{trigger}/runs

Resolves the ref to its commit through GitHub or GitLab and starts the template's latest version, or the repository file at the commit, as the trigger's service account, with event manual and the caller as the Git actor. Works while the trigger is disabled; its filters don't apply. Recorded in the trigger's fires. A flow file starts a flow run, which is returned instead of a run (it has steps).

Parameter In Description
trigger path ID

Body (application/json): TriggerRunInput.

Answers:

Errors: 400, 403, 404, 422, 502 (how errors look).

The stored flow's Git triggers by name (project:read)

GET /api/v1/flows/{flow}/triggers

Parameter In Description
flow path ID

Answers:

  • 200: OK, object with the fields below
Field Type Description
triggers array of Trigger, required

Errors: 404 (how errors look).

Start flow runs of a stored flow on Git events (trigger:write)

POST /api/v1/flows/{flow}/triggers

Each matching event starts the flow's latest version as a flow run at the commit, reported as one check. A stored flow's trigger takes params, but no file_path or secrets: the flow is edited with flow:write, so it names its own secrets. An organization has at most its triggers quota (default 50).

Parameter In Description
flow path ID

Body (application/json): TriggerInput.

Answers:

Errors: 400, 403, 404, 409, 422 (how errors look).