Channex.io
Search…
Webhook Collection
You can create Webhooks to be notified about any changes of the property's ARI or about booking and some OTA specific webhooks. Webhooks are Push-notifications. When any changes happens, we send a POST request with JSON payload to the provided endpoint.
Webhook UI
We have an UI available to view, add and edit webhooks also so you can lessen your development efforts if you wish to manually set up instead of via API.

List of webhook events available

  • ari
This will send you any ARI changes like changed availability or prices, useful if you allow users to change ARI in the Channex interface or mobile app and also to integrate any RM system
  • booking
If you wish to get all booking changes then this is the one, you will get notification for any booking revision new, modified and cancelled.
  • booking_unmapped_room
This will let you know if any bookings were created which were not mapped
  • booking_unmapped_rate
Similar to unmapped room but this means room is mapped but rate is not
  • message
If you use the messaging API this is required to push messages to you in real time
  • sync_error
You can see any sync errors on your dashboard
  • reservation_request
Airbnb specific, You can see a reservation request and can accept or deny
  • alteration_request
Airbnb specific, You can see a alteration request and can accept or deny

Webhooks List

Retrieve a list of Webhooks associated with users Properties.
Request
Success Response
Error Response
Request:
1
GET https://staging.channex.io/api/v1/webhooks
Copied!
Success Response Example
Status Code: 200 OK
1
{
2
"data": [
3
{
4
"id": "a9a88747-767e-458c-99e0-9212fcfb0b39",
5
"type": "webhook",
6
"attributes": {
7
"request_params": null,
8
"headers": null,
9
"is_active": true,
10
"send_data": true,
11
"id": "a9a88747-767e-458c-99e0-9212fcfb0b39",
12
"event_mask": "*",
13
"callback_url": "https://YOUR-WEBSITE.COM/api/push_message"
14
},
15
"relationships": {
16
"property": {
17
"data": {
18
"type": "property",
19
"id": "716305c4-561a-4561-a187-7f5b8aeb5920"
20
}
21
}
22
}
23
}
24
],
25
"meta": {
26
"page": 1,
27
"total": 1,
28
"limit": 10
29
}
30
}
Copied!
Unauthorised Error Response
Status Code: 401 Unauthorized
1
{
2
"errors": {
3
"code": "unauthorized",
4
"title": "Unauthorized"
5
}
6
}
Copied!

Pagination

By default, this method returns the first 10 elements. To get more details, you should use Pagination arguments. Information about count of entities and current pagination position contained at meta section at response object.

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a list of Webhook objects in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.

Get Webhook by ID

Retrieve specific webhook associated with User by ID.
Request
Success Response
Error Response
Request:
1
GET https://staging.channex.io/api/v1/webhooks/:id
Copied!
Success Response Example
Status Code: 200 OK
1
{
2
"data": {
3
"id": "a9a88747-767e-458c-99e0-9212fcfb0b39",
4
"type": "webhook",
5
"attributes": {
6
"request_params": null,
7
"headers": null,
8
"is_active": true,
9
"send_data": true,
10
"id": "a9a88747-767e-458c-99e0-9212fcfb0b39",
11
"event_mask": "*",
12
"callback_url": "https://YOUR-WEBSITE.COM/api/push_message"
13
},
14
"relationships": {
15
"property": {
16
"data": {
17
"type": "property",
18
"id": "716305c4-561a-4561-a187-7f5b8aeb5920"
19
}
20
}
21
}
22
}
23
}
Copied!
Unauthorised Error Response
Status Code: 401 Unauthorized
1
{
2
"errors": {
3
"code": "unauthorized",
4
"title": "Unauthorized"
5
}
6
}
Copied!
Not Found Error Response
Status Code: 404 Not Found
1
{
2
"errors": {
3
"code": "resource_not_found",
4
"title": "Resource Not Found"
5
}
6
}
Copied!

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Webhook object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided or User not have access to requested Webhook.
Not Found Error Method can return a Not Found Error result with 404 Not Found HTTP Code if Webhook with provided ID is not exists.

Create Webhook

