Table of contents
iModels
Download API definition:
GET https://api.bentley.com/imodels/{id}/changesets[?$top][&$skip][&$orderBy][&afterIndex][&lastIndex]

Retrieves a list of Changesets for the iModel specified by the iModel id.

Changesets form a linear timeline of the iModel changes. For more information on creating and retrieving Changesets using iTwin.js see working with Changesets.

Notes

The Prefer header can be used to specify how much result metadata is desired by the client. The Prefer request header field is used to indicate that particular server behaviors are preferred by the client but are not required for successful completion of the request.

This operation supports "return=representation" and "return=minimal" preferences.

The "return=representation" preference indicates that the client prefers that the server include an entity representing the current state of the resource in the response to a successful request. The "return=minimal" preference indicates that the client wishes the server to return only a minimal response to a successful request. This is the default preference if Prefer header is not specified.

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.

Authorization

User must have imodels_webview permission assigned at the iModel level. If iModel Role permissions at the iModel level are configured, then user must additionally have at least imodels_webview permission assigned at the iTwin level. If permissions at the iModel level are not configured, then user must have imodels_webview permission assigned at the iTwin level.

Alternatively the user should be an Organization Administrator for the Organization that owns a given iTwin the iModel belongs to.

For more information please refer to Account Administrator documentation section on Access Control API documentation page.

Note: download property requires user to have at least imodels_read permission. If user has only imodels_webview permission download will always be null.

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
id
Yes

iModel id

$top
No

The $top query option requests the number of items in the queried collection to be included in the result. E.g. to return only first collection item provide the following query: $top=1. When $top parameter is not provided default is set to 100. $top value cannot exceed 1000.

$skip
No

The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. E.g. to return items from the collection starting at the third place provide the following query: $skip=2.

$orderBy
No

The $orderBy query option allows clients to request ascending using 'asc' or descending using 'desc' order of the returned collection by one or more item properties. Currently the only supported property for Changesets is 'index'. When neither 'asc' or 'desc' keyword is specified the collection is sorted in ascending order. To sort the collection in descending order provide 'desc' keyword e.g.: $orderBy=index desc

afterIndex
No

The afterIndex query option allows clients to query Changesets which have an index that is greater than the one specified in the query. E.g. to return Changesets that have an index greater than or equal to 2 provide the following query: afterIndex=1. This query option is useful when user wants to query the most recent Changesets starting from the one that is already present in the local copy of the iModel. This can be used together with lastIndex option to specify Changeset index range, afterIndex denotes an exclusive start of the range.

lastIndex
No

The lastIndex query option allows clients to query Changesets which have an index that is less than or equal to the one specified in the query. E.g. to return Changesets that have an index less than or equal to 10 provide the following query: lastIndex=10. This can be used together with afterIndex option to specify Changeset index range, lastIndex denotes an inclusive end of the range.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

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

Prefer
No

Indicates a level of details in the response. This operation supports 'return=representation' and 'return=minimal' preferences.

Response 200 OK

OK

