View and manage subscriptions¶
Comments after (//
) are for informational purposes only, and the
example payloads have been clipped for brevity.
View all subscriptions¶
To view existing subscriptions send a GET /api/v0/webhooks
request.
The response depends on your user type:
MSR admins receives every webhook configured for the MSR.
Regular users receive their current subscriptions across every namespace/organization and repository.
Example API response:
[
{
"id": "", // (string): UUID of the webhook subscription
"type": "", // (string): webhook event type
"key": "", // (string): the individual resource this subscription is scoped to
"endpoint": "", // (string): the endpoint to send POST event notifications to
"authorID": "", // (string): the user ID responsible for creating the subscription
"createdAt": "", // (string): JSON-encoded datetime when the subscription was created
},
...
]
View subscriptions for a particular resource¶
To view the subscriptions for a resource you must first have admin rights for that resource. After which, you can send requests for all subscriptions from a particular API endpoint. The response will include data for all resource users.
To view all webhook subscriptions for a repository, run:
GET /api/v0/repositories/{namespace}/{repository}/webhooks
To view all webhook subscriptions for a namespace/organization, run:
GET /api/v0/repositories/{namespace}/webhooks
Delete a subscription¶
You can delete a subscription if you are an MSR repository admin or an admin of the resource associated with the event subscription. Regular users, however, can only delete subscriptions for the repositories they manage.
To delete a webhook subscription, send a DELETE /api/v0/webhooks/{id}
request, replacing {id}
with the ID of the webhook subscription you intend
to delete.