Create a recurring room blockout time
Recurring blockout time block the time of the room every day repeatedly. To block a time for the room on the appointment book you can actually create a block out time for that room on the Appointment book whose ID is passed as {{room_id}}.Supply the BlockOutTimeRequest object as a body and call this api to create a blockout time.
send rec_end_date or occurences, but not both while creating a recurring block out time
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
POST /v1/rooms/{room_id}/blockouttimes
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| room_id | string | Yes | Unique identifier of the room. |
Response
Success (201 Created)
{
"block_out_times": [
{
"...": "..."
}
],
"error": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| block_out_times | object[] | |
| block_out_times[].block_out_time_id | string | |
| block_out_times[].employee | object | |
| block_out_times[].room | object | |
| block_out_times[].block_out_time_type | object | |
| block_out_times[].start_time | string | |
| block_out_times[].end_time | string | |
| block_out_times[].start_time_in_center | string | |
| block_out_times[].end_time_in_center | string | |
| block_out_times[].notes | string | |
| block_out_times[].recurring_block_out_time | object | |
| error | object |
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.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 |