json
{
    "changesets": [{
            "id": "a1ecbdc8c4f6173004f9f881914a57c5511a362b",
            "displayName": "1",
            "description": "Changeset 0",
            "index": 1,
            "parentId": "",
            "creatorId": "ea4dfb9f-7f66-4c6f-82c5-0efad1636a1f",
            "pushDateTime": "2020-10-21T06:34:45.007Z",
            "state": "fileUploaded",
            "containingChanges": 0,
            "fileSize": 109,
            "briefcaseId": 2,
            "groupId": "1a038d01-5b2d-44d9-b4ca-e8d21805983c",
            "_links": {
                "creator": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/users/ea4dfb9f-7f66-4c6f-82c5-0efad1636a1f"
                },
                "self": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets/a1ecbdc8c4f6173004f9f881914a57c5511a362b"
                }
            }
        },
        {
            "id": "7caef8ab5afcd99c9e618fb37978c3a03d0409c7",
            "displayName": "2",
            "description": "Changeset 1",
            "index": 2,
            "parentId": "a1ecbdc8c4f6173004f9f881914a57c5511a362b",
            "creatorId": "ea4dfb9f-7f66-4c6f-82c5-0efad1636a1f",
            "pushDateTime": "2020-10-21T06:34:48.123Z",
            "state": "fileUploaded",
            "containingChanges": 0,
            "fileSize": 139,
            "briefcaseId": 2,
            "groupId": "1a038d01-5b2d-44d9-b4ca-e8d21805983c",
            "_links": {
                "creator": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/users/ea4dfb9f-7f66-4c6f-82c5-0efad1636a1f"
                },
                "self": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets/7caef8ab5afcd99c9e618fb37978c3a03d0409c7"
                }
            }
        },
        {
            "id": "a587345859410ce5c2811c7c558d4578938efa00",
            "displayName": "3",
            "description": "Changeset 2",
            "index": 3,
            "parentId": "7caef8ab5afcd99c9e618fb37978c3a03d0409c7",
            "creatorId": "27e3ecc7-ae44-4c9d-b0b5-2f65ec146f1d",
            "pushDateTime": "2020-10-21T06:34:51.13Z",
            "state": "fileUploaded",
            "containingChanges": 2,
            "fileSize": 109,
            "briefcaseId": 2,
            "groupId": null,
            "_links": {
                "creator": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/users/27e3ecc7-ae44-4c9d-b0b5-2f65ec146f1d"
                },
                "self": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets/a587345859410ce5c2811c7c558d4578938efa00"
                }
            }
        },
        {
            "id": "13a61888798b687d41f7c748d7414b428766281f",
            "displayName": "4",
            "description": "Changeset 3",
            "index": 4,
            "parentId": "a587345859410ce5c2811c7c558d4578938efa00",
            "creatorId": "27e3ecc7-ae44-4c9d-b0b5-2f65ec146f1d",
            "pushDateTime": "2020-10-21T06:34:54.13Z",
            "state": "fileUploaded",
            "containingChanges": 18,
            "fileSize": 109,
            "briefcaseId": 2,
            "groupId": null,
            "_links": {
                "creator": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/users/27e3ecc7-ae44-4c9d-b0b5-2f65ec146f1d"
                },
                "self": {
                    "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets/13a61888798b687d41f7c748d7414b428766281f"
                }
            }
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets?$skip=100&$top=100"
        },
        "prev": {
            "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets?$skip=0&$top=100"
        },
        "next": {
            "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets?$skip=200&$top=100"
        }
    }
}

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 404 Not Found

Specified iModel was not found.

json
{
    "error": {
        "code": "iModelNotFound",
        "message": "Requested iModel is not available."
    }
}

Response 422 Unprocessable Entity

The 422 (Unprocessable Entity) 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": "InvalidiModelsRequest",
        "message": "Cannot get Changesets.",
        "details": [{
            "code": "InvalidValue",
            "message": "'-1' is not a valid '$skip' value. '$skip' must be a non-negative integer.",
            "target": "$skip"
        }]
    }
}

Response 429 Too many requests

This response indicates that the user has sent too many requests in a given amount of time.

json
{
    "error": {
        "code": "TooManyRequests",
        "message": "More requests were received than the subscription rate-limit allows."
    }
}

Response headers

Name
Description
retry-after

The number of requests exceeds the rate-limit for the client subscription.

Changeset (summary) state

Indicates the state of the Changeset. 'waitingForFile' - indicates that Changeset metadata is created, but Changeset file is not uploaded yet or file upload is not confirmed yet. 'fileUploaded' - indicates that Changeset file is uploaded and confirmed.

Name
Type
Description
waitingForFile
String
fileUploaded
String

Changeset (summary)

Summarized representation of the Changeset.

Name
Type
Description
id
String

Id of the changeset.

displayName
String

Display name of the Changeset. Corresponds to Index property.

description
String, null

Description of the Changeset.

index
Integer

Index of the Changeset (increasing, but not necessarily sequential).

parentId
String, null

Id of the parent Changeset.

creatorId
String

Id of the user who created the Changeset.

pushDateTime
Date-time

Date when the Changeset was pushed to iModelHub.

briefcaseId
Integer

Id of the briefcase that was used to push the Changeset.

groupId
String, null

Id of the Changeset Group that the Changeset belongs to.

fileSize
Integer

Size of the Changeset file in bytes.

containingChanges
Integer

