Calven
  1. Time off
Calven
  • Overview
  • Key Access Levels
  • Basic Authentication Overview
  • HMAC Authentication Overview
  • SDKs
  • Calven Data Models
  • HMAC Authentication
    • Generate a token with an API key and HMAC
      POST
    • Generate a token with an API key and client secret
      POST
  • Presence
    • Presence Overview
    • Submit presence events with BASIC auth
      POST
    • Submit presence events
      POST
  • Occupancy
    • Occupancy Overview
    • Submit occupancy events
      POST
  • Time off
    • Submit time off updates
      POST
  • Access Credentials
    • Submit access credentials
      POST
  • Warehouse - Basic Auth
    • Warehouse Overview
    • Users
      GET
    • Locations
      GET
    • Desks
      GET
    • Bookings & Attendance
      GET
    • Presence Details
      GET
    • User Actions Log
      GET
  • Warehouse - HMAC Auth
    • Warehouse Overview
    • Users
      GET
    • Locations
      GET
    • Desks
      GET
    • Bookings & Attendance
      GET
    • Presence
      GET
    • User Actions Log
      GET
  1. Time off

Submit time off updates

POST
/v1/timeoff
Time off
Submit time off updates to Calven.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
timeOffEvents
array[object (TimeOffEvent) {7}] 
required
Time off events
eventId
string 
required
Event ID
Example:
C5C69845-DD77-487E-9C6A-708581B361E9
email
string 
optional
Employee’s email address - Required if uid is not present.
Example:
bob@domain.com
uid
string 
optional
Employee’s Calven uid - Required if email is not present.
Example:
ABC123HGbghdhdI
eventType
string 
required
The time off event type. One of 'scheduled' or 'cancelled'
Example:
scheduled
startDate
string 
required
Start date of scheduled or cancelled leave in format yyyy-mm-dd
endDate
string 
required
End date of scheduled or cancelled leave in format yyyy-mm-dd
timeOffType
string 
optional
Type of time off. One of 'holiday', 'leave' or 'sick'
Example
{
    "timeOffEvents": [
        {
            "eventId": "C5C69845-DD77-487E-9C6A-708581B361E9",
            "email": "bob@domain.com",
            "eventType": "scheduled",
            "startDate": "2024-12-30",
            "endDate": "2025-01-02",
            "timeOffType": "leave"
        },
        {
            "eventId": "C5C69845-DD77-487E-9C6A-708581B361E9",
            "email": "mary@domain.com",
            "eventType": "cancelled",
            "startDate": "2024-11-30",
            "endDate": "2025-11-30"
        }
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.calven.com/v1/timeoff' \
--header 'Content-Type: application/json' \
--data-raw '{
    "timeOffEvents": [
        {
            "eventId": "C5C69845-DD77-487E-9C6A-708581B361E9",
            "email": "bob@domain.com",
            "eventType": "scheduled",
            "startDate": "2024-12-30",
            "endDate": "2025-01-02",
            "timeOffType": "leave"
        },
        {
            "eventId": "C5C69845-DD77-487E-9C6A-708581B361E9",
            "email": "mary@domain.com",
            "eventType": "cancelled",
            "startDate": "2024-11-30",
            "endDate": "2025-11-30"
        }
    ]
}'

Responses

🟢200Success
application/json
Body
timestamp
string 
required
Response timestamp
results
array[object (TimeoffEventResponse) {3}] 
required
Time off event responses
eventId
string 
required
Event ID
Example:
C5C69845-DD77-487E-9C6A-708581B361E9
resultCode
enum<number> 
required
Result code
Allowed values:
0123
Example:
0
message
string 
required
Message for this event result
Example
{
    "timestamp": "string",
    "results": [
        {
            "eventId": "C5C69845-DD77-487E-9C6A-708581B361E9",
            "resultCode": 0,
            "message": "string"
        }
    ]
}
🟢201Success
🟠401Payload when auth header is missing or invalid
🟠403403
Previous
Submit occupancy events
Next
Submit access credentials
Built with