Retrieve the list of reasons
This API retrieves the list of specific reasons that a center's front-desk executives can select from when they cancel a membership, cancel an appointment, or mark a guest as a turnaway.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/reasons
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| page | integer (int32) | No | — | Optional Current page number of the list of reasons that is to be displayed. |
| size | integer (int32) | No | — | Optional Number of records that are to be displayed per page. |
| sort_ascending | boolean | No | — | Optional Indicates whether to sort in ascending order while displaying the reasons. |
| search_text | string | No | — | Optional Retrieves only details that contains the specified search text. |
| row_count | integer (int32) | No | — | Optional Display the total count of rows. |
| auto_sugest | boolean | No | — | Optional Indicates whether auto-suggestions are to be provided. |
| reason_object_type | integer (int32) | No | — | Optional Reason object type. |
| reason_action_type | integer (int32) | No | — | Optional Action object type. |
| is_active | boolean | No | — | Optional Indicates whether the reason is currently active. |
| show_in_online_booking | boolean | No | — | Optional Indicates whether the reason is to be displayed during online cancellations. |
Response
Success (200 OK)
{}
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/reasons' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/reasons', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/reasons',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
"https://api.zenoti.com/v1/reasons");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/reasons')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |