Webhooks API Documentation
Webhook
Represents a subscription to a topic for changes within a business. Franchises will be automatically notified of changes in all franchisees provided the franchise has created a webhook with a relevant topic. Every
The subscription endpoint conforms to JSON API version 1.0.
GET /api/v3/webhooks
Returns all webhooks created by an account and scoped by the subdomain.
REQUEST
$ curl https://mybiz.pike13.com/api/v3/webhooks \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": [
{
"id": "2",
"type": "webhooks",
"links": {
"self": "http://mybiz.pike13.com/api/v3/webhooks/2"
},
"attributes": {
"account_id": 1,
"business_id": 2,
"topic": "person.created",
"target": "https://target.example.com",
"name": "New Client",
"description": "Webhook for integration with my other service"
}
}
]
}
GET /api/v3/webhooks/:id
Returns a specific webhook.
POST /api/v3/webhooks
Create a webhook.
| Required Attributes | ||
|---|---|---|
| topic | string | Must be a valid topic. |
| target | https url | An endpoint for Pike13 servers to POST a payload to. |
| Optional Attributes | ||
|---|---|---|
| name | string | A name for the webhook. |
| description | string | Description. |
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v3/webhooks \
-H 'Authorization: Bearer XXXXXX' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "webhooks",
"attributes": {
"target": "https://target.example.com",
"topic": "person.created"
}
}
}'
RESPONSE
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "5",
"type": "webhooks",
"links": {
"self": "https://mybiz.pike13.com/api/v3/webhooks/5"
},
"attributes": {
"account_id": 1,
"business_id": 2,
"topic": "person.created",
"target": "https://target.example.com",
"name": null,
"description": null
}
}
}
PATCH /api/v3/webhooks/:id
Update a specific webhook.
REQUEST
$ curl -X PATCH https://mybiz.pike13.com/api/v3/webhooks/2 \
-H 'Authorization: Bearer XXXXXX' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"id": "2",
"type": "webhooks",
"attributes": {
"target": "https://other.target.com"
}
}
}'
RESPONSE
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "2",
"type": "webhooks",
"links": {
"self": "https://mybiz.pike13.com/api/v3/webhooks/2"
},
"attributes": {
"account_id": 1,
"business_id": 2,
"topic": "person.created",
"target": "https://other.target.com",
"name": null,
"description": null
}
}
}
DELETE /api/v3/webhooks/:id
Deletes a specific webhook.
REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v3/webhooks/2 \
-H 'Authorization: Bearer XXXXXX'
RESPONSE
HTTP/1.1 204 No Content