<< Back to GForge REST API

Entity: Eventsubscription

GET

getEventsubscription

Returns a paged list of subscriptions, or a single subscription by id.

Parameters (4)

Name Type Description
id int Route parameter — subscription ID for single lookup. Optional.
project_id int Filter by project ID. Pass the string "null" for site-wide. Optional.
page_num int Zero-based page index (decremented automatically by the API entry point).
page_size int Records per page. Default 20.

Return: array

Single subscription array or list of subscription arrays.

POST

postEventsubscription

Creates or updates an event subscription.

Parameters (9)

Name Type Description
id int Route or body parameter — 0 or absent to create. Optional.
name string Display name for the subscription. Required on create.
enabled bool Whether the subscription fires. Default true. Optional.
event_pattern string Glob pattern, e.g. "scm.*" or "scm.push.created". Required.
action_type string Must be "webhook" in v1. Required.
action_config array Action-type-specific config. For webhooks: {"url": "…"}. Required.
retry_policy array Override the event's default retry/backoff. Optional.
retention_days int Days to keep delivery rows. Default 30. Optional.
regenerate_secret bool Rotate the HMAC secret (update only). Optional.

Return: array

Associative array with `location` key; also contains `secret` on create/regen.

PUT

DELETE

deleteEventsubscription

Deletes a subscription and cascades to its delivery rows.

Parameters (1)

Name Type Description
id int Route parameter — subscription ID. Required.

Return: array

Empty array on success.