Table of contents
iModels
Download API definition:
GET https://dev-api.bentley.com/imodels/?iTwinId[&$skip][&$top][&$orderBy][&$search][&name][&state]

Retrieves a list of iModels belonging to the specified iTwin.

Notes

The Prefer header can be used to specify how much result metadata is desired by the client. The Prefer request header field is used to indicate that particular server behaviors are preferred by the client but are not required for successful completion of the request.

This operation supports "return=representation" and "return=minimal" preferences.

The "return=representation" preference indicates that the client prefers that the server include an entity representing the current state of the resource in the response to a successful request. The "return=minimal" preference indicates that the client wishes the server to return only a minimal response to a successful request. This is the default preference if Prefer header is not specified.

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
iTwinId
Yes

Id of the iTwin.

$skip
No

The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. E.g. to return items from the collection starting at the third place provide the following query: $skip=2.

$top
No

The $top query option requests the number of items in the queried collection to be included in the result. E.g. to return only first collection item provide the following query: $top=1. When $top parameter is not provided default is set to 100. $top value cannot exceed 1000.

$orderBy
No

The $orderBy query option allows clients to request ascending using 'asc' or descending using 'desc' order of the returned collection by one or more item properties. Currently supported properties for iModels are 'name' and 'createdDateTime'. When neither 'asc' or 'desc' keyword is specified the collection is sorted in ascending order. To sort the collection in descending order provide 'desc' keyword e.g.: $orderBy=name desc,createdDateTime desc

$search
No

The $search query option allows users to filter iModels whose name or description property contains the search string. E.g. to return iModels whose name or description contains 'Sun City', provide the following query: $search=Sun%20City. This parameter cannot be used at the same time as the name parameter. Valid values for this parameter are non-empty strings that are not longer than 255 characters.

name
No

The name query option allows users to filter iModels by their name property. E.g. to return iModels that have a name equal to 'Sun City Renewable-energy Plant' provide the following query: name=Sun%20City%20Renewable-energy%20Plant. Valid values for this parameter follow the same requirements as for iModel creation - strings should be not empty, consist not only of whitespace and not exceed 255 characters. This query option uses exact matching.

state
No

The state query option allows users to filter iModels by their state property. To return iModels that are initialized, provide initialized keyword e.g.: state=initialized. Valid values for this parameter are 'initialized' or 'notInitialized'.

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.

Prefer
No

Indicates a level of details in the response. This operation supports 'return=representation' and 'return=minimal' preferences.

Response 200 OK

OK

json
{
    "iModels": [{
            "id": "758bdcde-567a-43e0-9321-c7897cced698",
            "displayName": "Sun City Renewable-energy Plant",
            "dataCenterLocation": "East US"
        },
        {
            "id": "b44460c9-b61d-422c-9422-d36497c3dd04",
            "displayName": "Power Town Processing Plant",
            "dataCenterLocation": "East US"
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.bentley.com/imodels?iTwinId=ad0ba809-9241-48ad-9eb0-c8038c1a1d51&$skip=0&$top=100"
        },
        "prev": {
            "href": "https://api.bentley.com/imodels?iTwinId=ad0ba809-9241-48ad-9eb0-c8038c1a1d51&$skip=0&$top=100"
        },
        "next": {
            "href": "https://api.bentley.com/imodels?iTwinId=ad0ba809-9241-48ad-9eb0-c8038c1a1d51&$skip=100&$top=100"
        }
    }
}

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 iTwin was not found.

json
{
    "error": {
        "code": "iTwinNotFound",
        "message": "Requested iTwin is not available."
    }
}

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 get iModels.",
        "details": [{
            "code": "InvalidValue",
            "message": "'abc' is not a valid 'iTwinId' value.",
            "target": "iTwinId"
        }]
    }
}

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 (summary)

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

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.

iModels (prefer return=minimal)

List of iModels.

Name
Type
Description
iModels

List of iModels.

_links

Contains the hyperlinks to the previous and next pages of results.

iModels (prefer return=representation)

List of iModels.

Name
Type
Description
iModels

List of iModels.

_links

Contains the hyperlinks to the previous and next pages of results.

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.

Paging Links

URLs for redoing the current request, getting to the previous or next page of results, if applicable.

Name
Type
Description
self

URL for redoing the current request.

prev

URL for getting the previous page of results.

next

URL for getting the next page of results.

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?