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

Complete iModel creation from Baseline File by confirming that file was uploaded to file storage.

Baseline File is the base iModel file that does not have any changesets applied. For creating an iModel from a custom Baseline File see Create iModel using a Baseline File.

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 the imodels_manage permission assigned at the iTwin level or be an Organization Administrator for the Organization that owns a given iTwin.

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
{
    "baselineFile": {
        "id": "5e19bee0-3aea-4355-a9f0-c6df9989ee7d",
        "displayName": "5e19bee0-3aea-4355-a9f0-c6df9989ee7d.bim",
        "fileSize": 12563,
        "state": "initializationScheduled",
        "_links": {
            "creator": {
                "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/users/42101fba-847a-4f4e-85a8-a4bed89065e4"
            },
            "download": 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 403 Forbidden

User is not authorized to complete Baseline File upload.

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

Response 404 Not Found

Specified iModel was not found, it does not have an associated Baseline File entity or the file was not uploaded to the storage.

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

Response 409 Conflict

File size specified during iModel creation does not match the actual file size of the uploaded file.

json
{
    "error": {
        "code": "DataConflict",
        "message": "File size provided during iModel creation does not match actual file size."
    }
}

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 complete Baseline File upload.",
        "details": [{
            "code": "InvalidChange",
            "message": "Baseline File upload is not in progress."
        }]
    }
}

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.

Baseline File Response

Container for Baseline File object.

Name
Type
Description
baselineFile

Baseline File properties.

Baseline File state

Indicates the state of the Baseline File. 'initialized' - Baseline File is initialized. 'initializationScheduled' - Baseline File creation is complete and initialization is scheduled or currently in progress. 'waitingForFile' - file upload to file storage hasn't been completed yet. 'initializationFailed' - initializing Baseline File failed. 'fileIsBriefcase' - file is not a standalone iModel and cannot be used as a Baseline File.

Name
Type
Description
initialized
String
initializationScheduled
String
initializationFailed
String
waitingForFile
String
fileIsBriefcase
String

Baseline File

Metadata of Baseline File of the iModel.

Name
Type
Description
id
String

Id of the Baseline File.

displayName
String

Name of the Baseline File.

fileSize
Int64

Size of the Baseline File in bytes.

Baseline File state

Indicates the state of the Baseline File. 'initialized' - Baseline File is initialized. 'initializationScheduled' - Baseline File creation is complete and initialization is scheduled or currently in progress. 'waitingForFile' - file upload to file storage hasn't been completed yet. 'initializationFailed' - initializing Baseline File failed. 'fileIsBriefcase' - file is not a standalone iModel and cannot be used as a Baseline File.

_links

Contains the hyperlinks to the related data of the Baseline File.

Baseline File Links

Hyperlinks to Briefcase related data.

Name
Type
Description
creator

Information about the creator of the Baseline File.

download
Link, null

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

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

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.