Create webhook

Creates a new webhook. Restricted to admins only.

Required scopes: WORKSPACE, WEBHOOK_ADD

Resource URL

POST /workspaces/:domain/webhooks

URL Parameters

NameTypeDescription
domain
Required
StringThe workspace domain.

POST Parameters

NameTypeDescription
events
Required
String[]The array of events describing when the webhook will be executed. Can be set of PUSH, EXECUTION_STARTED, EXECUTION_SUCCESSFUL, EXECUTION_FAILED or EXECUTION_FINISHED.
target_url
Required
StringThe URL to which the payload will be sent.
projectsString[]The array of project name IDs from which webhooks will be executed.
secret_keyStringThe value sent in the payload required by the webservice to validate the request.

Example

Request

POST https://api.buddy.works/workspaces/buddy/webhooks

JSON

{
  "target_url": "http://localhost",
  "secret_key": "mysecretkey",
  "projects": ["company-website", "beta-project"],
  "events": [
    "EXECUTION_FAILED"
  ]
}

Sample Response

HTTP

Status: 201 Created
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999

JSON

{
  "url": "https://api.buddy.works/workspaces/buddy/webhooks/2",
  "html_url": "https://app.buddy.works/buddy/webhook/2",
  "id": 2,
  "target_url": "http://localhost",
  "secret_key": "mysecretkey",
  "projects": ["company-website", "beta-project"],
  "events": [
    "EXECUTION_FAILED"
  ]
}