Setster Webhooks API Documentation - Real-Time Notifications (2.0)
Explore our comprehensive guide to using Setster's Webhooks API. Learn how to set up real-time notifications for your application's events and improve your integration efficiency.
A webhook is an endpoint on your server that receives requests from Setster, notifying you about events that happen on your account, such as an appointment change. Once a webhook is set up, Setster will begin sending data to your server when it's available, with no further requests required as a one-way data sharing mechanism. Webhook events trigger the data to be sent to your server's endpoint via a POST request. In short, webhooks make getting near real-time data changes effortless. If this sounds too complicated, you may be looking to use the Setster Zapier integration instead.
Webhook Event Triggers
Events trigger a webhook to send data to your application. For each Setster webhook, you create you can opt-in to one, multiple, or all events.
The Setster API fires webhooks for the following appointment events:
| Event Name | Related Endpoint |
|---|---|
appointment.created |
Appointment Creation |
appointment.updated |
Appointment Updated |
appointment.deleted |
Appointment Deleted |
appointment.rescheduled |
Appointment Rescheduled |
appointment.reminder |
Appointment Reminder |
appointment.canceled |
Appointment Canceled |
* |
Subscribe to all events |
- Add a public endpoint on your server
- Test your new endpoint
- Configure webhook details
- Create Setster webhook
- Test webhook integration
Add New Endpoint
To set up a webhook, you'll need to add a new publicly accessible endpoint to your server. Setster will send unauthenticated POST requests to this endpoint, which could be written in Ruby, PHP, Node.js, or any server-side language.
Test Your Endpoint
Test that your endpoint is public and can receive POST requests by sending a test request in your terminal or using a request client like Postman.
Configure Webhook Details
An example request body for creating a webhook is structured as follows:
{
"company_id": 24232,
"target_url": "",
"events": [
"appointment.created",
{
"event": "appointment.rescheduled",
"active": 0
}
],
"active": 1
}
In this request body the target_url, company_id, and events array are required and the request must include your session_token retreived from authenticating your Setster API key.
- Register your
target_url. This is the new endpoint you created on your server for Setster to POST event data to. - Enter your
company_id. Your company id is returned from the Authentication request. - Select which events from the list of available events you'd like to be sent to your
target_urland add them to theeventsarray
See Create a Webhook for full the full webhook specification.
Once you've finished editing all of the details you'd like to add to your webhook, you're ready to make a POST request with the /createWebhook Setster endpoint. For sample request code See Create a Webhook.
Test webhook integration
To test your webhook integration, make a test appointment change in the API that would trigger the event type(s) you've added to your webhook(s).
At some point in time, you may need to change your webhook. To do so you'll need to send a PUT request to the /subscribe/{id} endpoint ensuring to update the target_url to your new server endpoint.
0 - 1 - 2 - 3 - 4 - 6 - 8 - 9 - 10 - 11 - checked in 12 - just arrived 13 - delayed
| Status Code | Status Definition |
|---|---|
0 |
Waiting email confirmation from the client |
1 |
Email confirmed but not validated by the admin/provider |
2 |
Email confirmed and validated or paid |
3 |
Declined or canceled |
4 |
Busy time imported from external sources (e.g., Google calendar) |
6 |
Busy time imported from Zapier |
8 |
Completed |
9 |
No show (the scheduled event did not take place) |
10 |
In progress |
11 |
Checked-in |
12 |
Just arrived |
13 |
Delayed |
Webhooks Receive notifications with webhooks Setster offers webhooks to notify your application when an event happens within your account. Webhooks are especially useful for asynchronous events and building workflows within your application. For example, a new appointment is created and triggers a set of customer communications within your application.
List Webhooks
Get a list of created webhooks and their attributes.
Authorizations:
query Parameters
| company_id required | integer <int64> Example: company_id=2345 The unique ID of the account. Account ID. |
| target_url | string <uri> |
| active | integer Enum: 0 1 |
| verification_key | string |
| created_at | string <date-time> |
| updated_at | string <date-time> |
Responses
Request samples
- curl
- Node
- Java
- Ruby
- C#
curl --location --request GET 'https://www.setster.com/api/v2/subscribe?session_token=SESSION_TOKEN&target_url=TARGET_URL&active=ACTIVE&verification_key=VERIFICATION_KEY&created_at=CREATED_AT&updated_at=UPDATED_AT'
Response samples
- 200
{- "statusCode": 0,
- "statusDescriptions": "OK",
- "data": [
- {
- "id": 13425,
- "company_id": 24232,
- "target_url": "",
- "events": [
- {
- "id": 13425,
- "event": "appointment.created",
- "active": 0,
- "created_at": "2019-08-24T14:15:22Z"
}
], - "active": 0,
- "verification_key": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}Create a Webhook
Create a new webhook.
Authorizations:
query Parameters
| company_id required | integer <int64> Example: company_id=2345 The unique ID of the account. Account ID. |
Request Body schema: application/json
| company_id required | integer <int64> Example: "24232" The ID of the company |
| target_url required | string <uri> Default: "" |
Array of strings or objects Example: "appointment.created,[object Object]" The list of events. The currently supported events are:
The " | |
| active | integer Default: 1 Enum: 0 1 |
Responses
Request samples
- Payload
- curl
- Node
- Java
- Ruby
- C#
{- "company_id": 24232,
- "target_url": "",
- "events": [
- "appointment.created",
- {
- "event": "appointment.rescheduled",
- "active": 0
}
], - "active": 0
}Response samples
- 201
{- "statusCode": 0,
- "statusDescriptions": "OK",
- "data": {
- "id": 13425,
- "company_id": 24232,
- "target_url": "",
- "events": [
- {
- "id": 13425,
- "event": "appointment.created",
- "active": 0,
- "created_at": "2019-08-24T14:15:22Z"
}
], - "active": 0,
- "verification_key": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}Get a Webhook
Get the attributes of a specific webhook.
Authorizations:
path Parameters
| id required | integer <int64> WebHook id |
query Parameters
| company_id required | integer <int64> Example: company_id=2345 The unique ID of the account. Account ID. |
Responses
Request samples
- curl
- Node
- Java
- Ruby
- C#
curl --location -g --request GET 'https://www.setster.com/api/v2/subscribe/{id}?session_token=SESSION_TOKEN&id=ID'
Response samples
- 200
{- "statusCode": 0,
- "statusDescriptions": "OK",
- "data": [
- {
- "id": 13425,
- "company_id": 24232,
- "target_url": "",
- "events": [
- {
- "id": 13425,
- "event": "appointment.created",
- "active": 0,
- "created_at": "2019-08-24T14:15:22Z"
}
], - "active": 0,
- "verification_key": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}Modify a Webhook
Modify the attributes for an existing webhook.
Authorizations:
path Parameters
| id required | integer <int64> WebHook id |
query Parameters
| company_id required | integer <int64> Example: company_id=2345 The unique ID of the account. Account ID. |
Request Body schema: application/json
| company_id required | integer <int64> Example: "24232" The ID of the company |
| target_url required | string <uri> Default: "" |
Array of strings or objects Example: "appointment.created,[object Object]" The list of events. The currently supported events are:
The " | |
| active | integer Default: 1 Enum: 0 1 |
Responses
Request samples
- Payload
- curl
- Node
- Java
- Ruby
- C#
{- "company_id": 24232,
- "target_url": "",
- "events": [
- "appointment.created",
- {
- "event": "appointment.rescheduled",
- "active": 0
}
], - "active": 0
}Response samples
- 200
{- "statusCode": 0,
- "statusDescriptions": "OK",
- "data": {
- "id": 13425,
- "company_id": 24232,
- "target_url": "",
- "events": [
- {
- "id": 13425,
- "event": "appointment.created",
- "active": 0,
- "created_at": "2019-08-24T14:15:22Z"
}
], - "active": 0,
- "verification_key": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}Delete a Webhook
Delete an existing webhook.
Authorizations:
path Parameters
| id required | integer <int64> WebHook id |
query Parameters
| company_id required | integer <int64> Example: company_id=2345 The unique ID of the account. Account ID. |
Responses
Request samples
- curl
- Node
- Java
- Ruby
- C#
curl --location -g --request DELETE 'https://www.setster.com/api/v2/subscribe/{id}?session_token=SESSION_TOKEN&id=ID'
Response samples
- 200
{- "statusCode": 0,
- "statusDescriptions": "OK",
- "data": { }
}