Skip to main content
POST
/
api
/
schedule
/
schedules.create
Create schedules
curl --request POST \
  --url https://api.example.com/api/schedule/schedules.create \
  --header 'Content-Type: application/json' \
  --data '
{
  "team_id": "872815618512410358",
  "when": "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;DTSTART=20260101T120000;UNTIL=20260105T120000",
  "resource_id": "872815618512410358",
  "hour_ranges": [
    {
      "hour_range": "12:34:56/PT2H",
      "auto_correct": {
        "before_start": "PT1H30M20S",
        "after_start": "PT1H30M20S",
        "before_end": "PT1H30M20S",
        "after_end": "PT1H30M20S"
      },
      "paid_break": {
        "max_duration": "PT1H30M20S",
        "hour_range": "12:34:56/PT2H"
      }
    }
  ],
  "options": {
    "employee_resident_ratio": true,
    "text_color": "<string>",
    "special_hours": "12:34:56/PT2H",
    "schedule_on_bank_holidays": true,
    "allow_partial": false
  },
  "schedule_template_id": "872815618512410358",
  "adjustment": {
    "value": "PT1H30M20S",
    "time": "12:34:56"
  },
  "break_time": {
    "min_duration": "PT1H30M20S",
    "hour_range": "12:34:56/PT2H"
  },
  "remark": "<string>"
}
'
{
  "error": "OVERLAPPING",
  "body": {
    "conflicting_dates": [
      {
        "resource": "872815618512410358",
        "date": "2019-11-11"
      }
    ]
  }
}

Body

application/json
team_id
string<snowflake>
required
Example:

"872815618512410358"

when
string
required

A single date (YYYY-MM-DD), a date interval (YYYY-MM-DD/YYYY-MM-DD), or an RRULE string. When using a date interval or RRULE, options.schedule_on_bank_holidays is required.

Example:

"RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;DTSTART=20260101T120000;UNTIL=20260105T120000"

resource_id
string<snowflake>
required
Example:

"872815618512410358"

hour_ranges
object[]
required
options
object
required
schedule_template_id
string<snowflake> | null
Example:

"872815618512410358"

adjustment
object
break_time
object
remark
string | null

Response

Schedule(s) successfully created.