Create multiple Tasks for a Schedule.
Task
Tasks are the activities in a schedule that need to be performed. They can have durations, start and finish dates, resource assignments, and dependencies on other tasks.
V10 Endpoint
This endpoint is only supported by v10 schedules. The schedule type can be identified by querying the /schedules/{scheduleId} endpoint.
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.
Request body
Tasks Create Request
Example
{ "batch": [{ "comment": "Comment about demolishing", "id": "fc3673d9-e385-4031-abbe-663535a329f5", "name": "Demolish Old Building", "plannedStart": "2019-12-02T08:00:00", "type": "Work", "url": "https://example.com", "userDefinedId": "D256", "taskOrder": { "taskId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "taskPosition": "AfterGivenTask" } }, { "name": "Discuss demolishing", "parentId": "fc3673d9-e385-4031-abbe-663535a329f5", "plannedDuration": 3600, "type": "Meeting", "plannedStart": "2019-12-02T08:00:00" }] }
Response 200 OK
This response indicates that the Tasks were Created.
{ "batch": [{ "actualDuration": 0, "actualFinish": null, "actualPhysicalQuantity": 0, "actualStart": null, "calendarId": "8fad9677-a26d-452d-b3fb-42fcf3be782e", "comment": "Comment about demolishing", "constraintEarlyDate": null, "constraintLateDate": null, "constraintType": "NoConstraint", "duration": 3600, "durationAtCompletion": 3600, "deleted": false, "durationType": "Fixed", "estimatedRate": 0, "estimatedFinish": "2019-12-02T10:00:00Z", "expectedFinish": null, "finish": "2019-12-02T10:00:00Z", "ganttIndex": 0, "id": "fc3673d9-e385-4031-abbe-663535a329f5", "isWbs": false, "name": "Demolish Old Building", "parentId": null, "percentComplete": 0, "physicalQuantityUnit": "Unknown", "plannedDuration": 3600, "plannedFinish": "2019-12-02T10:00:00Z", "plannedPhysicalQuantity": 0, "plannedStart": "2019-12-02T09:00:00Z", "progressType": "Automatic", "remainingDuration": 3600, "remainingPhysicalQuantity": 0, "ruleId": null, "start": "2019-12-02T09:00:00Z", "status": "Planned", "statusId": "20cf6c69-b9df-422a-a509-a164c59d668b", "type": "Work", "url": "https://example.com", "userDefinedId": "D256" }, { "actualDuration": 0, "actualFinish": null, "actualPhysicalQuantity": 0, "actualStart": null, "calendarId": "8fad9677-a26d-452d-b3fb-42fcf3be782e", "comment": "", "constraintEarlyDate": null, "constraintLateDate": null, "constraintType": "NoConstraint", "duration": 3600, "durationAtCompletion": 3600, "deleted": false, "durationType": "Fixed", "estimatedRate": 0, "estimatedFinish": "2019-12-02T10:00:00Z", "expectedFinish": null, "finish": "2019-12-02T10:00:00Z", "ganttIndex": 0, "id": "525849d9-7777-473a-8682-f9e778b9a059", "isWbs": false, "name": "Discuss demolishing", "parentId": "fc3673d9-e385-4031-abbe-663535a329f5", "percentComplete": 0, "physicalQuantityUnit": "Unknown", "plannedDuration": 3600, "plannedFinish": "2019-12-02T10:00:00Z", "plannedPhysicalQuantity": 0, "plannedStart": "2019-12-02T09:00:00Z", "progressType": "Automatic", "remainingDuration": 3600, "remainingPhysicalQuantity": 0, "ruleId": null, "start": "2019-12-02T09:00:00Z", "status": "Planned", "statusId": "20cf6c69-b9df-422a-a509-a164c59d668b", "type": "Meeting", "url": "", "userDefinedId": "ST00020" }], "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.
A header containing the recommended batch size for batch processing requests.
Response 202 Accepted
This response indicates that the requested long-running operation was Accepted.
{ "batch": [{ "id": "fc3673d9-e385-4031-abbe-663535a329f5" }, { "id": "525849d9-7777-473a-8682-f9e778b9a059" }], "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.
A header containing the recommended batch size for batch processing requests.
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 'batch' property must not contain more than 200 items." }], "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 Tasks.
{ "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.
Link
Hyperlink container.
Hyperlink to the specific entity.
{ "type": "object", "properties": { "href": { "type": "string", "description": "Hyperlink to the specific entity." } }, "description": "Hyperlink container.", "additionalProperties": false }
Task
Representation of a Task.
The unique identifier of the Task.
A URL associated with the Task.
The name of the Task.
Is Task a Work Breakdown Structure (WBS).
This is a computed field. For planned tasks, it's the planned start date, for started and completed tasks, it's the actual start date.
This is a computed field. For planned tasks, it's the planned finish, for started tasks, it's the estimated finish, and for completed tasks, it's the actual finish.
The unique identifier of the Rule.
The comment of the Task.
Is this Task deleted.
This is a computed field. For planned tasks, it's the planned duration, for started tasks, it's the sum of completed and remaining duration, and for completed tasks, it's the actual duration.
The unique identifier of the parent Task.
The unique identifier of the Task Status.
The unique identifier of the assigned Calendar.
The date on which the activity is actually started.
The date on which the activity actually finished.
The Start Date according to the current project schedule. It can only change for Tasks with Planned Status.
The estimated production rate to accomplish the given Physical Quantity in the given Duration (when Duration Type is Fixed).
The Finish Date according to the current project schedule. It can only change for Tasks with Planned Status.
A unique Task Id defined by the user.
The amount of time actually consumed in performing the activity. The value is a timestamp of seconds.
A user-defined (non-calculated) date that indicates when the Task is realistically expected to finish.
The expected Task end date.
The due level of progress for the Task as a percentage of its overall duration. Depends on the Progress Type selected.
The time allotted to complete a Task. It can only change for Tasks with Planned Status. The value is a timestamp of seconds.
The total quantity required by the Task, used to calculate the duration of a Physical Quantity Dependent Task.
The amount of work time required to complete the Task. It is automatically calculated from the Percent Complete or can be entered manually once a Task has been Started. The value is a timestamp of seconds.
Late date in the date range for Task Constraint Types: StartBetween, FinishBetween, WorkBetween, WorkOut.
Early date in the date range for Task Constraint Types: StartBetween, FinishBetween, WorkBetween, WorkOut.
This is a computed field. For planned tasks, it's the planned duration, for started tasks, it's the sum of actual duration and remaining duration, and for completed tasks, it's the actual duration.
The physical quantity completed to date.
The planned physical quantity.
The physical quantity required to complete the Task.
{ "type": "object", "title": "Task", "properties": { "id": { "type": "string", "description": "The unique identifier of the Task." }, "url": { "type": "string", "description": "A URL associated with the Task." }, "name": { "type": "string", "description": "The name of the Task." }, "type": { "$ref": "#/components/schemas/TaskType" }, "isWbs": { "type": "boolean", "description": "Is Task a Work Breakdown Structure (WBS)." }, "start": { "type": "string", "format": "date-time", "nullable": true, "description": "This is a computed field. For planned tasks, it's the planned start date, for started and completed tasks, it's the actual start date." }, "finish": { "type": "string", "format": "date-time", "nullable": true, "description": "This is a computed field. For planned tasks, it's the planned finish, for started tasks, it's the estimated finish, and for completed tasks, it's the actual finish." }, "ruleId": { "type": "string", "nullable": true, "description": "The unique identifier of the Rule." }, "status": { "$ref": "#/components/schemas/TaskStatusType" }, "comment": { "type": "string", "nullable": true, "description": "The comment of the Task." }, "deleted": { "type": "boolean", "nullable": true, "description": "Is this Task deleted." }, "duration": { "type": "integer", "format": "int32", "description": "This is a computed field. For planned tasks, it's the planned duration, for started tasks, it's the sum of completed and remaining duration, and for completed tasks, it's the actual duration." }, "parentId": { "type": "string", "nullable": true, "description": "The unique identifier of the parent Task." }, "statusId": { "type": "string", "description": "The unique identifier of the Task Status." }, "calendarId": { "type": "string", "description": "The unique identifier of the assigned Calendar." }, "actualStart": { "type": "string", "format": "date-time", "nullable": true, "description": "The date on which the activity is actually started." }, "actualFinish": { "type": "string", "format": "date-time", "nullable": true, "description": "The date on which the activity actually finished." }, "durationType": { "$ref": "#/components/schemas/TaskDurationType" }, "plannedStart": { "type": "string", "format": "date-time", "description": "The Start Date according to the current project schedule. It can only change for Tasks with Planned Status." }, "progressType": { "$ref": "#/components/schemas/TaskProgressType" }, "estimatedRate": { "type": "number", "format": "double", "description": "The estimated production rate to accomplish the given Physical Quantity in the given Duration (when Duration Type is Fixed)." }, "plannedFinish": { "type": "string", "format": "date-time", "description": "The Finish Date according to the current project schedule. It can only change for Tasks with Planned Status." }, "userDefinedId": { "type": "string", "description": "A unique Task Id defined by the user." }, "actualDuration": { "type": "integer", "format": "int32", "nullable": true, "description": "The amount of time actually consumed in performing the activity. The value is a timestamp of seconds." }, "constraintType": { "$ref": "#/components/schemas/TaskConstraintType" }, "expectedFinish": { "type": "string", "format": "date-time", "nullable": true, "description": "A user-defined (non-calculated) date that indicates when the Task is realistically expected to finish." }, "estimatedFinish": { "type": "string", "format": "date-time", "nullable": true, "description": "The expected Task end date." }, "percentComplete": { "type": "number", "format": "double", "description": "The due level of progress for the Task as a percentage of its overall duration. Depends on the Progress Type selected." }, "plannedDuration": { "type": "integer", "format": "int32", "description": "The time allotted to complete a Task. It can only change for Tasks with Planned Status. The value is a timestamp of seconds." }, "physicalQuantity": { "type": "number", "format": "double", "description": "The total quantity required by the Task, used to calculate the duration of a Physical Quantity Dependent Task." }, "remainingDuration": { "type": "integer", "format": "int32", "nullable": true, "description": "The amount of work time required to complete the Task. It is automatically calculated from the Percent Complete or can be entered manually once a Task has been Started. The value is a timestamp of seconds." }, "constraintLateDate": { "type": "string", "format": "date-time", "nullable": true, "description": "Late date in the date range for Task Constraint Types: StartBetween, FinishBetween, WorkBetween, WorkOut." }, "constraintEarlyDate": { "type": "string", "format": "date-time", "nullable": true, "description": "Early date in the date range for Task Constraint Types: StartBetween, FinishBetween, WorkBetween, WorkOut." }, "durationAtCompletion": { "type": "integer", "format": "int32", "nullable": true, "description": "This is a computed field. For planned tasks, it's the planned duration, for started tasks, it's the sum of actual duration and remaining duration, and for completed tasks, it's the actual duration." }, "physicalQuantityUnit": { "$ref": "#/components/schemas/ResourceUnitType" }, "actualPhysicalQuantity": { "type": "number", "format": "double", "description": "The physical quantity completed to date." }, "plannedPhysicalQuantity": { "type": "number", "format": "double", "description": "The planned physical quantity." }, "remainingPhysicalQuantity": { "type": "number", "format": "double", "description": "The physical quantity required to complete the Task." } }, "description": "Representation of a Task.", "additionalProperties": false }
Error
Contains error information.
One of a server-defined set of error codes.
The target of the error.
A human-readable representation of the error.
{ "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "target": { "type": "string", "nullable": true, "description": "The target of the error." }, "message": { "type": "string", "description": "A human-readable representation of the error." } }, "description": "Contains error information.", "additionalProperties": true }
Task Type
Task Type provides a categorization (or classification) of project Tasks. See the Task Types section for details.
{ "enum": [ "Work", "StartKeyDate", "FinishKeyDate", "ShortHammock", "LongHammock", "Rfi", "ChangeOrder", "Testing", "Delivery", "Meeting", "Rework", "Design", "Maintenance", "Manufacture", "Storage", "Purchase", "Receive", "Delay", "WeatherDelay", "Unknown" ], "type": "string", "title": "Task Type", "description": "Task Type provides a categorization (or classification) of project Tasks. See the [Task Types](#task-types) section for details." }
Task Order
Specifies the position of the Task relative to another Task.
{ "type": "object", "title": "Task Order", "properties": { "taskId": { "type": "string", "description": "The unique identifier of the Task to position relative to." }, "taskPosition": { "$ref": "#/components/schemas/TaskPosition" } }, "description": "Specifies the position of the Task relative to another Task.", "additionalProperties": false }
Task Position
The position of the Task relative to the given Task.
{ "enum": [ "BeforeGivenTask", "AfterGivenTask" ], "type": "string", "title": "Task Position", "description": "The position of the Task relative to the given Task." }
DetailedError
Contains error information and an array of more specific errors.
One of a server-defined set of error codes.
The target of the error.
A human-readable representation of the error.
{ "type": "object", "required": [ "code", "message", "details" ], "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "target": { "type": "string", "nullable": true, "description": "The target of the error." }, "details": { "type": "array", "items": { "$ref": "#/components/schemas/Error" }, "description": "Optional array of more specific errors." }, "message": { "type": "string", "description": "A human-readable representation of the error." } }, "description": "Contains error information and an array of more specific errors.", "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", "required": [ "error" ], "properties": { "error": { "$ref": "#/components/schemas/Error", "description": "Error information." } }, "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.", "additionalProperties": false }
Task Status Type
Task status type specifies the current status of the Task.
{ "enum": [ "Planned", "Started", "Finished", "Unknown" ], "type": "string", "title": "Task Status Type", "description": "Task status type specifies the current status of the Task." }
Resource Unit Type
The possible unit types for resources.
{ "enum": [ "CubicFeet", "CubicMeter", "Liter", "Millimeter", "Meter", "Feet", "Each", "Pair", "Dozen", "Gross", "SqFoot", "SqYard", "SqMeter", "Pound", "Gram", "Kilo", "Bag", "Box", "Bucket", "Bundle", "Card", "Carton", "Coil", "Pack", "Pegs", "Length", "Outer", "Pallet", "Roll", "Sachet", "Set", "Sheet", "Ton", "Person", "Item", "CubicYard", "MetricTon", "Hour", "LinearMeter", "Unknown" ], "type": "string", "title": "Resource Unit Type", "description": "The possible unit types for resources." }
Task Duration Type
The Task duration type value specifies way that Task Duration is determined. See the Task Duration Types section for details.
{ "enum": [ "Fixed", "PhysicalQuantityDependent", "ResourceUnitsDependent", "Unknown" ], "type": "string", "title": "Task Duration Type", "description": "The Task duration type value specifies way that Task Duration is determined. See the [Task Duration Types](#task-duration-types) section for details." }
Task Progress Type
The Task progress type value specifies way that Task Progress is determined. See the Task Progress Types section for details.
{ "enum": [ "Automatic", "Manual", "Duration", "Physical", "Unit", "Unknown" ], "type": "string", "title": "Task Progress Type", "description": "The Task progress type value specifies way that Task Progress is determined. See the [Task Progress Types](#task-progress-types) section for details." }
Task Create Request
Properties of the Task to be created.
The unique identifier of the Task.
A URL associated with the Task.
The name of the Task.
The unique identifier of the Rule.
The comment of the Task. The comment cannot exceed 1000 characters.
The unique identifier of the parent Task.
The Start Date of the Task.
A unique Task Id defined by the user.
The time allotted to complete a Task. It can only change for Tasks with Planned Status. The value is a timestamp of seconds.
{ "type": "object", "title": "Task Create Request", "properties": { "id": { "type": "string", "nullable": true, "description": "The unique identifier of the Task." }, "url": { "type": "string", "nullable": true, "description": "A URL associated with the Task." }, "name": { "type": "string", "description": "The name of the Task." }, "type": { "$ref": "#/components/schemas/TaskType" }, "ruleId": { "type": "string", "nullable": true, "description": "The unique identifier of the Rule." }, "comment": { "type": "string", "nullable": true, "description": "The comment of the Task. The comment cannot exceed 1000 characters." }, "parentId": { "type": "string", "nullable": true, "description": "The unique identifier of the parent Task." }, "taskOrder": { "$ref": "#/components/schemas/TaskOrder" }, "plannedStart": { "type": "string", "format": "date-time", "description": "The Start Date of the Task." }, "userDefinedId": { "type": "string", "nullable": true, "description": "A unique Task Id defined by the user." }, "plannedDuration": { "type": "integer", "format": "int32", "nullable": true, "description": "The time allotted to complete a Task. It can only change for Tasks with Planned Status. The value is a timestamp of seconds." } }, "description": "Properties of the Task to be created.", "additionalProperties": false }
Task Constraint Type
Task Constraints determine the rules under which a Task can be started and rescheduled. See the Task Constraint Types section for details.
{ "enum": [ "NoConstraint", "CannotReschedule", "StartAsap", "StartAlap", "StartOn", "StartAfter", "StartBefore", "StartBetween", "FinishOn", "FinishAfter", "FinishBefore", "FinishBetween", "MandatoryStart", "MandatoryFinish", "WorkBetween", "WorkOut", "Unknown" ], "type": "string", "title": "Task Constraint Type", "description": "Task Constraints determine the rules under which a Task can be started and rescheduled. See the [Task Constraint Types](#task-constraint-types) section for details." }
Tasks Create Request
Container of the Tasks to be created.
{ "type": "object", "title": "Tasks Create Request", "properties": { "batch": { "type": "array", "items": { "$ref": "#/components/schemas/TaskCreateRequest" }, "description": "Container of the Tasks to be created." } }, "description": "Container of the Tasks to be created.", "additionalProperties": false }
Tasks Create Response
Contains properties of the created Tasks.
{ "type": "object", "title": "Tasks Create Response", "properties": { "batch": { "type": "array", "items": { "$ref": "#/components/schemas/Task" }, "description": "A list of created Tasks." }, "_links": { "$ref": "#/components/schemas/OperationLocationLink" }, "operation": { "$ref": "#/components/schemas/OperationCreateResponseProperties" } }, "description": "Contains properties of the created Tasks.", "additionalProperties": false }
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", "required": [ "error" ], "properties": { "error": { "$ref": "#/components/schemas/DetailedError", "description": "Error Detailed information." } }, "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.", "additionalProperties": false }
Operation Location
Contains the URL to the Operations endpoint to check the information about a long-running operation.
{ "type": "object", "title": "Operation Location", "properties": { "operationLocation": { "$ref": "#/components/schemas/Link" } }, "description": "Contains the URL to the Operations endpoint to check the information about a long-running operation.", "additionalProperties": false }
Tasks Create Operation Response
Container of Tasks creation Operation.
{ "type": "object", "title": "Tasks Create Operation Response", "properties": { "batch": { "type": "array", "items": { "$ref": "#/components/schemas/TaskOperationResponseProperties" }, "description": "Properties of the Tasks in the Operation." }, "_links": { "$ref": "#/components/schemas/OperationLocationLink" }, "operation": { "$ref": "#/components/schemas/OperationCreateResponseProperties" } }, "description": "Container of Tasks creation Operation.", "additionalProperties": false }
Task Operation Response Properties
Contains properties of the Task that is queued for an Operation.
The unique identifier of the Task.
{ "type": "object", "title": "Task Operation Response Properties", "properties": { "id": { "type": "string", "description": "The unique identifier of the Task." } }, "description": "Contains properties of the Task that is queued for an Operation.", "additionalProperties": false }
Operation Create Response Properties
Contains the id of the created long-running operation.
The unique identifier of the Operation.
{ "type": "object", "title": "Operation Create Response Properties", "properties": { "id": { "type": "string", "nullable": true, "description": "The unique identifier of the Operation." } }, "description": "Contains the id of the created long-running operation.", "additionalProperties": false }
Was this page helpful?