Table of contents
Schedules
Download API definition:
POST https://dev-api.bentley.com/schedules/{scheduleId}/calendars

Creates a Calendar for a Schedule.

V10 Endpoint

This endpoint is only supported by v10 schedules. The schedule type can be identified by querying the /schedules/{scheduleId} endpoint.

Calendar

Calendars are associated with Projects, Companies and Resources. They allow you to determine working time and non-working time. For example, the Project Calendar can be set to change the standard working day from the 8:00hours/day default to any working schedule needed.

Operation

Operations, also known as LROs (Long Running Operations), are time-consuming tasks that would not be completed in the appropriate timeframe for a single request response. Endpoints that use operations return an operation id that can be used on a separate endpoint to track the progress of the task that is being handled.

Authentication

Requires Authorization header with valid Bearer token for scope itwin-platform.

For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.

Rate limits

All iTwin Platform API operations have a rate limit. For more documentation on that visit Rate limits and quotas page.

Request parameters

Name
Required?
Description
scheduleId
Yes

The unique identifier of the Schedule.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.

Entity to post for creation.

Request body

CalendarCreateRequest

Name
Type
Required?
Description
dayTypes
No

The Day Types that are used in the Calendar.

exceptions
No

A list of exceptions in the usual working schedule.

id
String, null
No

The unique identifier of the Calendar.

name
String
No

The name of the Calendar.

parentId
String, null
No

The unique identifier of the parent Calendar.

week
No

The Day Types of each week day in the Calendar.

Example

json
{
    "dayTypes": [{
            "color": "#ff0329",
            "description": "a non-working day",
            "id": "dccd3cbd-3813-485a-b395-361f8c291311",
            "timeBlocks": [],
            "type": "Normal"
        },
        {
            "color": "#fffcea",
            "description": "a normal working day",
            "id": "5cfdd83b-76e6-482e-aacf-475793c097f0",
            "timeBlocks": [{
                "endTime": "2025-11-03",
                "startTime": "2025-11-03"
            }],
            "type": "Normal"
        }
    ],
    "exceptions": [{
        "date": "2024-04-03T12:00:00Z",
        "dayTypeId": "dccd3cbd-3813-485a-b395-361f8c291311"
    }],
    "id": "1a87d544-31f7-4131-8cac-6470570a4920",
    "name": "Example calendar",
    "parentId": "49e9c332-49c3-40b2-84df-fbace88daa42",
    "week": {
        "fridayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
        "mondayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
        "saturdayDayTypeId": "dccd3cbd-3813-485a-b395-361f8c291311",
        "sundayDayTypeId": "dccd3cbd-3813-485a-b395-361f8c291311",
        "thursdayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
        "tuesdayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
        "wednesdayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0"
    }
}

Response 201 Created

Created

json
{
    "calendar": {
        "dayTypes": [{
                "color": "#ff0329",
                "description": "a non-working day",
                "id": "dccd3cbd-3813-485a-b395-361f8c291311",
                "timeBlocks": [],
                "type": "Normal"
            },
            {
                "color": "#fffcea",
                "description": "a normal working day",
                "id": "5cfdd83b-76e6-482e-aacf-475793c097f0",
                "timeBlocks": [{
                    "endTime": "2025-11-03",
                    "startTime": "2025-11-03"
                }],
                "type": "Normal"
            }
        ],
        "exceptions": [{
            "date": "2024-04-03T12:00:00Z",
            "dayTypeId": "dccd3cbd-3813-485a-b395-361f8c291311"
        }],
        "id": "1a87d544-31f7-4131-8cac-6470570a4920",
        "name": "Example calendar",
        "parentId": "49e9c332-49c3-40b2-84df-fbace88daa42",
        "week": {
            "fridayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
            "mondayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
            "saturdayDayTypeId": "dccd3cbd-3813-485a-b395-361f8c291311",
            "sundayDayTypeId": "dccd3cbd-3813-485a-b395-361f8c291311",
            "thursdayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
            "tuesdayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0",
            "wednesdayDayTypeId": "5cfdd83b-76e6-482e-aacf-475793c097f0"
        },
        "workingDaysPerWeek": 5,
        "workingSecondsPerDay": 28800
    }
}

Response headers

Name
Description
Location

A header that identifies the location of a specific resource. For more information see the official documentation.

Response 202 Accepted

This response indicates that the requested long-running operation was Accepted.

json
{
    "operation": {
        "id": "1604789f-68c4-46ba-b20d-8a19f8319362"
    },
    "_links": {
        "operationLocation": {
            "href": "https://api.bentley.com/schedules/5e11b21e-cba2-48a8-a2c1-2977d2d373e0/operations/1604789f-68c4-46ba-b20d-8a19f8319362"
        }
    }
}

Response headers

Name
Description
Operation-Id

The unique identifier of the Operation.

Operation-Location

URL to the Operations endpoint with pre-entered Operation ID.

Response 400 Bad Request

The 400 (Bad Request) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)

