Skip to main content
POST
/
v2
/
teams
/
{team_id}
/
schedules
Create Schedule
curl --request POST \
  --url https://public.api.serval.com/v2/teams/{team_id}/schedules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "timezone": "<string>",
  "weeklyHours": {
    "sunday": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ],
    "monday": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ],
    "tuesday": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ],
    "wednesday": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ],
    "thursday": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ],
    "friday": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ],
    "saturday": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ]
  }
}
'
{
  "data": {
    "id": "<string>",
    "teamId": "<string>",
    "name": "<string>",
    "timezone": "<string>",
    "weeklyHours": {
      "sunday": [
        {
          "start": "<string>",
          "end": "<string>"
        }
      ],
      "monday": [
        {
          "start": "<string>",
          "end": "<string>"
        }
      ],
      "tuesday": [
        {
          "start": "<string>",
          "end": "<string>"
        }
      ],
      "wednesday": [
        {
          "start": "<string>",
          "end": "<string>"
        }
      ],
      "thursday": [
        {
          "start": "<string>",
          "end": "<string>"
        }
      ],
      "friday": [
        {
          "start": "<string>",
          "end": "<string>"
        }
      ],
      "saturday": [
        {
          "start": "<string>",
          "end": "<string>"
        }
      ]
    },
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

team_id
string
required

The ID of the team to create the schedule for.

Body

application/json
name
string

The name of the schedule.

timezone
string

IANA timezone identifier, e.g. "America/New_York". Defaults to "UTC" if not provided.

weeklyHours
weekly_hours · object

Business hours for each day of the week.

Response

Success

data
data · object

Schedule represents business hours configuration.