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

Update metadata of the iModel.

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

Content-Type
No

Indicates request body content type. Supported media type is application/json.

Request body

iModel (update)

Name
Type
Required?
Description
name
String, null
No

Name of the iModel.

description
String, null
No

Description of the iModel.

extent
No

The maximum rectangular area on the Earth which encloses the iModel. The maximum extent is used to help keep your iModel clean. When new elements are imported, those outside the extent will be flagged for further processing. This extent will also help to zoom to the area of interest in web viewers.

Example

json
{
    "name": "Sun City Renewable-energy Plant",
    "description": "Overall model of wind and solar farms in Sun City",
    "extent": {
        "southWest": {
            "latitude": 46.13267702834806,
            "longitude": 7.672120009938448
        },
        "northEast": {
            "latitude": 46.302763954781234,
            "longitude": 7.835541640797823
        }
    }
}

Response 200 OK

OK

json
{
    "iModel": {
        "id": "5e19bee0-3aea-4355-a9f0-c6df9989ee7d",
        "displayName": "Sun City Renewable-energy Plant",
        "dataCenterLocation": "East US",
        "name": "Sun City Renewable-energy Plant",
        "description": "Overall model of wind and solar farms in Sun City",
        "state": "initialized",
        "createdDateTime": "2020-10-20T10:51:33.1700000Z",
        "iTwinId": "ad0ba809-9241-48ad-9eb0-c8038c1a1d51",
        "isSecured": false,
        "extent": {
            "southWest": {
                "latitude": 46.13267702834806,
                "longitude": 7.672120009938448
            },
            "northEast": {
                "latitude": 46.302763954781234,
                "longitude": 7.835541640797823
            }
        },
        "_links": {
            "creator": {
                "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/users/42101fba-847a-4f4e-85a8-a4bed89065e4"
            },
            "changesets": {
                "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/changesets"
            },
            "namedVersions": {
                "href": "https://api.bentley.com/imodels/5e19bee0-3aea-4355-a9f0-c6df9989ee7d/namedversions"
            }
        }
    }
}

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

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

Response 404 Not Found

Requested iModel is not available.

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

Response 409 Conflict

iModel with the same name already exists within the iTwin or the iModel is not initialized.

json
{
    "error": {
        "code": "iModelExists",
        "message": "iModel with the same name already exists within the iTwin."
    }
}

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 iModel.",
        "details": [{
                "code": "InvalidValue",
                "message": "Provided 'extent' value is not valid. Valid 'latitude' value range is -90 to 90.",
                "target": "extent"
            },
            {
                "code": "MissingRequiredProperty",
                "message": "Required property is missing. At least one of the following properties must be provided: 'extent', 'name', 'description'."
            },
            {
                "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.

iModel Response

Container for iModel object.

Name
Type
Description
iModel

iModel properties.

iModel state

Indicates the state of the iModel. Possible values: 'initialized', 'notInitialized'.

Name
Type
Description
initialized
String
notInitialized
String

iModel

Full representation of the iModel.

Name
Type
Description
id
String

Id of the iModel

displayName
String

Display name of the iModel. Corresponds to Name property.

dataCenterLocation
String

The data center where the data for this iModel is persisted. It will be the same as the iTwin data center, unless that data center is not supported or was not supported when the first iTwin iModel was created. All iTwin iModels are in the same region. Default is East US. Possible Values: Australia East, Canada Central, East US, Japan East, North Europe, South Africa North, Southeast Asia, UK South.

name
String

Name of the iModel.

description
String, null

Description of the iModel.

createdDateTime
Date-time

Date when the iModel was created.

iTwinId
String

Id of the iTwin that iModel belongs to.

isSecured
Boolean

Indicates if permissions at the iModel level are configured. true - iModel level permissions are configured. Permissions at iModel level override the iTwin level permissions. false - iModel permissions are not configured and the iTwin level permissions are applied.

extent

The maximum rectangular area on the Earth which encloses the iModel. The maximum extent is used to help keep your iModel clean. When new elements are imported, those outside the extent will be flagged for further processing. This extent will also help to zoom to the area of interest in web viewers.

iModel state

Indicates the state of the iModel. Possible values: 'initialized', 'notInitialized'.

containersEnabled
Integer

Technology Preview property. Reserved for internal use only.

_links

Contains the hyperlinks to the related data of the iModel.

iModel (update)

Properties of the iModel to be updated.

Name
Type
Description
name
String, null

Name of the iModel.

description
String, null

Description of the iModel.

extent

The maximum rectangular area on the Earth which encloses the iModel. The maximum extent is used to help keep your iModel clean. When new elements are imported, those outside the extent will be flagged for further processing. This extent will also help to zoom to the area of interest in web viewers.

iModel Links

Hyperlinks to related data which complements this entity.

Name
Type
Description
creator

Information about the creator of the entity.

changesets

Link to retrieve Changesets of the iModel.

namedVersions

Link to retrieve Named Versions of the iModel.

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

Extent

A rectangular area on the Earth. A rectangular area is defined by two latitudes and two longitudes that represent the four sides of a rectangular area on the Earth.

Name
Type
Description
southWest

South Latitude, West Longitude.

northEast

North Latitude, East Longitude.

Point

A point on the Earth specified by a latitude and longitude.

Name
Type
Description
latitude
Double

Latitude. Latitude ranges between -90 and 90 degrees, inclusive.

longitude
Double

Longitude. Longitude ranges between -180 and 180 degrees, inclusive.

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.

Was this page helpful?