On-Call API › Schedules
Create a schedule
Creates an empty schedule; add layers and people to it next. timezone
defaults to UTC and decides when every shift on the schedule starts and
ends. team_id defaults to the caller's first team and must be a team the
caller is in.
Permission (API-key scope): oncall:schedule:write.
Authorization
bearerAuth(oncall:schedule:write)apiKeyHeader(oncall:schedule:write)
Request body required
On create name is required; on update an empty field keeps its value.
namestringdescriptionstringtimezonestringIANA name, e.g.Europe/Istanbul.activebooleanteam_idstringA team the caller is in; defaults to the caller's first team on create.
Responses
201
The schedule.
dataSchedule requiredShow Schedule properties
idstringorg_idstringteam_idstringEmpty for an organization-wide schedule.namestringdescriptionstringtimezonestringIANA timezone every shift is evaluated in.activebooleanlayersarray of ScheduleLayerShow ScheduleLayer properties
idstringschedule_idstringnamestringpriorityintegerLayers with a higher priority win over lower ones.rotation_typeRotationTyperotation_startstring (date-time)When the rota's first turn started.handoff_dayintegerWeekday of the handover for weekly rotas, 0 (Sunday) to 6.handoff_timestringHH:MMof the handover.restrict_to_weekdaysarray of integerrestrict_start_timestringHH:MMrestrict_end_timestringHH:MMrotationsarray of ScheduleRotationShow ScheduleRotation properties
idstringlayer_idstringuser_idstringpositioninteger0-based place in the rota.created_atstring (date-time)
created_atstring (date-time)updated_atstring (date-time)
overridesarray of ScheduleOverrideShow ScheduleOverride properties
idstringschedule_idstringuser_idstringWhom the override covers, when recorded.override_user_idstringWho is on call instead.start_timestring (date-time)end_timestring (date-time)reasonstringcreated_atstring (date-time)
external_sourcestringWhere it was imported from (opsgenie,pagerduty); absent for schedules made in EvoHub.external_idstringcreated_atstring (date-time)updated_atstring (date-time)
successboolean required
400
The body is not JSON (INVALID_BODY); name is empty or longer than 100 characters (VALIDATION_FAILED); or timezone is not an IANA name (VALIDATION_ERROR).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
403
The key lacks the scope (FORBIDDEN), or team_id names a team the caller is not in (NOT_IN_TEAM).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
429
Too many requests (RATE_LIMITED). Wait Retry-After seconds.
Retry-AfterintegerSeconds to wait.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
Example request
curl -X POST 'https://evohub.io/api/v1/schedules' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": "Platform primary",
"team_id": "a3f9c2e1-7b4d-4c8a-9e6f-2d1b0c9a8f7e",
"timezone": "Europe/Istanbul",
"description": "Weekly rota for the platform team"
}'