Table of contents
iModels
Download API definition:
PATCH https://qa-api.bentley.com/imodels/{id}/changesetgroups/{changesetGroupId}

Closes an existing Changeset Group.

Please refer to Create iModel Changeset Group operation documentation for information about the purpose of Changeset Groups.

Closing a Changeset Group means that there will be no more Changesets in the logical group, for example, synchronization process has processed all iModel changes and will not push any more Changesets. If a Changeset Group is closed, meaning its state property value is completed, timedOut or forciblyClosed, no more Changesets referencing that particular Group will be accepted. Users can only close the Changeset Group by setting completed state value as other values are set by iModels API.

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

changesetGroupId
Yes

Changeset Group 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 (update)

Name
Type
Required?
Description
Changeset Group (update) state
Yes

Indicates the state of the Changeset Group. Should be set to 'completed'.

Example

json
{
    "state": "completed"
}

Response 200 OK

OK

json
{
    "changesetGroup": {
        "id": "80e7afd9-5df8-4ae0-8810-d1a35069b4a2",
        "state": "completed",
        "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 update a Changeset Group.

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

Response 404 Not Found

Specified iModel or Changeset Group was not found.

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

Response 409 Conflict

Changeset Group is already closed or the iModel is not initialized.

json
{
    "error": {
        "code": "ChangesetGroupIsClosed",
        "message": "Requested Changeset Group is closed."
    }
}

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 update Changeset Group.",
        "details": [{
                "code": "InvalidValue",
                "message": "'abc' is not a valid 'state' value. Valid 'state' values are: 'completed'.",
                "target": "state"
            },
            {
                "code": "MissingRequiredProperty",
                "message": "Required property is missing.",
                "target": "state"
            },
            {
                "code": "InvalidRequestBody",
                "message": "Failed to parse request body. Make sure it is a valid JSON."
            }
        ]
    }
}

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

Changeset Group (update) state

Indicates the state of the Changeset Group. Should be set to 'completed'.

Name
Type
Description
inProgress
String
completed
String
timedOut
String
forciblyClosed
String

Changeset Group (update)

Properties of the Changeset Group to be updated.

Name
Type
Description
Changeset Group (update) state

Indicates the state of the Changeset Group. Should be set to 'completed'.

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.