json
{
    "error": {
        "code": "InvalidSchedulesRequest",
        "details": [{
                "code": "InvalidProperty",
                "message": "The Day Type Id was not found in the Day Type array.",
                "target": "week.mondayDayTypeId"
            },
            {
                "code": "InvalidProperty",
                "message": "Day type with provided Id already exists in Day Type array.",
                "target": "dayTypes[2].id"
            },
            {
                "code": "InvalidProperty",
                "message": "Calendar week must have at least one working day.",
                "target": "week"
            },
            {
                "code": "InvalidProperty",
                "message": "An Exception with the provided Date already exists in the Exception array.",
                "target": "exceptions[1].date"
            },
            {
                "code": "InvalidProperty",
                "message": "The Day Type Id was not found in the Day Type array.",
                "target": "exceptions[0].dayTypeId"
            },
            {
                "code": "InvalidProperty",
                "message": "A working day must have at least one Time Block.",
                "target": "dayTypes[0]"
            },
            {
                "code": "InvalidProperty",
                "message": "A non-working day must not have any Time Blocks.",
                "target": "dayTypes[1]"
            },
            {
                "code": "InvalidProperty",
                "message": "The End Time of a Time Block must be later then the Start Time.",
                "target": "dayTypes[2].timeBlocks[0]"
            },
            {
                "code": "InvalidProperty",
                "message": "The Time Bounds overlap with an earlier Time Block.",
                "target": "dayTypes[2].timeBlocks[2]"
            }
        ],
        "message": "The request contains invalid properties."
    }
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 403 Forbidden

User is not authorized to create a Calendar.

json
{
    "error": {
        "code": "InsufficientPermissions",
        "message": "The user has insufficient permissions for the requested operation."
    }
}

Response 404 Not Found

This response indicates that the provided Schedule is not available.

json
{
    "error": {
        "code": "ScheduleNotFound",
        "message": "Requested Schedule is not available.",
        "target": "scheduleId"
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

Calendar

Representation of a Calendar.

Name
Type
Description
dayTypes

The Day Types that are used in the Calendar.

deleted
Boolean, null

Is this Calendar deleted.

exceptions

A list of exceptions in the usual working schedule.

id
String

The unique identifier of the Calendar.

name
String, null

The name of the Calendar.

parentId
String, null

The unique identifier of the parent Calendar.

week

The Day Types of each week day in the Calendar.

workingDaysPerWeek
Int32, null

The number of working days per normal week. This can be used to calculate durations in weeks. Task duration properties are in total seconds, so to convert to weeks calculate as: duration / workingSecondsPerDay / workingDaysPerWeek.

workingSecondsPerDay
Int32, null

The number of working seconds in the first Calendar Day Type of 'normal' type. This can be used to calculate durations in days. Task duration properties are in total seconds, so to convert to days calculate as: duration / workingSecondsPerDay.

CalendarCreateRequest

Properties of the calendar to be created

Name
Type
Description
dayTypes

The Day Types that are used in the Calendar.

exceptions

A list of exceptions in the usual working schedule.

id
String, null

The unique identifier of the Calendar.

name
String

The name of the Calendar.

parentId
String, null

The unique identifier of the parent Calendar.

week

The Day Types of each week day in the Calendar.

Calendar Day Type

Representation of a Calendar Day Type.

Name
Type
Description
color
String

The color in which the Calendar Day Type will be displayed.

description
String, null

The description of the Calendar Day Type.

id
String

The unique identifier of the Calendar Day Type.

timeBlocks
TimeBlock[], null

List of time periods that specify work hours.

type

Value specifying whether the Day Type is a work day or not.

Calendar Exception

An exception in the usual working schedule.

Name
Type
Description
date
Date

The date on which the exception occurs.

dayTypeId
String

The unique identifier of the Calendar Day Type, which will override the usual Calendar Day Type for the specified date.

Calendar Response

Container for Calendar object.

Name
Type
Description
calendar

Calendar properties.

Calendar Week

The Calendar Day Types for each day of the week.

Name
Type
Description
fridayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Fridays.

mondayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Mondays.

saturdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Saturdays.

sundayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Sundays.

thursdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Thursdays.

tuesdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Tuesdays.

wednesdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Wednesdays.

Day Type

The type of day. Describes if the day is a work day or not.

Name
Type
Description
Normal
String
NonWorking
String
Partial
String
Unknown
String

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

Operation Create Response

Contains properties of the created long-running operation, and a link to this operation.

Name
Type
Description
operation

Contains properties of the created long-running operation.

_links

Contains the hyperlink to the Operations endpoint to check the operation information.

Operation Create Response Properties

Contains the id of the created long-running operation.

Name
Type
Description
id
String, null

The unique identifier of the Operation.

Operation Location

Contains the URL to the Operations endpoint to check the information about a long-running operation.

Name
Type
Description
operationLocation

URL to the Operations endpoint with pre-entered Operation ID.

Time Block

A block of time.

Name
Type
Description
endTime
String, null

End time of the Time Block. This value will be in the range [00:01, 24:00].

startTime
String, null

Start time of the Time Block. This value will be in the range [00:00, 23:59].

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

details

Optional array of more specific errors.

Detailed Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error Detailed information.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.