Creates an iModel. There are four different ways to create an iModel.
1. Create an empty iModel
To create an empty iModel provide empty
creation mode and do not provide template
and baselineFile
properties.
2. Create an iModel from an existing iModel
To create an iModel from another iModel provide fromiModelVersion
creation mode and template
property. The server will apply changesets up to the one specified by changesetId
property to the source iModel file and use it as a Baseline File for the newly created iModel. User must have imodels_read
permissions to the source iModel. Source and target iTwins must be in the same data center.
3. Create an iModel using a Baseline File
Creating an iModel using a Baseline File allows to upload a custom iModel file that will become the base file of the created iModel. There are three steps in creating an iModel from a Baseline File:
-
Create a new iModel and provide
fromBaseline
creation mode andbaselineFile
property. It is important to provide correct file size or the iModel creation will fail in the later steps. -
Upload Baseline File to cloud storage using
upload
property link from the response of iModel creation.
Request syntax:
PUT upload HTTP/1.1
For Azure Blob storage the following request header is required: x-ms-blob-type: BlockBlob
.
- Complete the iModel creation by confirming that Baseline File was uploaded successfully. See Complete iModel Baseline Upload operation for the documentation.
4. Create an empty instantly initialized iModel (deprecated)
To create an empty instantly initialized iModel do not provide creationMode
, template
and baselineFile
properties.
This creation mode has been deprecated due to some limitations (e.g. geographicCoordinateSystem
cannot be set) and might be removed in future versions of the API.
iModel initialization
When creating an empty instantly initialized iModel it will be initialized immediately. In all other cases initialization will be scheduled and it's state is reflected in the state
property. For a more detailed information about initialization state see Get iModel Baseline File operation.
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
This operation has a lower rate limit than the rest of iModels API operations. If an application exceeds the rate limit it will receive an HTTP error code 429 "Too Many Requests". The error response includes a Retry-After header that indicates how long clients should wait before retrying.
---
Request headers
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v2+json
is recommended.
Indicates request body content type. Supported media type is application/json
.
Request body
iModelCreate (EmptyiModel)
Id of the iTwin that created iModel should belong to.
Name of the iModel.
Description of the iModel.
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.
The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.
The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel.
Example
{ "iTwinId": "ad0ba809-9241-48ad-9eb0-c8038c1a1d51", "name": "Sun City Renewable-energy Plant", "description": "Overall model of wind and solar farms in Sun City", "creationMode": "empty", "extent": { "southWest": { "latitude": 46.13267702834806, "longitude": 7.672120009938448 }, "northEast": { "latitude": 46.302763954781234, "longitude": 7.835541640797823 } }, "template": null, "baselineFile": null, "geographicCoordinateSystem": { "horizontalCRSId": "EPSG:4326" } }
iModelCreate (FromiModelVersion)
Id of the iTwin that created iModel should belong to.
Name of the iModel.
Description of the iModel.
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.
The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.
The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel.
Example
{ "iTwinId": "ad0ba809-9241-48ad-9eb0-c8038c1a1d51", "name": "Sun City Renewable-energy Plant", "description": "Overall model of wind and solar farms in Sun City", "creationMode": "fromiModelVersion", "extent": { "southWest": { "latitude": 46.13267702834806, "longitude": 7.672120009938448 }, "northEast": { "latitude": 46.302763954781234, "longitude": 7.835541640797823 } }, "template": { "iModelId": "5e19bee0-3aea-4355-a9f0-c6df9989ee7d", "changesetId": "1f2e04b666edce395e37a795e2231e995cbf8349" }, "baselineFile": null, "geographicCoordinateSystem": { "horizontalCRSId": "EPSG:4326" } }
iModelCreate (FromBaseline)
Id of the iTwin that created iModel should belong to.
Name of the iModel.
Description of the iModel.
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.
The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.
The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel.
Example
{ "iTwinId": "ad0ba809-9241-48ad-9eb0-c8038c1a1d51", "name": "Sun City Renewable-energy Plant", "description": "Overall model of wind and solar farms in Sun City", "creationMode": "fromBaseline", "extent": { "southWest": { "latitude": 46.13267702834806, "longitude": 7.672120009938448 }, "northEast": { "latitude": 46.302763954781234, "longitude": 7.835541640797823 } }, "template": null, "baselineFile": { "size": 12003548 }, "geographicCoordinateSystem": { "horizontalCRSId": "EPSG:4326" } }
iModelCreate (EmptyInstantlyInitializediModel)
Id of the iTwin that created iModel should belong to.
Name of the iModel.
Description of the iModel.
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.
The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.
The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel.
Example
{ "iTwinId": "ad0ba809-9241-48ad-9eb0-c8038c1a1d51", "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 } }, "template": null, "baselineFile": null }
Response 201 Created
Created
{ "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": "notInitialized", "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" }, "upload": null, "complete": 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.
{ "error": { "code": "HeaderNotFound", "message": "Header Authorization was not found in the request. Access denied." } }
Response 403 Forbidden
User is not authorized to create an iModel.
{ "error": { "code": "InsufficientPermissions", "message": "The user has insufficient permissions for the requested operation." } }
Response 404 Not Found
Specified iTwin was not found.
{ "error": { "code": "iTwinNotFound", "message": "Requested iTwin is not available." } }
Response 409 Conflict
iModel with the same name already exists within the iTwin.
{ "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.
{ "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)
{ "error": { "code": "InvalidiModelsRequest", "message": "Cannot create 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.", "target": "name" }, { "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.
{ "error": { "code": "RateLimitExceeded", "message": "The client sent more requests than allowed by this API for the current tier of the client." } }
Response headers
Number of seconds to wait until client is allowed to make more requests.
Created iModel Response
Container for iModel object.
{ "type": "object", "title": "Created iModel Response", "description": "Container for iModel object.", "properties": { "iModel": { "$ref": "#/components/schemas/CreatediModel", "description": "iModel properties." } }, "additionalProperties": false }
CreatediModel state
Indicates the state of the iModel. Possible values: 'initialized', 'notInitialized'.
{ "type": "string", "description": "Indicates the state of the iModel. Possible values: 'initialized', 'notInitialized'.", "enum": [ "initialized", "notInitialized" ], "title": "CreatediModel state" }
CreatediModel
Full representation of the iModel.
Id of the iModel
Display name of the iModel. Corresponds to Name property.
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 of the iModel.
Description of the iModel.
Date when the iModel was created.
Id of the iTwin that iModel belongs to.
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.
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.
Indicates the state of the iModel. Possible values: 'initialized', 'notInitialized'.
Technology Preview property. Reserved for internal use only.
{ "type": "object", "description": "Full representation of the iModel.", "properties": { "id": { "type": "string", "description": "Id of the iModel" }, "displayName": { "type": "string", "description": "Display name of the iModel. Corresponds to Name property." }, "dataCenterLocation": { "type": "string", "description": "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": { "type": "string", "description": "Name of the iModel." }, "description": { "type": "string", "description": "Description of the iModel.", "nullable": true }, "createdDateTime": { "type": "string", "format": "date-time", "description": "Date when the iModel was created." }, "iTwinId": { "type": "string", "description": "Id of the iTwin that iModel belongs to." }, "isSecured": { "type": "boolean", "description": "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": { "description": "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.", "$ref": "#/components/schemas/Extent" }, "state": { "type": "string", "description": "Indicates the state of the iModel. Possible values: 'initialized', 'notInitialized'.", "enum": [ "initialized", "notInitialized" ], "title": "CreatediModel state", "$ref": "#/components/schemas/CreatediModel-state" }, "containersEnabled": { "type": "integer", "description": "**Technology Preview** property. Reserved for internal use only." }, "_links": { "$ref": "#/components/schemas/CreatediModelLinks", "description": "Contains the hyperlinks to the related data of the iModel." } }, "additionalProperties": false }
iModel (create) creationMode
The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.
{ "type": "string", "description": "The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.", "nullable": true, "enum": [ "empty", "fromiModelVersion", "fromBaseline" ], "title": "iModel (create) creationMode" }
iModel (create)
Properties of the iModel to be created.
Id of the iTwin that created iModel should belong to.
Name of the iModel.
Description of the iModel.
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.
The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.
The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel.
{ "type": "object", "title": "iModel (create)", "description": "Properties of the iModel to be created.", "properties": { "iTwinId": { "type": "string", "description": "Id of the iTwin that created iModel should belong to." }, "name": { "type": "string", "description": "Name of the iModel." }, "description": { "type": "string", "description": "Description of the iModel.", "nullable": true }, "extent": { "$ref": "#/components/schemas/Extent", "description": "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." }, "creationMode": { "type": "string", "description": "The mode of iModel creation. Possible values: 'empty', 'fromiModelVersion', 'fromBaseline'. If not provided empty instantly initialized iModel is created.", "nullable": true, "enum": [ "empty", "fromiModelVersion", "fromBaseline" ], "title": "iModel (create) creationMode", "$ref": "#/components/schemas/iModelCreate-creationMode" }, "template": { "$ref": "#/components/schemas/iModelTemplate", "description": "When specified creates the iModel using another iModel as a template." }, "baselineFile": { "$ref": "#/components/schemas/BaselineFileCreate", "description": "When specified creates the iModel using a custom Baseline File." }, "geographicCoordinateSystem": { "$ref": "#/components/schemas/GeographicCoordinateSystem", "description": "The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel." } }, "required": [ "name", "iTwinId" ], "additionalProperties": false }
iModel Template
Used for specifying the iModel template during iModel creation.
Id of the iModel which to use as a template.
iModel timeline point to use as a template identified by the Changeset. When Changeset is not provided baseline is used.
{ "type": "object", "nullable": true, "title": "iModel Template", "description": "Used for specifying the iModel template during iModel creation.", "properties": { "iModelId": { "type": "string", "description": "Id of the iModel which to use as a template." }, "changesetId": { "type": "string", "description": "iModel timeline point to use as a template identified by the Changeset. When Changeset is not provided baseline is used.", "nullable": true } }, "required": [ "iModelId" ], "additionalProperties": false }
Baseline File
Used for describing Baseline File during iModel creation.
Size of the Baseline File in bytes. It is important to set accurate file size or the iModel creation will fail later.
{ "type": "object", "nullable": true, "title": "Baseline File", "description": "Used for describing Baseline File during iModel creation.", "properties": { "size": { "type": "integer", "format": "int64", "description": "Size of the Baseline File in bytes. It is important to set accurate file size or the iModel creation will fail later." } }, "required": [ "size" ], "additionalProperties": false }
Geographic Coordinate System
The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel.
Id of the horizontal Coordinate Reference System (CRS) used by the iModel.
{ "type": "object", "nullable": true, "title": "Geographic Coordinate System", "description": "The Geographic Coordinate System (GCS) used by the iModel. The GCS is used to define the spatial reference system of the iModel. Adding the GCS ensures that all data synchronized with the iModel is converted to the specified GCS, maintaining spatial consistency across the iModel.", "properties": { "horizontalCRSId": { "type": "string", "description": "Id of the horizontal Coordinate Reference System (CRS) used by the iModel." } }, "required": [ "horizontalCRSId" ], "additionalProperties": false }
Created iModel Links
Hyperlinks to related data which complements this entity.
Hyperlink to confirm that Baseline File was uploaded. See Complete Baseline File upload operation.
{ "type": "object", "title": "Created iModel Links", "description": "Hyperlinks to related data which complements this entity.", "properties": { "creator": { "$ref": "#/components/schemas/Link", "description": "Information about the creator of the entity." }, "changesets": { "$ref": "#/components/schemas/Link", "description": "Link to retrieve Changesets of the iModel." }, "namedVersions": { "$ref": "#/components/schemas/Link", "description": "Link to retrieve Named Versions of the iModel." }, "upload": { "$ref": "#/components/schemas/CloudStorageLink", "description": "Hyperlink to upload Baseline File to storage." }, "complete": { "$ref": "#/components/schemas/Link", "description": "Hyperlink to confirm that Baseline File was uploaded. See Complete Baseline File upload operation." } }, "additionalProperties": false }
Link
Hyperlink container.
Hyperlink to the specific entity.
{ "type": "object", "nullable": true, "description": "Hyperlink container.", "properties": { "href": { "type": "string", "description": "Hyperlink to the specific entity." } }, "additionalProperties": false }
CloudStorageLink storageType
Storage type. Possible values: azure
- Azure Blob storage, google
- Google Cloud storage.
{ "type": "string", "description": "Storage type. Possible values: `azure` - Azure Blob storage, `google` - Google Cloud storage.", "enum": [ "azure", "google" ], "title": "CloudStorageLink storageType" }
CloudStorageLink
Hyperlink container.
Hyperlink to cloud storage.
Storage type. Possible values: azure
- Azure Blob storage, google
- Google Cloud storage.
{ "type": "object", "nullable": true, "description": "Hyperlink container.", "properties": { "href": { "type": "string", "description": "Hyperlink to cloud storage." }, "storageType": { "type": "string", "description": "Storage type. Possible values: `azure` - Azure Blob storage, `google` - Google Cloud storage.", "enum": [ "azure", "google" ], "title": "CloudStorageLink storageType", "$ref": "#/components/schemas/CloudStorageLink-storageType" } }, "additionalProperties": false }
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.
{ "type": "object", "nullable": true, "description": "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.", "properties": { "southWest": { "$ref": "#/components/schemas/Point", "description": "South Latitude, West Longitude." }, "northEast": { "$ref": "#/components/schemas/Point", "description": "North Latitude, East Longitude." } }, "required": [ "southWest", "northEast" ], "additionalProperties": false }
Point
A point on the Earth specified by a latitude and longitude.
Latitude. Latitude ranges between -90 and 90 degrees, inclusive.
Longitude. Longitude ranges between -180 and 180 degrees, inclusive.
{ "type": "object", "description": "A point on the Earth specified by a latitude and longitude.", "properties": { "latitude": { "type": "number", "format": "double", "minimum": -90, "maximum": 90, "description": "Latitude. Latitude ranges between -90 and 90 degrees, inclusive." }, "longitude": { "type": "number", "format": "double", "minimum": -180, "maximum": 180, "description": "Longitude. Longitude ranges between -180 and 180 degrees, inclusive." } }, "required": [ "longitude", "latitude" ], "additionalProperties": false }
Error
Contains error information.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true } }, "required": [ "code", "message" ], "additionalProperties": true }
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.
{ "type": "object", "title": "Error Response", "description": "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.", "properties": { "error": { "description": "Error information.", "$ref": "#/components/schemas/Error" } }, "required": [ "error" ], "additionalProperties": false }
Was this page helpful?