Create work schedule
curl --request POST \
--url https://app.thareja.ai/api/v1/timemanagement/schedule/add \
--header 'Authorization: Bearer <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,
"repetition": "weekly",
"members": "1,5,7,9",
"groupsId": "2,3",
"day_repeat": "mon,wed,fri",
"until": "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)"
}
'import requests
url = "https://app.thareja.ai/api/v1/timemanagement/schedule/add"
payload = {
"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,
"repetition": "weekly",
"members": "1,5,7,9",
"groupsId": "2,3",
"day_repeat": "mon,wed,fri",
"until": "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <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/New_York',
minimum_hours: 8,
repetition: 'weekly',
members: '1,5,7,9',
groupsId: '2,3',
day_repeat: 'mon,wed,fri',
until: 'Fri Dec 31 2025 17:00:00 GMT-0800 (PST)'
})
};
fetch('https://app.thareja.ai/api/v1/timemanagement/schedule/add', 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://app.thareja.ai/api/v1/timemanagement/schedule/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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,
'repetition' => 'weekly',
'members' => '1,5,7,9',
'groupsId' => '2,3',
'day_repeat' => 'mon,wed,fri',
'until' => 'Fri Dec 31 2025 17:00:00 GMT-0800 (PST)'
]),
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://app.thareja.ai/api/v1/timemanagement/schedule/add"
payload := strings.NewReader("{\n \"date_from\": \"Mon Dec 15 2025 09:00:00 GMT-0800 (PST)\",\n \"time_from\": \"09:00\",\n \"time_to\": \"17:00\",\n \"timezone\": \"America/New_York\",\n \"minimum_hours\": 8,\n \"repetition\": \"weekly\",\n \"members\": \"1,5,7,9\",\n \"groupsId\": \"2,3\",\n \"day_repeat\": \"mon,wed,fri\",\n \"until\": \"Fri Dec 31 2025 17:00:00 GMT-0800 (PST)\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.thareja.ai/api/v1/timemanagement/schedule/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"date_from\": \"Mon Dec 15 2025 09:00:00 GMT-0800 (PST)\",\n \"time_from\": \"09:00\",\n \"time_to\": \"17:00\",\n \"timezone\": \"America/New_York\",\n \"minimum_hours\": 8,\n \"repetition\": \"weekly\",\n \"members\": \"1,5,7,9\",\n \"groupsId\": \"2,3\",\n \"day_repeat\": \"mon,wed,fri\",\n \"until\": \"Fri Dec 31 2025 17:00:00 GMT-0800 (PST)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.thareja.ai/api/v1/timemanagement/schedule/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"date_from\": \"Mon Dec 15 2025 09:00:00 GMT-0800 (PST)\",\n \"time_from\": \"09:00\",\n \"time_to\": \"17:00\",\n \"timezone\": \"America/New_York\",\n \"minimum_hours\": 8,\n \"repetition\": \"weekly\",\n \"members\": \"1,5,7,9\",\n \"groupsId\": \"2,3\",\n \"day_repeat\": \"mon,wed,fri\",\n \"until\": \"Fri Dec 31 2025 17:00:00 GMT-0800 (PST)\"\n}"
response = http.request(request)
puts response.read_body{
"error": 400,
"message": "date_from, time_from, time_to, timezone, minimum_hours, and repetition are required"
}
{
"error": 400,
"message": "day_repeat and until are required for weekly/bi-weekly repetition"
}
{
"error": 400,
"message": "Invalid timezone provided"
}
{
"error": 400,
"message": "Invalid date format"
}
{
"error": 401,
"message": "Invalid or missing authentication token"
}
{
"error": 404,
"message": "One or more groups not found"
}
Schedule
Create Schedule
Create work schedules for team members with support for one-time, weekly, or bi-weekly recurrence
POST
/
api
/
v1
/
timemanagement
/
schedule
/
add
Create work schedule
curl --request POST \
--url https://app.thareja.ai/api/v1/timemanagement/schedule/add \
--header 'Authorization: Bearer <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,
"repetition": "weekly",
"members": "1,5,7,9",
"groupsId": "2,3",
"day_repeat": "mon,wed,fri",
"until": "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)"
}
'import requests
url = "https://app.thareja.ai/api/v1/timemanagement/schedule/add"
payload = {
"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,
"repetition": "weekly",
"members": "1,5,7,9",
"groupsId": "2,3",
"day_repeat": "mon,wed,fri",
"until": "Fri Dec 31 2025 17:00:00 GMT-0800 (PST)"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <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/New_York',
minimum_hours: 8,
repetition: 'weekly',
members: '1,5,7,9',
groupsId: '2,3',
day_repeat: 'mon,wed,fri',
until: 'Fri Dec 31 2025 17:00:00 GMT-0800 (PST)'
})
};
fetch('https://app.thareja.ai/api/v1/timemanagement/schedule/add', 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://app.thareja.ai/api/v1/timemanagement/schedule/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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,
'repetition' => 'weekly',
'members' => '1,5,7,9',
'groupsId' => '2,3',
'day_repeat' => 'mon,wed,fri',
'until' => 'Fri Dec 31 2025 17:00:00 GMT-0800 (PST)'
]),
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://app.thareja.ai/api/v1/timemanagement/schedule/add"
payload := strings.NewReader("{\n \"date_from\": \"Mon Dec 15 2025 09:00:00 GMT-0800 (PST)\",\n \"time_from\": \"09:00\",\n \"time_to\": \"17:00\",\n \"timezone\": \"America/New_York\",\n \"minimum_hours\": 8,\n \"repetition\": \"weekly\",\n \"members\": \"1,5,7,9\",\n \"groupsId\": \"2,3\",\n \"day_repeat\": \"mon,wed,fri\",\n \"until\": \"Fri Dec 31 2025 17:00:00 GMT-0800 (PST)\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.thareja.ai/api/v1/timemanagement/schedule/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"date_from\": \"Mon Dec 15 2025 09:00:00 GMT-0800 (PST)\",\n \"time_from\": \"09:00\",\n \"time_to\": \"17:00\",\n \"timezone\": \"America/New_York\",\n \"minimum_hours\": 8,\n \"repetition\": \"weekly\",\n \"members\": \"1,5,7,9\",\n \"groupsId\": \"2,3\",\n \"day_repeat\": \"mon,wed,fri\",\n \"until\": \"Fri Dec 31 2025 17:00:00 GMT-0800 (PST)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.thareja.ai/api/v1/timemanagement/schedule/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"date_from\": \"Mon Dec 15 2025 09:00:00 GMT-0800 (PST)\",\n \"time_from\": \"09:00\",\n \"time_to\": \"17:00\",\n \"timezone\": \"America/New_York\",\n \"minimum_hours\": 8,\n \"repetition\": \"weekly\",\n \"members\": \"1,5,7,9\",\n \"groupsId\": \"2,3\",\n \"day_repeat\": \"mon,wed,fri\",\n \"until\": \"Fri Dec 31 2025 17:00:00 GMT-0800 (PST)\"\n}"
response = http.request(request)
puts response.read_body{
"error": 400,
"message": "date_from, time_from, time_to, timezone, minimum_hours, and repetition are required"
}
{
"error": 400,
"message": "day_repeat and until are required for weekly/bi-weekly repetition"
}
{
"error": 400,
"message": "Invalid timezone provided"
}
{
"error": 400,
"message": "Invalid date format"
}
{
"error": 401,
"message": "Invalid or missing authentication token"
}
{
"error": 404,
"message": "One or more groups not found"
}
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
string
required
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)"string
required
Start time for the schedule (HH:MM format, 24-hour).Example:
"09:00"string
required
End time for the schedule (HH:MM format, 24-hour).Example:
"17:00"string
required
Timezone for the schedule. Times will be converted from this timezone to UTC.Example:
"America/New_York", "Europe/London"number
required
Minimum hours for this schedule shift.Example:
8.0string
required
How the schedule repeats.Allowed values:
"never", "weekly", "bi-Weekly"Example: "weekly"string
Comma-separated list of user IDs to assign the schedule to.Example:
"1,5,7,9"string
Comma-separated list of group IDs. All members and managers of these groups will be included.Example:
"2,3"string
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"string
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
string
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
{
"error": 400,
"message": "date_from, time_from, time_to, timezone, minimum_hours, and repetition are required"
}
{
"error": 400,
"message": "day_repeat and until are required for weekly/bi-weekly repetition"
}
{
"error": 400,
"message": "Invalid timezone provided"
}
{
"error": 400,
"message": "Invalid date format"
}
{
"error": 401,
"message": "Invalid or missing authentication token"
}
{
"error": 404,
"message": "One or more groups not found"
}
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
members,groupsId
Weekly
Creates recurring schedules every week on specified days until the end date. Required fields:- All “Never” fields plus
day_repeatanduntil
Bi-Weekly
Creates recurring schedules every other week on specified days until the end date. Required fields:- All “Weekly” fields
Day Repeat Format
Specify days as lowercase three-letter abbreviations, comma-separated:| Day | Value |
|---|---|
| Monday | mon |
| Tuesday | tue |
| Wednesday | wed |
| Thursday | thu |
| Friday | fri |
| Saturday | sat |
| Sunday | sun |
- Weekdays:
"mon,tue,wed,thu,fri" - Weekends:
"sat,sun" - MWF:
"mon,wed,fri"
Member Assignment
Direct Members
Provide user IDs as comma-separated string:{
"members": "1,5,7,9"
}
Group Assignment
Provide group IDs and all members/managers are automatically included:{
"groupsId": "2,3"
}
Combined
You can specify both groups and individual members:{
"groupsId": "2,3",
"members": "1,15"
}
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_fromanddate_toexists, 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
- 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
- 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
untildate 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
Related Endpoints
- Get Schedules - List all schedules
- Get User Schedule - Get schedules for specific user
- Update Schedule - Modify existing schedule
- Delete Schedule - Remove schedule
- Get Schedule by SID - Get all schedules with same SID
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
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)
Pattern:
^([01]?[0-9]|2[0-3]):[0-5][0-9]$Example:
"09:00"
End time (HH:MM format, 24-hour)
Pattern:
^([01]?[0-9]|2[0-3]):[0-5][0-9]$Example:
"17:00"
Timezone for the schedule
Example:
"America/New_York"
Minimum hours for this schedule shift
Example:
8
How the schedule repeats
Available options:
never, weekly, bi-Weekly Example:
"weekly"
Comma-separated list of user IDs
Example:
"1,5,7,9"
Comma-separated list of group IDs
Example:
"2,3"
Comma-separated days for recurring schedules
Example:
"mon,wed,fri"
End date for recurring schedules
Example:
"Fri Dec 31 2025 17:00:00 GMT-0800 (PST)"