Webhooks
Note
This page is about how to modify webhook settings themselves through the REST API. If you just want to know how webhooks work, go here: Webhooks
Resource description
The webhook resource contains the following public fields:
Field |
Type |
Description |
|---|---|---|
id |
integer |
Internal ID of the webhook |
enabled |
boolean |
If |
target_url |
string |
The URL to call |
all_events |
boolean |
If |
limit_events |
list of strings |
If |
action_types |
list of strings |
A list of action type filters that limit the notifications sent to this webhook. See below for valid values |
The following values for action_types are valid with eventyay core:
eventyay.event.order.placed
eventyay.event.order.placed.require_approval
eventyay.event.order.paid
eventyay.event.order.canceled
eventyay.event.order.reactivated
eventyay.event.order.expired
eventyay.event.order.modified
eventyay.event.order.contact.changed
eventyay.event.order.changed.*
eventyay.event.order.refund.created.externally
eventyay.event.order.approved
eventyay.event.order.denied
eventyay.event.checkin
eventyay.event.checkin.reverted
eventyay.event.added
eventyay.event.changed
eventyay.event.deleted
eventyay.subevent.added
eventyay.subevent.changed
eventyay.subevent.deleted
Installed plugins might register more valid values.
Endpoints
- GET /api/v1/organizers/(organizer)/webhooks/
Returns a list of all webhooks within a given organizer.
Example request:
GET /api/v1/organizers/bigevents/webhooks/ HTTP/1.1 Host: eventyay.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "count": 1, "next": null, "previous": null, "results": [ { "id": 2, "enabled": true, "target_url": "https://httpstat.us/200", "all_events": false, "limit_events": ["democon"], "action_types": ["eventyay.event.order.modified", "eventyay.event.order.changed.*"] } ] }
- Query Parameters:
page (integer) – The page number in case of a multi-page result set, default is 1
- Parameters:
organizer – The
slugfield of the organizer to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to view this resource.
- GET /api/v1/organizers/(organizer)/webhooks/(id)/
Returns information on one webhook, identified by its ID.
Example request:
GET /api/v1/organizers/bigevents/webhooks/1/ HTTP/1.1 Host: eventyay.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "id": 2, "enabled": true, "target_url": "https://httpstat.us/200", "all_events": false, "limit_events": ["democon"], "action_types": ["eventyay.event.order.modified", "eventyay.event.order.changed.*"] }
- Parameters:
organizer – The
slugfield of the organizer to fetchid – The
idfield of the webhook to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to view this resource.
- POST /api/v1/organizers/(organizer)/webhooks/
Creates a new webhook
Example request:
POST /api/v1/organizers/bigevents/webhooks/ HTTP/1.1 Host: eventyay.com Accept: application/json, text/javascript Content-Type: application/json { "enabled": true, "target_url": "https://httpstat.us/200", "all_events": false, "limit_events": ["democon"], "action_types": ["eventyay.event.order.modified", "eventyay.event.order.changed.*"] }
Example response:
HTTP/1.1 201 Created Vary: Accept Content-Type: application/json { "id": 3, "enabled": true, "target_url": "https://httpstat.us/200", "all_events": false, "limit_events": ["democon"], "action_types": ["eventyay.event.order.modified", "eventyay.event.order.changed.*"] }
- Parameters:
organizer – The
slugfield of the organizer to create a webhook for
- Status Codes:
201 Created – no error
400 Bad Request – The webhook could not be created due to invalid submitted data.
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to create this resource.
- PATCH /api/v1/organizers/(organizer)/webhooks/(id)/
Update a webhook. You can also use
PUTinstead ofPATCH. WithPUT, you have to provide all fields of the resource, other fields will be reset to default. WithPATCH, you only need to provide the fields that you want to change.You can change all fields of the resource except the
idfield.Example request:
PATCH /api/v1/organizers/bigevents/webhooks/1/ HTTP/1.1 Host: eventyay.com Accept: application/json, text/javascript Content-Type: application/json Content-Length: 94 { "enabled": false }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "id": 1, "enabled": false, "target_url": "https://httpstat.us/200", "all_events": false, "limit_events": ["democon"], "action_types": ["eventyay.event.order.modified", "eventyay.event.order.changed.*"] }
- Parameters:
organizer – The
slugfield of the organizer to modifyid – The
idfield of the webhook to modify
- Status Codes:
200 OK – no error
400 Bad Request – The webhook could not be modified due to invalid submitted data
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to change this resource.
- DELETE /api/v1/organizers/(organizer)/webhook/(id)/
Delete a webhook. Currently, this will not delete but just disable the webhook.
Example request:
DELETE /api/v1/organizers/bigevents/webhooks/1/ HTTP/1.1 Host: eventyay.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 204 No Content Vary: Accept
- Parameters:
organizer – The
slugfield of the organizer to modifyid – The
idfield of the webhook to delete
- Status Codes:
204 No Content – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to delete this resource.