Overview
Create work schedules for team members. Schedules can be one-time events or recurring (weekly or bi-weekly). You can assign schedules to individual members or entire groups, with automatic timezone conversion to UTC.
Request Body
Start date and time for the schedule. Will be converted to UTC. Format: Any valid date-time stringExample: "Mon Dec 15 2025 14:00:00 GMT-0800 (PST)"
Start time for the schedule (HH:MM format, 24-hour). Example: "09:00"
End time for the schedule (HH:MM format, 24-hour). Example: "17:00"
Timezone for the schedule. Times will be converted from this timezone to UTC. Example: "America/New_York", "Europe/London"
Minimum hours for this schedule shift. Example: 8.0
How the schedule repeats. Allowed values: "never", "weekly", "bi-Weekly"Example: "weekly"
Comma-separated list of user IDs to assign the schedule to. Example: "1,5,7,9"
Comma-separated list of group IDs. All members and managers of these groups will be included. Example: "2,3"
Comma-separated list of days when the schedule repeats. Required for weekly/bi-weekly repetition. Allowed values: mon, tue, wed, thu, fri, sat, sunExample: "mon,wed,fri"
End date for recurring schedules. Required for weekly/bi-weekly repetition. Format: Same as date_fromExample: "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)"
Response
Success message confirming the schedule was created.
Example Request - One-Time Schedule
curl --request POST \
--url https://staging.thareja.org/api/v3/schedule/create \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"date_from": "Mon Dec 15 2025 14:00:00 GMT-0800 (PST)",
"time_from": "09:00",
"time_to": "17:00",
"timezone": "America/Los_Angeles",
"minimum_hours": 8.0,
"repetition": "never",
"members": "1,5,7"
}'
Example Request - Weekly Recurring Schedule
curl --request POST \
--url https://staging.thareja.org/api/v3/schedule/create \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"date_from": "Mon Dec 15 2025 09:00:00 GMT-0800 (PST)",
"time_from": "09:00",
"time_to": "17:00",
"timezone": "America/New_York",
"minimum_hours": 8.0,
"repetition": "weekly",
"day_repeat": "mon,wed,fri",
"until": "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)",
"members": "5,7,9"
}'
Example Request - Bi-Weekly with Groups
curl --request POST \
--url https://staging.thareja.org/api/v3/schedule/create \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"date_from": "Mon Dec 15 2025 09:00:00 GMT-0500 (EST)",
"time_from": "09:00",
"time_to": "17:00",
"timezone": "America/New_York",
"minimum_hours": 8.0,
"repetition": "bi-Weekly",
"day_repeat": "mon,tue,wed,thu,fri",
"until": "Fri Mar 31 2026 17:00:00 GMT-0500 (EST)",
"groupsId": "2,3",
"members": "1"
}'
Example Request (JavaScript)
fetch ( 'https://staging.thareja.org/api/v3/schedule/create' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer YOUR_API_TOKEN' ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
date_from: "Mon Dec 15 2025 09:00:00 GMT-0800 (PST)" ,
time_from: "09:00" ,
time_to: "17:00" ,
timezone: "America/Los_Angeles" ,
minimum_hours: 8.0 ,
repetition: "weekly" ,
day_repeat: "mon,wed,fri" ,
until: "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)" ,
members: "5,7,9"
})
})
. then ( response => response . json ())
. then ( data => console . log ( data ));
Example Response
{
"success" : "data added successfully"
}
Error Responses
400 Bad Request - Missing Required Fields
400 Bad Request - Invalid Repetition
400 Bad Request - Invalid Timezone
400 Bad Request - Invalid Date
401 Unauthorized
404 Not Found - Group Not Found
{
"error" : 400 ,
"message" : "date_from, time_from, time_to, timezone, minimum_hours, and repetition are required"
}
Repetition Types
Never (One-Time)
Creates a single schedule entry for the specified date and time.
Required fields:
date_from, time_from, time_to, timezone, minimum_hours, repetition
Optional fields:
Weekly
Creates recurring schedules every week on specified days until the end date.
Required fields:
All “Never” fields plus day_repeat and until
Example: Schedule every Monday, Wednesday, Friday from Dec 15 to Dec 31
Bi-Weekly
Creates recurring schedules every other week on specified days until the end date.
Required fields:
Behavior: Alternates weeks based on the week number of the start date (even/odd)
Example: Schedule every Monday and Thursday on alternating weeks
Specify days as lowercase three-letter abbreviations, comma-separated:
Day Value Monday monTuesday tueWednesday wedThursday thuFriday friSaturday satSunday sun
Examples:
Weekdays: "mon,tue,wed,thu,fri"
Weekends: "sat,sun"
MWF: "mon,wed,fri"
Member Assignment
Direct Members
Provide user IDs as comma-separated string:
Group Assignment
Provide group IDs and all members/managers are automatically included:
Combined
You can specify both groups and individual members:
{
"groupsId" : "2,3" ,
"members" : "1,15"
}
Note: Duplicate members are automatically removed.
Schedule ID (SID)
Each schedule is assigned a unique Schedule ID (SID):
New schedules : A random 10-character hash is generated
Existing schedules : If a schedule with the same date_from and date_to exists, its SID is reused
Purpose : Groups related schedule entries together
Timezone Handling
Input : Dates provided in any timezone format
Conversion : Automatically converted to UTC for storage
Storage : All schedules stored in UTC
Display : Convert back to user’s timezone when retrieving
Example:
Input: "Mon Dec 15 2025 09:00:00 GMT-0800 (PST)"
Stored: "2025-12-15 17:00:00" (UTC)
Automatic Notifications
Zapier Webhook
For each member assigned to the schedule, a webhook is triggered:
{
"event" : "new_schedule" ,
"payload" : {
"user_id" : 5 ,
"team_id" : 1 ,
"sid" : "abc123def4" ,
"title" : "New shift created for John Doe" ,
"hours" : 8.0 ,
"shift_start" : "09:00:00" ,
"shift_end" : "17:00:00" ,
"start_date" : "2025-12-15 17:00:00" ,
"end_date" : "2025-12-31 17:00:00" ,
"repetition" : "weekly" ,
"day_repeat" : "mon,wed,fri" ,
"retrieved_at" : "2025-11-28 10:30:00"
},
"criteria" : {
"team_id" : 1
}
}
Schedule Creation Flow
Bi-Weekly Logic
Bi-weekly schedules alternate based on week numbers:
If start date is in an even week : schedules created on even weeks
If start date is in an odd week : schedules created on odd weeks
Example:
Start: Week 50 (even) - December 15, 2025
Creates schedules: Week 50, 52, 2, 4, etc.
Skips: Week 51, 1, 3, 5, etc.
Notes
UTC storage : All times are converted to and stored in UTC
Multiple members : Separate schedule entries created for each member
Group expansion : Groups are expanded to include all members and managers
Duplicate prevention : Duplicate member IDs are automatically removed
SID reuse : Schedules with identical start/end times share the same SID
Minimum hours : Rounded to 2 decimal places
Team assignment : Automatically assigned to your current team
User tracking : Your user ID is recorded as the creator
Webhook integration : Zapier webhooks trigger for each assigned member
Date parsing : Flexible date format parsing with timezone support
Best Practices
Always specify timezone explicitly
Use 24-hour time format (HH:MM)
Provide until date for recurring schedules
Test with a single member before bulk assignment
Verify timezone conversions for accuracy
Use groups for easier team-wide scheduling
Set realistic minimum hours
Plan recurring schedules in advance
Consider holidays when setting end dates
Use Cases
Shift scheduling : Create rotating work shifts for team members
Project timelines : Schedule recurring project work sessions
Team availability : Set regular availability windows
Resource planning : Plan team member allocations
Coverage schedules : Ensure continuous coverage with rotating schedules
Training sessions : Schedule recurring training or meetings
Bearer authentication header of the form Bearer <token> , where <token> is your auth token.
Start date and time for the schedule
Example: "Mon Dec 15 2025 09:00:00 GMT-0800 (PST)"
Start time (HH:MM format, 24-hour)
End time (HH:MM format, 24-hour)
Timezone for the schedule
Minimum hours for this schedule shift
Available options:
never,
weekly,
bi-Weekly
Comma-separated list of user IDs
Comma-separated list of group IDs
Comma-separated days for recurring schedules
End date for recurring schedules
Example: "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)"