Table of contents
iModels
Download API definition:
POST https://api.bentley.com/imodels/{id}/changesetgroups

Creates a new Changeset Group.

Changeset Groups are a way to logically group Changesets. Changesets that belong to the same Changeset Group may be interpreted as one logical change to the iModel, for example, iModel synchronization process may create multiple Changesets but they all represent one synchronization run.

The intended workflow is as follows:

  1. Application creates a Changeset Group.

  2. Application pushes one or more Changesets to that Changeset Group by setting groupId property on the Changeset entity.

  3. Application updates Changeset Group and sets its state value to completed.

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_write 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_write 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.

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

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.

Request body

Changeset Group (create)

Name
Type
Required?
Description
description
String, null
No

Description of the new Changeset Group that will be created. Valid description values are strings that are not longer than 255 characters.

Example

json
{
    "description": "MicroStation Connector run 2024-01-01"
}

Response 201 Created

Created

json
{
    "changesetGroup": {
        "id": "80e7afd9-5df8-4ae0-8810-d1a35069b4a2",
        "state": "inProgress",
        "description": "MicroStation Connector",
        "creatorId": "ea4dfb9f-7f66-4c6f-82c5-0efad1636a1f",
        "createdDateTime": "2024-02-01T11:13:36.6630000Z",
        "_links": {
            "creator": {
                "href": "https://api.bentley.com/imodels/1b68e726-57e0-49b9-8080-7da530c443ce/users/ea4dfb9f-7f66-4c6f-82c5-0efad1636a1f"
            }
        }
    }
}

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 Changeset Group.

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

Response 404 Not Found

Specified iModel was not found.

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

Response 409 Conflict

iModel is not initialized and modify operations are not allowed.

json
{
    "error": {
        "code": "iModelNotInitialized",
        "message": "iModel is not initialized."
    }
}

Response 415 Unsupported Media Type

This response indicates that the user has specified not supported media type in the request.

json
{
    "error": {
        "code": "UnsupportedMediaType",
        "message": "Media Type is not supported."
    }
}

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 create Changeset Group.",
        "details": [{
            "code": "InvalidValue",
            "message": "Provided 'description' value is not valid. The value exceeds allowed 255 characters.",
            "target": "description"
        }]
    }
}

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.

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

Changeset Group (create)

Properties of the Changeset Group to be created.

Name
Type
Description
description
String, null

Description of the new Changeset Group that will be created. Valid description values are strings that are not longer than 255 characters.

Changeset Group Response

Container for Changeset Group object.

Name
Type
Description
changesetGroup

Changeset Group properties.

Changeset Group state

Indicates the state of the Changeset Group. 'inProgress' - indicates that Changeset Group is in progress and Changesets can be pushed to it. 'completed' - indicates that Changeset Group is closed, Changesets cannot be pushed to it anymore. 'timedOut' - indicates that Changeset Group was not completed within the specified timeout period so it was closed by the service, Changesets cannot be pushed to it anymore. forciblyClosed - indicates that Changeset group was forcibly closed before cloning to the target iModel.

Name
Type
Description
inProgress
String
completed
String
timedOut
String
forciblyClosed
String

Changeset Group

Name
Type
Description
id
String

Id of the Changeset Group.

Changeset Group state

Indicates the state of the Changeset Group. 'inProgress' - indicates that Changeset Group is in progress and Changesets can be pushed to it. 'completed' - indicates that Changeset Group is closed, Changesets cannot be pushed to it anymore. 'timedOut' - indicates that Changeset Group was not completed within the specified timeout period so it was closed by the service, Changesets cannot be pushed to it anymore. forciblyClosed - indicates that Changeset group was forcibly closed before cloning to the target iModel.

description
String, null

Description of the Changeset Group.

creatorId
String

Id of the user who created the Changeset Group.

createdDateTime
Date-time

Date when the Changeset Group was created.

_links

Contains the hyperlinks to the related data of the Changeset Group.

Changeset Group Links

Hyperlinks to Changeset Group related data.

Name
Type
Description
creator

Information about the creator of the Changeset Group.

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.