Webhook Management API
  • 13 Apr 2021
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Webhook Management API

  • Dark
    Light
  • PDF

Article Summary

The Webhook API offers a simple mechanism for creating, modifying, and deleting webhooks in ProGet.

This API endpoint should be used instead of the Native API Methods when possible, as they are much easier to use and will likely not change.

For security and simplicity, these endpoints require that an API Key is created and passed into each request.

Webhook Object Data Specification

PropertyFormat
nameA string of the user-defined name of the webhook.
idAn integer of the system-assigned webhook Id
feedIdAn integer that the webhook is associated with, or null if the webhook applies to all feeds
urlA string containing the URL that the webhook will interact with when the event occurs.
eventA string of the event to listen to; one of: added, promoted, deployed, deleted, or purged
conditionA string containing the predicate expression that will be evaluated prior to running, or null if the webhook should always fire
payloadAn object with the following properties:
  • method - a string of the type of HTTP request to be sent; one of GET, DELETE, POST, PUT, HEAD, OPTIONS, or PATCH
  • headers - an object with properties representing key/value pairs of the headers to be sent with the request; the values of these properties must be string
  • content - a string that will be sent as the body of the request

List Webhooks Endpoint

GET /api/webhooks/list?key=«api-key»[&feedId=«feed-id»]

Lists webhooks, optionally filtering by feed. This endpoint returns a status of 200 (on success) or 403 (invalid key).

On success, an array of Webhooks objects will be returned, filtered by the specified feed id.

Delete Webhook Endpoint

DELETE or POST /api/webhooks/delete?key=«api-key»&id=«webhook-id»

Deletes the specified webhook. This endpoint returns a status of 200 (success), 400 (invalid webhook id), 403 (invalid key).

On success, the webhook is deleted.

Create Webhook Endpoint

PUT or POST /api/webhooks/create?key=«api-key»

Creates a webhook based on the webhook JSON object specified in the body of the request. Note that if you supply a id property in the webhook object, it will be ignored and a new webhook will be created. This endpoint returns a status of 201 (on success), 400 (invalid webhook object), or 403 (invalid key).

On success, the specified Webhook will be created, and the system-assigned webhook id will be written to the body of the request.

Edit Webhook Endpoint

PUT or PATCH or POST /api/webhooks/edit?key=«api-key»[&id=«webhook-id»]

Updates properties of a webhook based on properties specified in a webhook JSON object sent as the body of the request. A webhook id must be specified, either in the query string or as an id property in the webhook object. This endpoint returns a status of 200 (on success), 400 (invalid webhook object), 404 (id not found), or 403 (invalid key).

On success, the properties specified for the webhook will be updated.


Was this article helpful?