Creates the metadata of a Changeset.
For more information on creating and retrieving Changesets using iTwin.js see working with Changesets.
Important: This operation should only be used by iTwin.js. For creating and uploading a valid Changeset please use iTwin.js libraries.
Pushing a Changeset consists of three steps:
- Create Changeset metadata.
- Upload Changeset file to blob storage using
upload
property link from the response of Changeset metadata creation.
Request syntax:
PUT upload HTTP/1.1
Request headers:
x-ms-blob-type: BlockBlob
- Complete the Changeset push by confirming that Changeset file was uploaded successfully. See Update iModel Changeset operation for the documentation.
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
iModel id
Request headers
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v2+json
is recommended.
Indicates request body content type. Supported media type is application/json
.
Request body
Changeset (create)
Id of the changeset.
Description of the Changeset.
Id of the parent Changeset.
Id of the briefcase that will be used to create the Changeset.
Size of the Changeset file in bytes.
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.
Optional information about synchronization that is related to the Changeset.
Example
{ "id": "1f2e04b666edce395e37a795e2231e995cbf8349", "description": "Changeset 15", "parentId": "f7618612c572d7db8e3e6095d622d0d8aff22874", "containingChanges": 0, "fileSize": 109, "briefcaseId": 2, "groupId": "1a038d01-5b2d-44d9-b4ca-e8d21805983c", "synchronizationInfo": { "changedFiles": [ "File1.dgn" ], "taskId": "5154ac23-d83f-4e82-b708-438fb6d51d4e" } }
Response 201 Created
Created
{ "changeset": { "id": "1f2e04b666edce395e37a795e2231e995cbf8349", "displayName": "256", "description": "Changeset 15", "index": 0, "parentId": "f7618612c572d7db8e3e6095d622d0d8aff22874", "state": "waitingForFile", "containingChanges": 0, "fileSize": 109, "briefcaseId": 2, "groupId": "1a038d01-5b2d-44d9-b4ca-e8d21805983c", "synchronizationInfo": { "changedFiles": [ "File1.dgn", "File2.dgn" ], "taskId": "5154ac23-d83f-4e82-b708-438fb6d51d4e" }, "creatorId": null, "pushDateTime": null, "application": null, "_links": { "creator": null, "namedVersion": null, "currentOrPrecedingCheckpoint": null, "self": { "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets/1f2e04b666edce395e37a795e2231e995cbf8349" }, "upload": { "href": "https://example.com/imodelhub-5e19bee0-3aea-4355-a9f0-c6df9989ee7d/1f2e04b666edce395e37a795e2231e995cbf8349.cs?sv=2019-07-07&sr=b&sig=IKzMBa%2Be3TjSebXj6rWmDHiG4FEoxtPA2vJUyTVZ%2B%2BI%3D&st=2021-07-30T09%3A02%3A10.1944006Z&se=2021-07-30T09%3A22%3A10.1944012Z&sp=rw" }, "complete": { "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets/1f2e04b666edce395e37a795e2231e995cbf8349" } } } }
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 a Changeset.
{ "error": { "code": "InsufficientPermissions", "message": "The user has insufficient permissions for the requested operation." } }
Response 404 Not Found
Specified iModel or Briefcase was not found.
{ "error": { "code": "iModelNotFound", "message": "Requested iModel is not available." } }
Response 409 Conflict
iModel is not initialzied, a Changeset with the same id already exists, 'parentId' property value does not point to the latest changes or another user is currently in a process of pushing a changeset.
{ "error": { "code": "NewerChangesExist", "message": "'parentId' does not match latest Changeset." } }
Response 415 Unsupported Media Type
This response indicates that the user has specified not supported media type in the request.
{ "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)
{ "error": { "code": "InvalidiModelsRequest", "message": "Cannot create Changeset.", "details": [{ "code": "InvalidValue", "message": "Provided 'fileSize' value is not valid. 'fileSize' must be a non-negative integer value.", "target": "fileSize" }, { "code": "MissingRequiredProperty", "message": "Required property is missing.", "target": "id" }, { "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.
{ "error": { "code": "TooManyRequests", "message": "More requests were received than the subscription rate-limit allows." } }
Response headers
The number of requests exceeds the rate-limit for the client subscription.
Changeset (create)
Properties of Changeset to be created.
Id of the changeset.
Description of the Changeset.
Id of the parent Changeset.
Id of the briefcase that will be used to create the Changeset.
Size of the Changeset file in bytes.
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.
Optional information about synchronization that is related to the Changeset.
Created Changeset Response
Container for Created Changeset object.
Created 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.
Created 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.
Id of the changeset.
Display name of the Changeset. Corresponds to Index property.
Description of the Changeset.
Index of the Changeset (increasing, but not necessarily sequential).
Id of the parent Changeset.
Id of the user who created the Changeset.
Date when the Changeset was pushed to iModelHub.
Id of the briefcase that was used to push the Changeset.
Size of the Changeset file in bytes.
Describes what type of 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.
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.
Optional information about synchronization that is related to the Changeset.
Created Changeset Links
Hyperlinks to Changeset related data.
Named Version which was created for Changeset. If this is null then Changeset does not have a Named Version created for it.
Hyperlink to confirm that Changeset file was uploaded and complete pushing a Changeset. See Update iModel Changeset operation.
Hyperlink to get the latest successfully generated checkpoint where applied changeset index is lower or equal to this changeset index.
Link
Hyperlink container.
Hyperlink to the specific entity.
Application
Information about the client application that is related to an entity.
Id of the application.
Application name.
SynchronizationInfo
Information about synchronization that is related to a Changeset. This information is set by applications that perform iModel synchronization.
Id of the synchronization task.
List of source file names that contained changes which were synchronized to this Changeset.
SynchronizationInfo (create)
Information about synchronization that is related to a Changeset. This information is set by applications that perform iModel synchronization.
Id of the synchronization task.
List of source file names that contained changes which were synchronized to this Changeset.
Error
Contains error information.
One of a server-defined set of error codes.
A human-readable representation of the error.
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.
Was this page helpful?