Create Webhook

Create a new company webhook (inactive by default)

POSThttps://api.pact.im/api/p2/companies/<COMPANY_ID>/webhooks

Creates a new webhook for the company. Webhook is created inactive by default.

Maximum 5 webhooks per company are allowed.

URL Parameters

ParameterDescription
COMPANY_IDID of the company

Query Parameters

ParameterRequiredValidationsDescription
private_api_tokentrueMust be a stringYOUR_API_TOKEN
urltrueMust be a stringWebhook URL

Example

Request

shell
curl -X POST 'https://api.pact.im/api/p2/companies/COMPANY_ID/webhooks' \
--header 'Content-Type: application/json' \
--data '{
    "private_api_token": YOUR_API_TOKEN,
    "url": "https://example.com/webhook"
  }'

Response

json
{
  "webhook": {
    "id": 1,
    "url": "https://example.com/webhook",
    "active": false
  }
}

Search…

Start typing to search