Table of contents
iModels
Download API definition:
GET https://dev-api.bentley.com/imodels/{id}/operations/create

Returns the information about iModel creation process.

This endpoint should be used to check if iModel creation completed.

Forked and cloned iModels

When an iModel is a clone, the clonedFrom response entity property will contain information about the source iModel from which this iModel was created, otherwise it will be null. For more information on iModel cloning please refer to the Clone iModel operation documentation.

When an iModel is a fork, the forkedFrom response entity property will contain information about the main iModel from which this iModel was created, otherwise it will be null. For more information on iModel forking please refer to the Fork iModel operation documentation.

To get the details of the source/main iModel use Get iModel Details operation with id value taken from clonedFrom.iModelId or forkedFrom.iModelId.

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.

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.

Response 200 OK

OK

json
{
    "createOperation": {
        "state": "scheduled",
        "clonedFrom": {
            "iModelId": "5e19bee0-3aea-4355-a9f0-c6df9989ee7d",
            "changesetId": "13a61888798b687d41f7c748d7414b428766281f"
        },
        "forkedFrom": null
    }
}

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

Create iModel Operation Response

Container for Create iModel Operation object.

Name
Type
Description
createOperation

Create iModel Operation.

Create iModel operation state

Indicates the current state of the iModel creation process. 'successful' - iModel creation process completed successfully. 'waitingForFile' - iModel is being created from a Baseline File and the file upload to file storage has not been completed yet. scheduled - iModel creation process is scheduled or in progress. This means that the iModel was created using one of the following methods that require background processing: creating an iModel from Baseline File, cloning an iModel, creating an iModel from template. failed - iModel creation process failed. mainIModelIsMissingFederationGuids - iModel fork creation failed because some elements in the main iModel do not have FederationGuid property set.

Name
Type
Description
successful
String
waitingForFile
String
scheduled
String
failed
String
mainIModelIsMissingFederationGuids
String

Create iModel operation

Information about iModel creation process.

Name
Type
Description
Create iModel operation state

Indicates the current state of the iModel creation process. 'successful' - iModel creation process completed successfully. 'waitingForFile' - iModel is being created from a Baseline File and the file upload to file storage has not been completed yet. scheduled - iModel creation process is scheduled or in progress. This means that the iModel was created using one of the following methods that require background processing: creating an iModel from Baseline File, cloning an iModel, creating an iModel from template. failed - iModel creation process failed. mainIModelIsMissingFederationGuids - iModel fork creation failed because some elements in the main iModel do not have FederationGuid property set.

clonedFrom

Information about the source iModel of an iModel clone. If the iModel is not created using Clone iModel operation, the value of this property will be null.

forkedFrom

Information about the main iModel of an iModel fork. If the iModel is not created using Fork iModel operation, the value of this property will be null.

Cloned From

Information about the source iModel of an iModel clone. This information will only be returned for iModels created using Clone iModel operation.

Name
Type
Description
iModelId
String

Id of the source iModel.

changesetId
String

Id of the latest source iModel Changeset which was copied to this iModel. This corresponds to the Changeset specified in changesetId or changesetIndex properties when cloning an iModel. If changesetId is an empty string it means that no Changesets were copied from the source iModel to this one, only iModel Baseline.

Forked From

Information about the main iModel of an iModel fork. This information will only be returned for iModels created using Fork iModel operation.

Name
Type
Description
iModelId
String

Id of the main iModel.

changesetId
String

Id of the latest main iModel Changeset which was copied to this iModel. This corresponds to the Changeset specified in changesetId or changesetIndex properties when forking an iModel. If changesetId is an empty string it means that no Changesets were copied from the main iModel to this one, only iModel Baseline.

relationshipId
String

Id of the Relationship entity that links main and fork iModels.

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.