Describes what type of changes Changeset contains. Tells what changes changeset contains. 0 - regular, 1 - schema, 2 - definition, 4 - spatial data, 8 - sheets and drawings, 16 - views and models, 32 - global properties. ContainingChanges is flag value, therefore all change types, except Schema, can be combined.

Changeset (summary) state

Indicates the state of the Changeset. 'waitingForFile' - indicates that Changeset metadata is created, but Changeset file is not uploaded yet or file upload is not confirmed yet. 'fileUploaded' - indicates that Changeset file is uploaded and confirmed.

_links

Contains the hyperlinks to the related data of the Changeset.

Changeset state

Indicates the state of the Changeset. 'waitingForFile' - indicates that Changeset metadata is created, but Changeset file is not uploaded yet or file upload is not confirmed yet. 'fileUploaded' - indicates that Changeset file is uploaded and confirmed.

Name
Type
Description
waitingForFile
String
fileUploaded
String

Changeset

Changeset represents a file containing changes to the iModel. A single Changeset contains changes made on a single Briefcase file and pushed as a single file.

Name
Type
Description
id
String

Id of the Changeset.

displayName
String

Display name of the Changeset. Corresponds to Index property.

description
String, null

Description of the Changeset.

index
Integer

Index of the Changeset (increasing, but not necessarily sequential).

parentId
String, null

Id of the parent Changeset.

creatorId
String

Id of the user who created the Changeset.

pushDateTime
Date-time

Date when the Changeset was pushed to iModelHub.

briefcaseId
Integer

Id of the briefcase that was used to push the Changeset.

groupId
String, null

Id of the Changeset Group that the Changeset belongs to.

fileSize
Integer

Size of the Changeset file in bytes.

containingChanges
Integer

Describes what type of changes Changeset contains. Tells what changes changeset contains. 0 - regular, 1 - schema, 2 - definition, 4 - spatial data, 8 - sheets and drawings, 16 - views and models, 32 - global properties. ContainingChanges is flag value, therefore all change types, except Schema, can be combined.

Changeset state

Indicates the state of the Changeset. 'waitingForFile' - indicates that Changeset metadata is created, but Changeset file is not uploaded yet or file upload is not confirmed yet. 'fileUploaded' - indicates that Changeset file is uploaded and confirmed.

application

Information about the application that pushed the Changeset.

synchronizationInfo

Optional information about synchronization that is related to the Changeset.

_links

Contains the hyperlinks to the related data of the Changeset.

Changesets (prefer return=minimal)

List of Changesets in minimal representation.

Name
Type
Description
changesets

Changesets of the iModel.

_links

Contains the hyperlinks to the previous and next pages of results.

Changesets (prefer return=representation)

List of Changesets in full representation.

Name
Type
Description
changesets

Changesets of the iModel.

_links

Contains the hyperlinks to the previous and next pages of results.

Changeset Links

Hyperlinks to Changeset related data.

Name
Type
Description
creator

Information about the creator of the Changeset.

namedVersion

Named Version which was created for Changeset. If this is null then Changeset does not have a Named Version created for it.

self

Self hyperlink to get the details of the Changeset.

download

Hyperlink to download Changeset file from Azure Blob storage. Set only if the user has at least imodels_read permission, otherwise it is always set to null.

currentOrPrecedingCheckpoint

Hyperlink to get the latest successfully generated checkpoint where applied changeset index is lower or equal to this changeset index.

Changeset Links (summary)

Hyperlinks to Changeset related data.

Name
Type
Description
creator

Information about the creator of the Changeset.

self

Self hyperlink to get the details of the Changeset.

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

Paging Links

URLs for redoing the current request, getting to the previous or next page of results, if applicable.

Name
Type
Description
self

URL for redoing the current request.

prev

URL for getting the previous page of results.

next

URL for getting the next page of results.

Application

Information about the client application that is related to an entity.

Name
Type
Description
id
String

Id of the application.

name
String

Application name.

SynchronizationInfo

Information about synchronization that is related to a Changeset. This information is set by applications that perform iModel synchronization.

Name
Type
Description
taskId
String, null

Id of the synchronization task.

changedFiles
String[], null

List of source file names that contained changes which were synchronized to this Changeset.

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.