Imports a form definition into one iTwin from another iTwin in your organization. Use this to copy a form definition or to share a form definition so that multiple iTwins can use it to fill out forms. You can also use this endpoint's "Upsert" importAction
to update a previously-imported form definition to match the current contents of the original one it was imported from--useful to quickly distribute a form layout change to multiple iTwins in your project.
If you want to import one of Bentley's publicly available template form definitions, use the Import templates
endpoint instead.
Note If you set importAction
to "Copy", then some properties of the form definition (status
, type
, displayName
, and idPrefix
) can be set as part of the import request. These changes will be applied to the new copy of the form definition in the destination iTwin, but will not affect the original form definition.
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.
Request headers
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v1+json
is recommended.
Request body
Form Definition Import Request
The ID of the form definition to import, as retrieved from querying its source iTwin with the Get iTwin form definitions
endpoint.
The ID of the iTwin to import the form definition into.
The type of import to perform. 'Copy' makes a copy of the chosen form definition that's local to this iTwin. If the chosen form definition has already been imported into this iTwin, then 'Upsert' updates the copy in this iTwin to match the chosen form definition from the remote iTwin; otherwise, it behaves like 'Copy'. 'Share' is only valid if the form definition's shareType
is not null, and allows this iTwin to also use that form definition without making a new copy of it. Default is 'Copy'.
Only valid if importAction
is 'Copy' or unset. This allows you to change what form type the imported copy of the form definition in this iTwin will belong to. This property of the form definition cannot be changed after import.
Only valid if importAction
is 'Copy' or unset. This allows you to set what status the imported copy of the form definition will begin in. Default is 'Draft'.
Only valid if importAction
is 'Copy' or unset. This allows you to choose a new display name for the imported copy of the form definition in this iTwin.
Only valid if importAction
is 'Copy' or unset. This lets you set a new ID prefix for the imported copy of the form definition in this iTwin.
Example
{ "sourceFormDefinitionId": "MxHv9-X0098eXzc610de-OCC8sUvYetD1Ih_USg10wg", "destinationITwinId": "7ac45d38-3a81-4b09-adac-761c2a489c3f", "importAction": "Copy", "type": "Work Package", "status": "Approved", "displayName": "Work Package Form 123", "idPrefix": "123WP" }
Response 200 OK
The results of the form definition import request, showing the ID of the created or modified form definition in the destination iTwin.
{ "formDefinition": { "id": "yr6439iduemhNz19awLcRgpmdeuytxZEhB123456789", "displayName": "Work Package Form 123", "type": "Work Package", "status": "Approved", "idPrefix": "123WP", "errorStatus": "None", "_links": { "design": { "href": "https://connect-formmanager.bentley.com/designer/#/00000000-0000-0000-0000-000000000000/design/11111111-1111-1111-1111-111111111111" } } } }
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 404 Not Found
Indicates that the form definition or the iTwin to import into was either not found or inaccessible to the user.
{ "error": { "code": "FormDefNotFound", "message": "Requested form definition is not available.", "target": "id" } }
Response 422 Unprocessable Entity
This response indicates that there is a problem with the request body--either a missing property or invalid property value.
{ "error": { "code": "InvalidImportRequest", "message": "Cannot import form definition.", "details": [{ "code": "MissingRequiredProperty", "message": "The 'sourceFormDefinitionId' property must be provided.", "target": "sourceFormDefinitionId" }] } }
Response 429 Too many requests
This response indicates that the user has sent too many requests in a given amount of time.
{ "error": { "code": "TooManyRequests", "message": "More requests were received than the subscription rate-limit allows." } }
Response headers
The number of requests exceeds the rate-limit for the client subscription.
Form Definition Summary status
Whether this form definition is available for use. Possible values: Draft
or Maintenance
means users can edit its layout, but not fill out instances of it. Approved
means users can fill it out, but not edit its layout. Archived
allows neither.
{ "type": "string", "description": "Whether this form definition is available for use. Possible values: `Draft` or `Maintenance` means users can edit its layout, but not fill out instances of it. `Approved` means users can fill it out, but not edit its layout. `Archived` allows neither.", "enum": [ "Draft", "Approved", "Maintenance", "Archived" ], "title": "Form Definition Summary status" }
Form Definition Summary shareType
Whether this form definition can be used in multiple iTwins. A value of null
means it cannot. 'ReadOnly'
and 'ReadWrite'
mean it can. 'ReadOnly'
means its layout can only be edited from its original iTwin, and 'ReadWrite'
means its layout can be edited from any iTwin in the organization.
{ "type": "string", "description": "Whether this form definition can be used in multiple iTwins. A value of `null` means it cannot. `'ReadOnly'` and `'ReadWrite'` mean it can. `'ReadOnly'` means its layout can only be edited from its original iTwin, and `'ReadWrite'` means its layout can be edited from any iTwin in the organization.", "enum": [ null, "ReadOnly", "ReadWrite" ], "nullable": true, "title": "Form Definition Summary shareType" }
Form Definition Summary errorStatus
String describing whether the form definition has problems that could prevent it from displaying (Warning) or functioning (Error or Critical) correctly. Possible values: 'None', 'Warning', 'Error', 'Critical', 'Unknown'.
{ "type": "string", "description": "String describing whether the form definition has problems that could prevent it from displaying (Warning) or functioning (Error or Critical) correctly. Possible values: 'None', 'Warning', 'Error', 'Critical', 'Unknown'.", "enum": [ "None", "Warning", "Error", "Critical", "Unknown" ], "title": "Form Definition Summary errorStatus" }
Form Definition Summary
Unique ID for this form definition.
The name of this form definition as it is displayed to users in the Form Manager UI and Forms webapp UI.
The form type that can be created from this form definition.
Whether this form definition is available for use. Possible values: Draft
or Maintenance
means users can edit its layout, but not fill out instances of it. Approved
means users can fill it out, but not edit its layout. Archived
allows neither.
Whether this form definition can be used in multiple iTwins. A value of null
means it cannot. 'ReadOnly'
and 'ReadWrite'
mean it can. 'ReadOnly'
means its layout can only be edited from its original iTwin, and 'ReadWrite'
means its layout can be edited from any iTwin in the organization.
A prefix that appears in front of the auto-incrementing number
property of each filled-out instance created from this form definition. Can be null, in which case the system fills in the prefix based on the form's type.
String describing whether the form definition has problems that could prevent it from displaying (Warning) or functioning (Error or Critical) correctly. Possible values: 'None', 'Warning', 'Error', 'Critical', 'Unknown'.
{ "type": "object", "title": "Form Definition Summary", "properties": { "id": { "type": "string", "description": "Unique ID for this form definition." }, "displayName": { "type": "string", "description": "The name of this form definition as it is displayed to users in the Form Manager UI and Forms webapp UI." }, "type": { "type": "string", "description": "The form type that can be created from this form definition." }, "status": { "type": "string", "description": "Whether this form definition is available for use. Possible values: `Draft` or `Maintenance` means users can edit its layout, but not fill out instances of it. `Approved` means users can fill it out, but not edit its layout. `Archived` allows neither.", "enum": [ "Draft", "Approved", "Maintenance", "Archived" ], "title": "Form Definition Summary status", "$ref": "#/components/schemas/form-definition-summary-representation-status" }, "shareType": { "type": "string", "description": "Whether this form definition can be used in multiple iTwins. A value of `null` means it cannot. `'ReadOnly'` and `'ReadWrite'` mean it can. `'ReadOnly'` means its layout can only be edited from its original iTwin, and `'ReadWrite'` means its layout can be edited from any iTwin in the organization.", "enum": [ null, "ReadOnly", "ReadWrite" ], "nullable": true, "title": "Form Definition Summary shareType", "$ref": "#/components/schemas/form-definition-summary-representation-shareType" }, "idPrefix": { "type": "string", "description": "A prefix that appears in front of the auto-incrementing `number` property of each filled-out instance created from this form definition. Can be null, in which case the system fills in the prefix based on the form's type.", "nullable": true }, "errorStatus": { "type": "string", "description": "String describing whether the form definition has problems that could prevent it from displaying (Warning) or functioning (Error or Critical) correctly. Possible values: 'None', 'Warning', 'Error', 'Critical', 'Unknown'.", "enum": [ "None", "Warning", "Error", "Critical", "Unknown" ], "title": "Form Definition Summary errorStatus", "$ref": "#/components/schemas/form-definition-summary-representation-errorStatus" }, "_links": { "$ref": "#/components/schemas/form-definition-design-links" } }, "required": [ "id", "displayName", "type", "status" ], "additionalProperties": false }
Form Definition Import Request importAction
The type of import to perform. 'Copy' makes a copy of the chosen form definition that's local to this iTwin. If the chosen form definition has already been imported into this iTwin, then 'Upsert' updates the copy in this iTwin to match the chosen form definition from the remote iTwin; otherwise, it behaves like 'Copy'. 'Share' is only valid if the form definition's shareType
is not null, and allows this iTwin to also use that form definition without making a new copy of it. Default is 'Copy'.
{ "type": "string", "description": "The type of import to perform. 'Copy' makes a copy of the chosen form definition that's local to this iTwin. If the chosen form definition has already been imported into this iTwin, then 'Upsert' updates the copy in this iTwin to match the chosen form definition from the remote iTwin; otherwise, it behaves like 'Copy'. 'Share' is only valid if the form definition's `shareType` is not null, and allows this iTwin to also use that form definition without making a new copy of it. Default is 'Copy'.", "enum": [ "Copy", "Upsert", "Share" ], "title": "Form Definition Import Request importAction" }
Form Definition Import Request status
Only valid if importAction
is 'Copy' or unset. This allows you to set what status the imported copy of the form definition will begin in. Default is 'Draft'.
{ "type": "string", "description": "Only valid if `importAction` is 'Copy' or unset. This allows you to set what status the imported copy of the form definition will begin in. Default is 'Draft'.", "enum": [ "Draft", "Approved", "Maintenance", "Archived" ], "title": "Form Definition Import Request status" }
Form Definition Import Request
The ID of the form definition to import, as retrieved from querying its source iTwin with the Get iTwin form definitions
endpoint.
The ID of the iTwin to import the form definition into.
The type of import to perform. 'Copy' makes a copy of the chosen form definition that's local to this iTwin. If the chosen form definition has already been imported into this iTwin, then 'Upsert' updates the copy in this iTwin to match the chosen form definition from the remote iTwin; otherwise, it behaves like 'Copy'. 'Share' is only valid if the form definition's shareType
is not null, and allows this iTwin to also use that form definition without making a new copy of it. Default is 'Copy'.
Only valid if importAction
is 'Copy' or unset. This allows you to change what form type the imported copy of the form definition in this iTwin will belong to. This property of the form definition cannot be changed after import.
Only valid if importAction
is 'Copy' or unset. This allows you to set what status the imported copy of the form definition will begin in. Default is 'Draft'.
Only valid if importAction
is 'Copy' or unset. This allows you to choose a new display name for the imported copy of the form definition in this iTwin.
Only valid if importAction
is 'Copy' or unset. This lets you set a new ID prefix for the imported copy of the form definition in this iTwin.
{ "type": "object", "title": "Form Definition Import Request", "properties": { "sourceFormDefinitionId": { "type": "string", "description": "The ID of the form definition to import, as retrieved from querying its source iTwin with the `Get iTwin form definitions` endpoint." }, "destinationITwinId": { "type": "string", "description": "The ID of the iTwin to import the form definition into." }, "importAction": { "type": "string", "description": "The type of import to perform. 'Copy' makes a copy of the chosen form definition that's local to this iTwin. If the chosen form definition has already been imported into this iTwin, then 'Upsert' updates the copy in this iTwin to match the chosen form definition from the remote iTwin; otherwise, it behaves like 'Copy'. 'Share' is only valid if the form definition's `shareType` is not null, and allows this iTwin to also use that form definition without making a new copy of it. Default is 'Copy'.", "enum": [ "Copy", "Upsert", "Share" ], "title": "Form Definition Import Request importAction", "$ref": "#/components/schemas/form-definition-import-request-importAction" }, "type": { "type": "string", "description": "Only valid if `importAction` is 'Copy' or unset. This allows you to change what form type the imported copy of the form definition in this iTwin will belong to. This property of the form definition cannot be changed after import." }, "status": { "type": "string", "description": "Only valid if `importAction` is 'Copy' or unset. This allows you to set what status the imported copy of the form definition will begin in. Default is 'Draft'.", "enum": [ "Draft", "Approved", "Maintenance", "Archived" ], "title": "Form Definition Import Request status", "$ref": "#/components/schemas/form-definition-import-request-status" }, "displayName": { "type": "string", "description": "Only valid if `importAction` is 'Copy' or unset. This allows you to choose a new display name for the imported copy of the form definition in this iTwin." }, "idPrefix": { "type": "string", "description": "Only valid if `importAction` is 'Copy' or unset. This lets you set a new ID prefix for the imported copy of the form definition in this iTwin." } }, "required": [ "sourceFormDefinitionId", "destinationITwinId" ], "additionalProperties": false }
Form Definition Import Response
{ "type": "object", "title": "Form Definition Import Response", "properties": { "formDefinition": { "$ref": "#/components/schemas/form-definition-summary-representation" } }, "required": [ "formDefinition" ], "additionalProperties": false }
form-definition-design-links
If this form definition is in an editable state and you have permission to edit form definitions, this link sends you to the Form Manager webapp where you can edit its layout. Otherwise, this link will not appear.
{ "type": "object", "description": "If this form definition is in an editable state and you have permission to edit form definitions, this link sends you to the Form Manager webapp where you can edit its layout. Otherwise, this link will not appear.", "properties": { "design": { "$ref": "#/components/schemas/link" } }, "additionalProperties": false }
link
{ "type": "object", "properties": { "href": { "type": "string" } }, "additionalProperties": false }
DetailedError
Contains error information and an array of more specific errors.
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 and an array of more specific errors.", "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 }, "details": { "type": "array", "description": "Optional array of more specific errors.", "items": { "$ref": "#/components/schemas/Error" } } }, "required": [ "code", "message", "details" ], "additionalProperties": true }
Detailed 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": "Detailed 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 Detailed information.", "$ref": "#/components/schemas/DetailedError" } }, "required": [ "error" ], "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?