cURL
curl -X DELETE 'https://api.sesamehr.com/schedule/v1/vacation-calendars/a3d4e5f6-1234-5678-9abc-def012345678/days-off' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-d '{
"dayOffIds": [
"b4c5d6e7-2345-6789-0abc-def123456789",
"c5d6e7f8-3456-7890-1bcd-ef2345678901"
]
}'import requests
url = "https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off"
payload = { "dayOffIds": ["b4c5d6e7-2345-6789-0abc-def123456789"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dayOffIds: ['b4c5d6e7-2345-6789-0abc-def123456789']})
};
fetch('https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'dayOffIds' => [
'b4c5d6e7-2345-6789-0abc-def123456789'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off"
payload := strings.NewReader("{\n \"dayOffIds\": [\n \"b4c5d6e7-2345-6789-0abc-def123456789\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dayOffIds\": [\n \"b4c5d6e7-2345-6789-0abc-def123456789\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dayOffIds\": [\n \"b4c5d6e7-2345-6789-0abc-def123456789\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": "",
"meta": {
"currentPage": 1,
"lastPage": 1,
"total": 1,
"perPage": 1
}
}Vacation Calendars
Delete Days Off from Vacation Calendar
Removes one or more days off from a specific vacation calendar.
Overview
This endpoint allows authorized users to delete multiple days off in a single request by providing an array of day off IDs.
Important Behavior
- Atomic Operation: The deletion is atomic - if any validation fails, no days off will be deleted. This ensures data consistency.
- Ownership Validation: Each day off ID must belong to the specified vacation calendar. Days off that exist but belong to a different calendar will cause the entire operation to fail.
- Empty Response: On success, the endpoint returns an empty response with HTTP 200 status code.
DELETE
/
schedule
/
v1
/
vacation-calendars
/
{id}
/
days-off
cURL
curl -X DELETE 'https://api.sesamehr.com/schedule/v1/vacation-calendars/a3d4e5f6-1234-5678-9abc-def012345678/days-off' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-d '{
"dayOffIds": [
"b4c5d6e7-2345-6789-0abc-def123456789",
"c5d6e7f8-3456-7890-1bcd-ef2345678901"
]
}'import requests
url = "https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off"
payload = { "dayOffIds": ["b4c5d6e7-2345-6789-0abc-def123456789"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dayOffIds: ['b4c5d6e7-2345-6789-0abc-def123456789']})
};
fetch('https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'dayOffIds' => [
'b4c5d6e7-2345-6789-0abc-def123456789'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off"
payload := strings.NewReader("{\n \"dayOffIds\": [\n \"b4c5d6e7-2345-6789-0abc-def123456789\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dayOffIds\": [\n \"b4c5d6e7-2345-6789-0abc-def123456789\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{region}.sesametime.com/schedule/v1/vacation-calendars/{id}/days-off")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dayOffIds\": [\n \"b4c5d6e7-2345-6789-0abc-def123456789\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": "",
"meta": {
"currentPage": 1,
"lastPage": 1,
"total": 1,
"perPage": 1
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier (UUID v4) of the vacation calendar from which days off will be deleted.
Requirements:
- Must be a valid UUID v4 format
- The calendar must exist in the system
- The authenticated user must have permission to modify this calendar
Body
application/json
Request body containing the array of day off IDs to be deleted from the vacation calendar.
Note: All day off IDs must belong to the vacation calendar specified in the path parameter.
Array of day off UUIDs to remove from the vacation calendar.
Validation Rules:
- Must be an array (can be empty)
- Each element must be a valid UUID v4 string
- Each UUID must correspond to an existing day off in the system
- Each day off must belong to the vacation calendar specified in the path parameter
Behavior:
- Empty arrays are allowed and result in no changes
- Order of IDs does not affect the operation
Unique identifier (UUID v4) of the day off to delete
Example:
[
"b4c5d6e7-2345-6789-0abc-def123456789",
"c5d6e7f8-3456-7890-1bcd-ef2345678901"
]
Was this page helpful?