Time Off API
Overview
Authentication
Create a time off period
Example query
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-X POST https://app.swarmia.com/api/v0/time-offs \
-d '{
"email": "[email protected]",
"startDate": "2024-12-20",
"endDate": "2024-12-27",
"externalId": "HR-VACATION-12345"
}'Parameters
Response
Code
Description
Get a time off period
Example queries
Parameters
Response
Code
Description
Update a time off period
Example query
Parameters
Response
Code
Description
Delete a time off period
Example query
Parameters
Response
Code
Description
Using External IDs
Benefits of using External IDs
External ID requirements
Example workflow with External IDs
Common validation errors
Invalid email format
Invalid date format
Invalid date range
Email not found
External ID already exists
Time off period already exists
Invalid External ID format
Best practices
Use External IDs for easier integration
Handle date changes carefully
Error handling
Last updated
Was this helpful?