Create a new Webhook.
Request
Success Response
Error Response
Request:
1
POST https://staging.channex.io/api/v1/webhooks
Copied!
Query body (JSON):
1
{
2
"webhook": {
3
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
4
"callback_url": "https://YOUR-WEBSITE.COM/api/push_message",
5
"event_mask": "*",
6
"request_params": {},
7
"headers": {},
8
"is_active": true,
9
"send_data": true
10
}
11
}
Copied!
Success Response Example
Status Code: 201 Created
1
{
2
"data": {
3
"type": "webhook",
4
"id": "227d4b09-7eef-4c7e-bc72-44c0c40b5299",
5
"attributes": {
6
"request_params": {},
7
"headers": {},
8
"is_active": true,
9
"send_data": true,
10
"id": "227d4b09-7eef-4c7e-bc72-44c0c40b5299",
11
"event_mask": "*",
12
"callback_url": "https://website.com/api/push_message"
13
},
14
"relationships": {
15
"property": {
16
"data": {
17
"type": "property",
18
"id": "52397a6e-c330-44f4-a293-47042d3a3607"
19
}
20
}
21
}
22
}
23
}
Copied!
Unauthorised Error Response
Status Code: 401 Unauthorized
1
{
2
"errors": {
3
"code": "unauthorized",
4
"title": "Unauthorized"
5
}
6
}
Copied!
Validation Error Response
Status Code: 422 Unprocessable Entity
1
{
2
"errors": {
3
"code": "validation_error",
4
"title": "Validation Error",
5
"details": {
6
"property_id": [
7
"can't be blank"
8
]
9
}
10
}
11
}
Copied!

Fields

property_id [required]
String with valid UUID of Property object what you would like to associate with created Webhook.
callback_url [required]
Valid URL address. Note: This URL will be called via POST request when trigger event is happened.
event_mask [required]
Non-empty string with event mask. Take a look a list of supported webhook events at List of webhook events section. For ari event event mask support filtering by restriction, room type id and rate plan id. In that case, event mask should looks like: event:restrictions:room_type_ids:rate_plan_ids where restrictions, room_type_ids and rate_plan_ids can contain several comma separated values. Real example to listen rate changes at Rate Plan with ID equal to 96a44e07-2158-43e4-8baa-8f6f56922ba8: ari:rate:*:96a44e07-2158-43e4-8baa-8f6f56922ba8
request_params [optional]
JSON Object with specific GET arguments for query.
headers [optional]
JSON Object with request headers. Note: If you would like use URL endpoint protected via authentication, you can define request headers at this field. Example:{"Authorization": "Basic user:password"}
is_active [optional]
Boolean value. Note: This field represent active status of Webhook. Only Webhooks with is_active field equal to true value can receive notifications. Receive false as default value.
send_data [optional]
Boolean value. Note: This field is a flag to send payload data in push callback. If value is false we are call callback url without any information about changes. Receive false as default value.

Returns

Success Method can return a Success result with 201 Created HTTP Code if operation is successful. Will contain a Webhook object in the answer.
Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Validation Error Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.

Update Webhook

Update a Webhook.
Request
Success Response
Error Response
Request:
1
PUT https://staging.channex.io/api/v1/webhooks/:id
Copied!
Query body (JSON):
1
{
2
"webhook": {
3
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
4
"callback_url": "https://YOUR-WEBSITE.COM/api/push_message",
5
"event_mask": "ari",
6
"request_params": {},
7
"headers": {},
8
"is_active": true,
9
"send_data": true
10
}
11
}
Copied!
Success Response Example
Status Code: 200 OK
1
{
2
"data": {
3
"type": "webhook",
4
"id": "227d4b09-7eef-4c7e-bc72-44c0c40b5299",
5
"attributes": {
6
"request_params": {},
7
"headers": {},
8
"is_active": true,
9
"id": "227d4b09-7eef-4c7e-bc72-44c0c40b5299",
10
"event_mask": "ari",
11
"callback_url": "https://website.com/api/push_message"
12
},
13
"relationships": {
14
"property": {
15
"data": {
16
"type": "property",
17
"id": "52397a6e-c330-44f4-a293-47042d3a3607"
18
}
19
}
20
}
21
}
22
}
Copied!
Unauthorised Error Response
Status Code: 401 Unauthorized
1
{
2
"errors": {
3
"code": "unauthorized",
4
"title": "Unauthorized"
5
}
6
}
Copied!
Not Found Error
Status Code: 404 Not Found
1
{
2
"errors": {
3
"code": "resource_not_found"
4
"title": "Resource Not Found"
5
}
6
}
Copied!
Validation Error Response
Status Code: 422 Unprocessable Entity
1
{
2
"errors": {
3
"code": "validation_error",
4
"title": "Validation Error",
5
"details": {
6
"property_id": [
7
"can't be blank"
8
]
9
}
10
}
11
}
Copied!

