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
The unique identifier of the Schedule.
Request headers
OAuth access token with itwin-platform scope
Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.
Entity to post for creation.
Request body
CalendarCreateRequest
The unique identifier of the Calendar.
The name of the Calendar.
The unique identifier of the parent Calendar.
Example
{ "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
{ "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
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.
{ "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
The unique identifier of the Operation.
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)
{ "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.
{ "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.
{ "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.
{ "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.
{ "error": { "code": "RateLimitExceeded", "message": "The client sent more requests than allowed by this API for the current tier of the client." } }
Response headers
Number of seconds to wait until client is allowed to make more requests.
Calendar
Representation of a Calendar.
Is this Calendar deleted.
The unique identifier of the Calendar.
The name of the Calendar.
The unique identifier of the parent Calendar.
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.
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.
{ "type": "object", "properties": { "dayTypes": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarDayType" }, "description": "The Day Types that are used in the Calendar.", "nullable": true }, "deleted": { "type": "boolean", "description": "Is this Calendar deleted.", "nullable": true }, "exceptions": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarException" }, "description": "A list of exceptions in the usual working schedule.", "nullable": true }, "id": { "type": "string", "description": "The unique identifier of the Calendar." }, "name": { "type": "string", "description": "The name of the Calendar.", "nullable": true }, "parentId": { "type": "string", "description": "The unique identifier of the parent Calendar.", "nullable": true }, "week": { "$ref": "#/components/schemas/CalendarWeek", "description": "The Day Types of each week day in the Calendar." }, "workingDaysPerWeek": { "type": "integer", "description": "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.", "format": "int32", "nullable": true }, "workingSecondsPerDay": { "type": "integer", "description": "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.", "format": "int32", "nullable": true } }, "additionalProperties": false, "description": "Representation of a Calendar." }
CalendarCreateRequest
Properties of the calendar to be created
The unique identifier of the Calendar.
The name of the Calendar.
The unique identifier of the parent Calendar.
{ "properties": { "dayTypes": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarDayType" }, "description": "The Day Types that are used in the Calendar." }, "exceptions": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarException" }, "description": "A list of exceptions in the usual working schedule.", "nullable": true }, "id": { "type": "string", "description": "The unique identifier of the Calendar.", "nullable": true }, "name": { "type": "string", "description": "The name of the Calendar." }, "parentId": { "type": "string", "description": "The unique identifier of the parent Calendar.", "nullable": true }, "week": { "$ref": "#/components/schemas/CalendarWeek", "description": "The Day Types of each week day in the Calendar." } }, "additionalProperties": false, "description": "Properties of the calendar to be created" }
Calendar Day Type
Representation of a Calendar Day Type.
The color in which the Calendar Day Type will be displayed.
The description of the Calendar Day Type.
The unique identifier of the Calendar Day Type.
{ "title": "Calendar Day Type", "type": "object", "properties": { "color": { "type": "string", "description": "The color in which the Calendar Day Type will be displayed.", "example": "#00FF00" }, "description": { "type": "string", "description": "The description of the Calendar Day Type.", "nullable": true }, "id": { "type": "string", "description": "The unique identifier of the Calendar Day Type." }, "timeBlocks": { "type": "array", "items": { "$ref": "#/components/schemas/TimeBlock" }, "description": "List of time periods that specify work hours.", "nullable": true }, "type": { "$ref": "#/components/schemas/DayType", "description": "Value specifying whether the Day Type is a work day or not." } }, "additionalProperties": false, "description": "Representation of a Calendar Day Type." }
Calendar Exception
An exception in the usual working schedule.
The date on which the exception occurs.
The unique identifier of the Calendar Day Type, which will override the usual Calendar Day Type for the specified date.
{ "title": "Calendar Exception", "type": "object", "properties": { "date": { "type": "string", "description": "The date on which the exception occurs.", "format": "date" }, "dayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, which will override the usual Calendar Day Type for the specified date." } }, "additionalProperties": false, "description": "An exception in the usual working schedule." }
Calendar Response
Container for Calendar object.
{ "title": "Calendar Response", "type": "object", "properties": { "calendar": { "$ref": "#/components/schemas/Calendar", "description": "Calendar properties." } }, "additionalProperties": false, "description": "Container for Calendar object." }
Calendar Week
The Calendar Day Types for each day of the week.
The unique identifier of the Calendar Day Type, that occurs on Fridays.
The unique identifier of the Calendar Day Type, that occurs on Mondays.
The unique identifier of the Calendar Day Type, that occurs on Saturdays.
The unique identifier of the Calendar Day Type, that occurs on Sundays.
The unique identifier of the Calendar Day Type, that occurs on Thursdays.
The unique identifier of the Calendar Day Type, that occurs on Tuesdays.
The unique identifier of the Calendar Day Type, that occurs on Wednesdays.
{ "title": "Calendar Week", "type": "object", "properties": { "fridayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Fridays." }, "mondayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Mondays." }, "saturdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Saturdays." }, "sundayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Sundays." }, "thursdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Thursdays." }, "tuesdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Tuesdays." }, "wednesdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Wednesdays." } }, "additionalProperties": false, "description": "The Calendar Day Types for each day of the week." }
Day Type
The type of day. Describes if the day is a work day or not.
{ "title": "Day Type", "enum": [ "Normal", "NonWorking", "Partial", "Unknown" ], "type": "string", "description": "The type of day. Describes if the day is a work day or not." }
Link
Hyperlink container.
Hyperlink to the specific entity.
{ "type": "object", "properties": { "href": { "type": "string", "description": "Hyperlink to the specific entity." } }, "additionalProperties": false, "description": "Hyperlink container." }
Operation Create Response
Contains properties of the created long-running operation, and a link to this operation.
Contains properties of the created long-running operation.
Contains the hyperlink to the Operations endpoint to check the operation information.
{ "title": "Operation Create Response", "type": "object", "properties": { "operation": { "$ref": "#/components/schemas/OperationCreateResponseProperties", "description": "Contains properties of the created long-running operation." }, "_links": { "$ref": "#/components/schemas/OperationLocationLink", "description": "Contains the hyperlink to the Operations endpoint to check the operation information." } }, "additionalProperties": false, "description": "Contains properties of the created long-running operation, and a link to this operation." }
Operation Create Response Properties
Contains the id of the created long-running operation.
The unique identifier of the Operation.
{ "title": "Operation Create Response Properties", "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier of the Operation.", "nullable": true } }, "additionalProperties": false, "description": "Contains the id of the created long-running operation." }
Operation Location
Contains the URL to the Operations endpoint to check the information about a long-running operation.
{ "title": "Operation Location", "type": "object", "properties": { "operationLocation": { "$ref": "#/components/schemas/Link", "description": "URL to the Operations endpoint with pre-entered Operation ID." } }, "additionalProperties": false, "description": "Contains the URL to the Operations endpoint to check the information about a long-running operation." }
Time Block
A block of time.
End time of the Time Block. This value will be in the range [00:01, 24:00].
Start time of the Time Block. This value will be in the range [00:00, 23:59].
{ "title": "Time Block", "type": "object", "properties": { "endTime": { "type": "string", "description": "End time of the Time Block. This value will be in the range [00:01, 24:00].", "nullable": true }, "startTime": { "type": "string", "description": "Start time of the Time Block. This value will be in the range [00:00, 23:59].", "nullable": true } }, "additionalProperties": false, "description": "A block of time." }
DetailedError
Contains error information and an array of more specific errors.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information and an array of more specific errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true }, "details": { "type": "array", "description": "Optional array of more specific errors.", "items": { "$ref": "#/components/schemas/Error" } } }, "required": [ "code", "message", "details" ], "additionalProperties": true }
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.
{ "type": "object", "title": "Detailed Error Response", "description": "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.", "properties": { "error": { "description": "Error Detailed information.", "$ref": "#/components/schemas/DetailedError" } }, "required": [ "error" ], "additionalProperties": false }
Error
Contains error information.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true } }, "required": [ "code", "message" ], "additionalProperties": true }
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.
{ "type": "object", "title": "Error Response", "description": "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.", "properties": { "error": { "description": "Error information.", "$ref": "#/components/schemas/Error" } }, "required": [ "error" ], "additionalProperties": false }