Table of contents
iModels
Download API definition:
patch https://dev-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.

extent
No
description
String, null
No

Description of the iModel.

Example

json
{
    "name": "Sun City Renewable-energy Plant",
    "description": "Overall model of wind and solar farms in Sun City",
    "extent": {
        "southWest": {
            "latitude": 46.1326770283481,
            "longitude": 7.67212000993845
        },
        "northEast": {
            "latitude": 46.3027639547812,
            "longitude": 7.83554164079782
        }
    }
}

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.1700000+00:00",
        "lastChangesetPushDateTime": null,
        "iTwinId": "ad0ba809-9241-48ad-9eb0-c8038c1a1d51",
        "isSecured": false,
        "extent": {
            "southWest": {
                "latitude": 46.1326770283481,
                "longitude": 7.67212000993845
            },
            "northEast": {
                "latitude": 46.3027639547812,
                "longitude": 7.83554164079782
            }
        },
        "_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 client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

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.

target
String, null

The target of the error.

message
String

A human-readable representation of the error.

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.

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
northEast
southWest

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

name
String

Name of the iModel.

iModel state

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

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

description
String, null

Description of the iModel.

displayName
String

Display name of the iModel. Corresponds to Name property.

createdDateTime
Date-time

Date when the iModel was created.

containersEnabled
Integer

Technology Preview property. Reserved for internal use only.

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.

lastChangesetPushDateTime
Date-time, null

Date when the latest changeset was pushed to the iModel. This field is only set when at least one changeset has been pushed to the main branch. Null if no changeset has been pushed yet.

iModel Links

Hyperlinks to related data which complements this entity.

Name
Type
Description
creator
changesets
namedVersions

iModel (update)

Properties of the iModel to be updated.

Name
Type
Description
name
String, null

Name of the iModel.

extent
description
String, null

Description of the iModel.

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.

iModel Response

Container for iModel object.

Name
Type
Description
iModel

Was this page helpful?