Skip to main content
POST
/
schedules
Create a schedule
curl --request POST \
  --url https://api.shiftkeeper.io/schedules/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "time_zone": "<string>",
  "layers": [
    {
      "name": "<string>",
      "rotation_start": "2023-11-07T05:31:56Z",
      "concurrent_oncall_users": 2,
      "user_references": [
        {
          "type": "email",
          "value": "[email protected]"
        }
      ],
      "shift_length": {
        "amount": 2,
        "unit": "hours"
      },
      "restriction_intervals": [
        {
          "day": "monday",
          "from": "<string>",
          "to": "<string>"
        }
      ]
    }
  ],
  "team_ids": [
    "<string>"
  ],
  "description": "<string>"
}
'
{
  "schedule": {
    "name": "<string>",
    "time_zone": "<string>",
    "layers": [
      {
        "name": "<string>",
        "rotation_start": "2023-11-07T05:31:56Z",
        "concurrent_oncall_users": 2,
        "users": [
          {
            "id": "<string>",
            "name": "<string>",
            "email": "[email protected]",
            "role": "owner",
            "seat": "viewer",
            "time_zone": "<string>",
            "slack_id": "<string>"
          }
        ],
        "shift_length": {
          "amount": 2,
          "unit": "hours"
        },
        "restriction_intervals": [
          {
            "day": "monday",
            "from": "<string>",
            "to": "<string>"
          }
        ]
      }
    ],
    "teams": [
      {
        "id": "<string>",
        "name": "<string>",
        "description": "<string>"
      }
    ],
    "current_revision": 1,
    "current_revision_valid_from": "2023-11-07T05:31:56Z",
    "users": [
      {
        "id": "<string>",
        "name": "<string>",
        "email": "[email protected]",
        "role": "owner",
        "seat": "viewer",
        "time_zone": "<string>",
        "slack_id": "<string>"
      }
    ],
    "description": "<string>",
    "current_oncall_shift": {
      "users": [
        {
          "id": "<string>",
          "name": "<string>",
          "email": "[email protected]",
          "role": "owner",
          "seat": "viewer",
          "time_zone": "<string>",
          "slack_id": "<string>"
        }
      ],
      "start": "2023-11-07T05:31:56Z",
      "end": "2023-11-07T05:31:56Z"
    },
    "next_oncall_shift": {
      "users": [
        {
          "id": "<string>",
          "name": "<string>",
          "email": "[email protected]",
          "role": "owner",
          "seat": "viewer",
          "time_zone": "<string>",
          "slack_id": "<string>"
        }
      ],
      "start": "2023-11-07T05:31:56Z",
      "end": "2023-11-07T05:31:56Z"
    }
  }
}

Authorizations

x-api-key
string
header
required

Enter your API key which starts with 'keeper_'

Body

application/json
name
string
required

The name of the schedule.

Required string length: 1 - 60
time_zone
string
required

The time zone of the schedule. Must be a valid IANA time zone. Note that the time zone cannot be changed after the schedule is created.

layers
object[]
required

The layers of the schedule. Currently, schedules can have only one layer.

Required array length: 1 element
team_ids
string[]
required

The teams to link to the schedule.

Maximum array length: 10
description
string

The description of the schedule.

Maximum string length: 200

Response

Default Response

schedule
object
required