Fields

This method use same fields as Create Webhook method.

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Webhook object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Not Found Error Method can return a Not Found Error result with 404 Not Found HTTP Code if Webhook with provided ID is not present at system.
Validation Error Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.

Remove Webhook

Remove a Webhook.
Request
Success Response
Error Response
Request:
1
DELETE https://staging.channex.io/api/v1/webhooks/:id
Copied!
Success Response Example
Status Code: 200 OK
1
{
2
"meta": {
3
"message": "Success"
4
}
5
}
Copied!
Unauthorised Error Response
Status Code: 401 Unauthorized
1
{
2
"errors": {
3
"code": "unauthorized",
4
"title": "Unauthorized"
5
}
6
}
Copied!
Not Found Error
Status Code: 404 Not Found
1
{
2
"errors": {
3
"code": "resource_not_found"
4
"title": "Resource Not Found"
5
}
6
}
Copied!

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Meta object with message in the answer.
Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Not Found Error Method can return a Not Found Error result with 404 Not Found HTTP Code if Webhook with provided ID is not present at system.

Test Webhook

Test a Webhook by sending test query to your endpoint.
Request
Response
Request:
1
POST https://staging.channex.io/api/v1/webhooks/test
Copied!
Query body (JSON):
1
{
2
"webhook": {
3
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
4
"callback_url": "https://YOUR-WEBSITE.COM/api/push_message",
5
"event_mask": "*",
6
"request_params": {},
7
"headers": {},
8
"is_active": true,
9
"send_data": true
10
}
11
}
Copied!
Success Response Example
Status Code: 200 OK
1
{
2
"status_code": 200,
3
"body": "{\n \"success\": true\n}"
4
}
Copied!

Returns

Success Method can return a Success result with 200 OK HTTP Code with body and status code of request results to your endpoint.

Payloads

No Data Version

The message is provided to the provided webhook endpoint, depending on the webhook settings (send_data). If send_data is true, Channex will push the message payload, if false message payload will be removed and target endpoint will only receive event, user_id and property_id fields.
1
{
2
"event": "booking_new",
3
"property_id": "90958ec0-9214-4796-873e-4add0d834670",
4
"user_id": null,
5
"timestamp": "2021-12-24T00:00:00.0000Z"
6
}
Copied!

ARI (Availability, Rates & Restrictions)

Triggered when any changes have happened at the property State or inventory table. We provide information about changed prices, restrictions and availability.
Note: We have included the user ID of who generated the changes, this can be useful if you would like to ignore changes made by your own app.
1
{
2
"event": "ari",
3
"payload": [
4
{
5
"availability": 5,
6
"booked": 7,
7
"date": "2021-12-02",
8
"rate_plan_id": "04c607e4-644d-45ea-ab1a-da920ee36e50",
9
"room_type_id": "27e24739-239c-4619-9c30-0dc390f5d7ac",
10
"stop_sell": false
11
}
12
],
13
"property_id": "90958ec0-9713-1196-873e-4add0d834670",
14
"user_id": null,
15
"timestamp": "2021-12-24T00:00:00.0000Z"
16
}
Copied!

Booking

Triggered when Channex receives a booking revision (New, Cancelled or Modified).
1
{
2
"event": "booking",
3
"payload": {
4
"booking_id": "e10de9d1-3e2c-431c-b88c-ffca9ed5db5d",
5
"property_id": "90958ec0-9713-1196-873e-4add0d834670",
6
"revision_id": "80b3b60c-5e24-35c5-ad1b-da67cd704093"
7
},
8
"property_id": "90958ec0-9713-1396-873e-4add0d834670",
9
"user_id": null,
10
"timestamp": "2021-12-24T00:00:00.0000Z"
11
}
Copied!
This event was originally designed to trigger a Pull booking revision operation from the PMS. When this event arrives, we expect the PMS will call api/v1/booking_revisions/:id, to pull the new revision and ack it.
Alternatively the PMS can call the Feed endpoint also to get list of all unack bookings.

Booking Unmapped Room

