---
title: "Create On-Call schedule"
method: POST
path: "/api/v2/on-call/schedules"
tags: ["On-Call"]
---

# Create On-Call schedule

`POST /api/v2/on-call/schedules`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/on-call/schedules`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`

Create a new On-Call schedule

## Query parameters

- `include` string

## Request body

- ScheduleCreateRequest: The top-level request body for schedule creation, wrapping a `data` object.
  - `data` ScheduleCreateRequestData, required: The core data wrapper for creating a schedule, encompassing attributes, relationships, and the resource type.
    - `attributes` ScheduleCreateRequestDataAttributes, required: Describes the main attributes for creating a new schedule, including name, layers, and time zone.
      - `layers` ScheduleCreateRequestDataAttributesLayersItems[], required: The layers of On-Call coverage that define rotation intervals and restrictions.
        - `effective_date` string, date-time, required: The date/time when this layer becomes active (in ISO 8601).
        - `end_date` string, date-time: The date/time after which this layer no longer applies (in ISO 8601).
        - `interval` LayerAttributesInterval, required: Defines how often the rotation repeats, using a combination of days and optional seconds. Should be at least 1 hour.
          - `days` integer: The number of days in each rotation cycle.
          - `seconds` integer: Any additional seconds for the rotation cycle (up to 30 days).
        - `members` ScheduleRequestDataAttributesLayersItemsMembersItems[], required: A list of members who participate in this layer's rotation.
          - `user` ScheduleRequestDataAttributesLayersItemsMembersItemsUser: Identifies the user participating in this layer as a single object with an `id`.
            - `id` string: The user's ID.
        - `name` string, required: The name of this layer.
        - `restrictions` TimeRestriction[]: Zero or more time-based restrictions (for example, only weekdays, during business hours).
          - `end_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday': A day of the week.
          - `end_time` string: Specifies the ending time for this restriction.
          - `start_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday': A day of the week.
          - `start_time` string: Specifies the starting time for this restriction.
        - `rotation_start` string, date-time, required: The date/time when the rotation for this layer starts (in ISO 8601).
        - `time_zone` string: The time zone for this layer.
      - `name` string, required: A human-readable name for the new schedule.
      - `time_zone` string, required: The time zone in which the schedule is defined.
    - `relationships` ScheduleCreateRequestDataRelationships: Gathers relationship objects for the schedule creation request, including the teams to associate.
      - `teams` DataRelationshipsTeams: Associates teams with this schedule in a data structure.
        - `data` DataRelationshipsTeamsDataItems[]: An array of team references for this schedule.
          - `id` string, required: The unique identifier of the team in this relationship.
          - `type` 'teams', required: Teams resource type.
    - `type` 'schedules', required: Schedules resource type.

## Response `201`

Created

- Schedule: Top-level container for a schedule object, including both the `data` payload and any related `included` resources (such as teams, layers, or members).
  - `data` ScheduleData: Represents the primary data object for a schedule, linking attributes and relationships.
    - `attributes` ScheduleDataAttributes: Provides core properties of a schedule object such as its name and time zone.
      - `name` string: A short name for the schedule.
      - `time_zone` string: The time zone in which this schedule operates.
    - `id` string: The schedule's unique identifier.
    - `relationships` ScheduleDataRelationships: Groups the relationships for a schedule object, referencing layers and teams.
      - `layers` ScheduleDataRelationshipsLayers: Associates layers with this schedule in a data structure.
        - `data` ScheduleDataRelationshipsLayersDataItems[]: An array of layer references for this schedule.
          - `id` string, required: The unique identifier of the layer in this relationship.
          - `type` 'layers', required: Layers resource type.
      - `teams` DataRelationshipsTeams: Associates teams with this schedule in a data structure.
        - `data` DataRelationshipsTeamsDataItems[]: An array of team references for this schedule.
          - `id` string, required: The unique identifier of the team in this relationship.
          - `type` 'teams', required: Teams resource type.
    - `type` 'schedules', required: Schedules resource type.
  - `included` ScheduleDataIncludedItem[]: Any additional resources related to this schedule, such as teams and layers.
    - union: Any additional resources related to this schedule, such as teams and layers.
      - TeamReference: Provides a reference to a team, including ID, type, and basic attributes/relationships.
        - `attributes` TeamReferenceAttributes: Encapsulates the basic attributes of a Team reference, such as name, handle, and an optional avatar or description.
          - `avatar` string: URL or reference for the team's avatar (if available).
          - `description` string: A short text describing the team.
          - `handle` string: A unique handle/slug for the team.
          - `name` string: The full, human-readable name of the team.
        - `id` string: The team's unique identifier.
        - `type` 'teams', required: Teams resource type.
      - Layer: Encapsulates a layer resource, holding attributes like rotation details, plus relationships to the members covering that layer.
        - `attributes` LayerAttributes: Describes key properties of a Layer, including rotation details, name, start/end times, and any restrictions.
          - `effective_date` string, date-time: When the layer becomes active (ISO 8601).
          - `end_date` string, date-time: When the layer ceases to be active (ISO 8601).
          - `interval` LayerAttributesInterval: Defines how often the rotation repeats, using a combination of days and optional seconds. Should be at least 1 hour.
            - `days` integer: The number of days in each rotation cycle.
            - `seconds` integer: Any additional seconds for the rotation cycle (up to 30 days).
          - `name` string: The name of this layer.
          - `restrictions` TimeRestriction[]: An optional list of time restrictions for when this layer is in effect.
            - `end_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday': A day of the week.
            - `end_time` string: Specifies the ending time for this restriction.
            - `start_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday': A day of the week.
            - `start_time` string: Specifies the starting time for this restriction.
          - `rotation_start` string, date-time: The date/time when the rotation starts (ISO 8601).
          - `time_zone` string: The time zone for this layer.
        - `id` string: A unique identifier for this layer.
        - `relationships` LayerRelationships: Holds references to objects related to the Layer entity, such as its members.
          - `members` LayerRelationshipsMembers: Holds an array of references to the members of a Layer, each containing member IDs.
            - `data` LayerRelationshipsMembersDataItems[]: The list of members who belong to this layer.
              - …
        - `type` 'layers', required: Layers resource type.
      - ScheduleMember: Represents a single member entry in a schedule, referencing a specific user.
        - `id` string: The unique identifier for this schedule member.
        - `relationships` ScheduleMemberRelationships: Defines relationships for a schedule member, primarily referencing a single user.
          - `user` ScheduleMemberRelationshipsUser: Wraps the user data reference for a schedule member.
            - `data` ScheduleMemberRelationshipsUserData, required: Points to the user data associated with this schedule member, including an ID and type.
              - …
        - `type` 'members', required: Schedule Members resource type.
      - ScheduleUser: Represents a user object in the context of a schedule, including their `id`, type, and basic attributes.
        - `attributes` ScheduleUserAttributes: Provides basic user information for a schedule, including a name and email address.
          - `email` string: The user's email address.
          - `name` string: The user's name.
          - `status` 'active' | 'deactivated' | 'pending': The user's status.
        - `id` string: The unique user identifier.
        - `type` 'users', required: Users resource type.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
