Table of contents
Schedules
Download API definition:
This operation is a Technical Preview and is available for testing purposes only. Do not use in production.
POST https://dev-api.bentley.com/schedules/{scheduleId}/task-links/batch

Create multiple Task Links for a Schedule.

Task Link

Task Links show the logical and scheduling dependencies between activities within a plan. Links between two Tasks define a dependency between one Task and another. They are used to explicitly prevent tasks from being worked on out of sequence or offset the start/finish of one versus another.

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

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

Task Links Create Request

Name
Type
Required?
Description
batch
No

Container of the Task Links to be created.

Example

json
{
    "batch": [{
            "calendarId": "730fc10e-183d-4b44-ace9-b44106190439",
            "lag": 10,
            "predecessorId": "42aa53f0-d4ad-4ec4-826b-fc6439090d46",
            "successorId": "91c3aaab-5c86-43ec-870d-6c34949ab1f3",
            "type": "FinishToStart"
        },
        {
            "predecessorId": "42aa53f0-d4ad-4ec4-826b-fc6439090d46",
            "successorId": "4e927d7a-6a9a-4a93-a75d-cbe60133cdd4",
            "type": "StartToFinish"
        }
    ]
}

Response 200 OK

This response indicates that the Task Links were Created.

json
{
    "batch": [{
            "calendarId": "730fc10e-183d-4b44-ace9-b44106190439",
            "createdOn": "2025-01-29T11:19:00Z",
            "deleted": false,
            "id": "7a557883-b83a-47fd-b157-feaa5449ffc3",
            "lag": 10,
            "predecessorId": "42aa53f0-d4ad-4ec4-826b-fc6439090d46",
            "successorId": "91c3aaab-5c86-43ec-870d-6c34949ab1f3",
            "type": "FinishToStart"
        },
        {
            "calendarId": "584728ee-6aec-4289-8e96-8fbee7185d32",
            "createdOn": "2025-01-29T11:19:00Z",
            "deleted": false,
            "id": "ec3e871c-83a0-4e81-94ed-4713054a0431",
            "lag": 0,
            "predecessorId": "42aa53f0-d4ad-4ec4-826b-fc6439090d46",
            "successorId": "4e927d7a-6a9a-4a93-a75d-cbe60133cdd4",
            "type": "StartToFinish"
        }
    ],
    "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 202 Accepted

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

json
{
    "batch": [{
            "id": "91c3aaab-5c86-43ec-870d-6c34949ab1f3"
        },
        {
            "id": "4e927d7a-6a9a-4a93-a75d-cbe60133cdd4"
        }
    ],
    "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": "InvalidRequestBody",
            "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.

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 Task Links.

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.

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

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.

Task Link

Representation of a Task Link.

Name
Type
Description
calendarId
String

Unique identifier of the Calendar on which to define the Delay.

createdOn
Date, null

The date on which the Task Link was created.

deleted
Boolean, null

Is this Task Link deleted.

id
String

The unique identifier of the Task Link.

lag
Int32

The minimum amount of time set to constrain one Task from another. Negative lag is indicated with a negative sign (-).

predecessorId
String

The unique identifier of the predecessor Task.

successorId
String

The unique identifier of the successor Task.

type

Task Link Type.

Task Link Create Request

Task Link properties for creation.

Name
Type
Description
calendarId
String, null

Unique identifier of the Calendar on which to define the Delay.

id
String, null

Unique identifier of the Task Link.

lag
Int32, null

The minimum amount of time set to constrain one Task from another. Negative lag is indicated with a negative sign (-).

predecessorId
String

Unique identifier of the predecessor Task.

successorId
String

Unique identifier of the successor Task.

type

Task Link Type.

Task Link Type

The link type: Finish to Start, Finish to Finish, Start to Start, or Start to Finish.

Name
Type
Description
FinishToStart
String
StartToFinish
String
StartToStart
String
FinishToFinish
String
Unknown
String

Task Links Create Operation Response

Container of Task Links creation Operation.

Name
Type
Description
batch

Properties of the Task Links in the Operation.

operation

Contains properties of the created long-running operation.

_links

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

Task Links Create Request

Container of the Task Links to be created.

Name
Type
Description
batch

Container of the Task Links to be created.

Task Links Create Response

Contains properties of the created Task Links.

Name
Type
Description
batch

A list of created Task Links.

operation

Contains properties of the created long-running operation.

_links

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

Task Links Response Properties

Contains properties of the Task Link that is queued for the Operation.

Name
Type
Description
id
String

The unique identifier of the Task Link.

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.