Triggered when Channex receives a booking revision but can’t map it with existing Room Types. This can happen if the channel is not mapped correctly or if the OTA provides ID which has no mapping.
This event is designed to notify PMS about potential problems at mapping and usually used to trigger notification to support team at PMS side to investigate problems with mapping.
Please, keep in mind, to prevent any potential problems with overbookings, Mapping Issues should be solved in short time-frame and should have high priority.
1
{
2
"event": "booking_unmapped_room",
3
"payload": {
4
"booking_id": "4995a8d5-552b-4d6c-acc5-cc8ca45bd32a",
5
"booking_revision_id": "8a5c7299-611e-4b57-a703-7e146b538750"
6
},
7
"property_id": "a88cdfa3-2e25-1bcc-ab18-2d4f899ca49b",
8
"user_id": null,
9
"timestamp": "2021-12-24T00:00:00.0000Z"
10
}
Copied!

Booking Unmapped Rate

Triggered when Channex receives a booking revision but can’t map it with existing Rate Plans.
This trigger will not come if revision has not mapped Room Type error. Booking Unmapped Room event will mute Booking Unmapped Rate, because when we have no mapped Room it also means rate is not mapped.
This event is designed to notify PMS about potential problems at mapping, but in that case, we can map Room (and correctly process Availability changes), but can’t map to Rate Plan.
1
{
2
"event": "booking_unmapped_rate",
3
"payload": {
4
"booking_id": "4995a8d5-552b-4d6c-acc5-cc8ca45bd32a",
5
"booking_revision_id": "8a5c7299-611e-4b57-a703-7e146b538750"
6
},
7
"property_id": "a88cdfa3-2e25-3bcc-ab18-2d4f899ca49b",
8
"user_id": null,
9
"timestamp": "2021-12-24T00:00:00.0000Z"
10
}
Copied!

Message

Triggered when new chat message from a guest is registered at Channex.
1
{
2
"event": "message",
3
"payload": {
4
"booking_id": "b4671a17-4440-4da4-9c72-f6afa2d61908",
5
"have_attachment": false,
6
"attachments": [],
7
"id": "9d7e25a0-7602-4454-b3c0-a42afad0fde0"
8
"message": "Message content",
9
"message_thread_id": "8a632561-ebd3-4dd6-b669-06f560b4510d",
10
"ota_message_id": "9f157e80-5275-11ec-a8dd-7d6269b894d7"
11
},
12
"property_id": "12da6232-a2db-41ac-ba1c-31c934b91c19",
13
"user_id": null,
14
"timestamp": "2021-12-24T00:00:00.0000Z"
15
}
Copied!

Sync Error

Triggered when sync error has happened at a connected channel.
Originally designed to notify PMS about potential problems at existed connections.
1
{
2
"event": "sync_error",
3
"payload": {
4
"channel": "Agoda"
5
"channel_event_id": "e7883431-3df6-412f-8c07-0d5e1d983e0f"
6
"channel_id": "d691462b-45d1-4655-9076-072210f2ceca"
7
"channel_name": "Agoda"
8
"error_type": "general_error"
9
"property_name": "Hotel Name"
10
},
11
"property_id": "d69a591e-9be3-4822-cc95-7374ed13a673",
12
"user_id": null,
13
"timestamp": "2021-12-24T00:00:00.0000Z"
14
}
Copied!

Reservation Request

Triggered when Channex receives a Reservation Request from Airbnb.
Contains information about requested reservation.
1
{
2
"event": "reservation_request",
3
"payload": {
4
"bms": BOOKING_MESSAGE,
5
"resolved": false
6
},
7
"property_id": "4b70ec18-9ec1-4f77-8408-628b6477e824",
8
"user_id": null,
9
"timestamp": "2021-12-24T00:00:00.0000Z"
10
}
Copied!
Where BOOKING_MESSAGE is structure equal to regular Booking Revision structure.

Webhook message sequence

Before you start any integration with webhooks, you should to know -
Sequence of incoming webhook calls can be different from sequence of events which trigger that calls. Webhooks may come out of order.
Explanation
At property A we have 2 state changes event: Change availability for Room Type A from 0 to 1. Change availability for Room Type A from 1 to 0.
This events triggers 2 webhook calls with ari type. But when Channex sends the first webhook we might catch some network issue at middle level and message failed with a timeout error. This is a temporary error and webhook will be rescheduled. Second webhook had no issues and was sent successfully and would arrive first.
PMS receives webhook #2 with Availability 0. First webhook is queued for 2nd attempt to be sent to the target endpoint and this time all went well and we deliver that webhook.
PMS receive webhook #1 with Availability 1.
As a result, if PMS will interpret incoming results, this can cause problems. Instead use information from payload, we suggest to use webhooks as a trigger to execute logic to pull ARI info from Channex.
So, in case with Availability changes, we suggest instead using data from payload, trigger a pull request to get values for changed dates.