<< 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: \EventSubscriptionBasic|\EventSubscriptionBasic[]

Single subscription record, or list of subscription records.

POST

postEventsubscription

Creates or updates an event subscription.

Parameters (8)

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.

Return: array

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

postSecret

Rotates the HMAC secret for an existing subscription. Takes no body — unlike postEventsubscription(), it does not require or touch any of the subscription's other fields.

Parameters (1)

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

Return: \EventSubscriptionBasic

The updated subscription, including the one-time raw `secret`.

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.