Creates a new scene share.
Creating a Scene Share allows your scene to be publicly accessible, enabling anyone with the shareKey to view its data without needing to sign in. To use a share, take the value of the shareKey property and prepend it with the Basic prefix in the authorization header of your request.
If no expiration is provided, it will default to 100 years from creation (effectively non-expiring).
Shares may be revoked at any time via the Revoke scene share endpoint. Deleting a scene automatically revokes its shares.
Request parameters
Scene Id
Primary iTwin Id associated with the scene
Request headers
OAuth access token with itwin-platform scope
Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.
Request body
SceneShareCreateDTO
Optional share expiration timestamp (must be a future date)
Example
{ "expiration": "2027-05-07T08:00:00-04:00" }
Response 201 Created
Created share.
{ "share": { "id": "e047c23b-6fe1-4629-abda-1344f98236d7", "sceneId": "eda9e67f-24a3-4bd5-aeca-981d2abdb610", "iTwinId": "1ba4c28a-e518-42d4-85e4-ff9f9ef44bb6", "contractName": "SceneDefault", "shareKey": "eyJhbGciOiJ...", "expiration": "2027-05-07T08:00:00-04:00", "createdById": "37f457a6-25fd-4d4a-8947-974b690158be", "lastModifiedById": "37f457a6-25fd-4d4a-8947-974b690158be", "creationTime": "2025-05-04T00:14:08-04:00", "lastModified": "2025-05-06T21:15:25-04:00" } }
Response 400 Bad Request
Unprocessable Entity
{ "error": { "code": "InvalidScenesRequest", "message": "Cannot create sceneShare.", "target": "sceneShare", "details": [{ "code": "InvalidRequestBody", "message": "Expiration must be a valid date in the future.", "target": "expiration" }] } }
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
Forbidden
{ "error": { "code": "InsufficientPermissions", "message": "The user has insufficient permissions for the requested operation." } }
Response 404 Not Found
Not Found
{ "error": { "code": "SceneNotFound", "message": "Requested scene is not available.", "target": "scene" } }
Response 409 Conflict
Conflict
{ "error": { "code": "SceneShareConflict", "message": "Private scenes cannot be publicly shared. Change visibility to 'iTwin' first." } }
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.
Error
Contains error information.
One of a server-defined set of error codes.
The target of the error.
A human-readable representation of the error.
{ "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "target": { "type": "string", "nullable": true, "description": "The target of the error." }, "message": { "type": "string", "description": "A human-readable representation of the error." } }, "description": "Contains error information.", "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", "required": [ "error" ], "properties": { "error": { "$ref": "#/components/schemas/Error", "description": "Error information." } }, "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.", "additionalProperties": false }
SceneShareDTO
Globally unique identifier for the share
iTwin id
Id of the scene being shared
The share key to be used for authentication to the share.
The expiration for the share as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'
Id of the user who created the scene share
Share contract name
Time the scene share was created as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'
Time the scene share was last modified as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'
Id of the user who last modified the scene share
{ "type": "object", "required": [ "id", "sceneId", "iTwinId", "contractName", "shareKey", "expiration", "createdById", "lastModifiedById", "creationTime", "lastModified" ], "properties": { "id": { "type": "string", "format": "uuid", "example": "e047c23b-6fe1-4629-abda-1344f98236d7", "description": "Globally unique identifier for the share" }, "iTwinId": { "type": "string", "format": "UUID", "example": "1ba4c28a-e518-42d4-85e4-ff9f9ef44bb6", "description": "iTwin id" }, "sceneId": { "type": "string", "format": "uuid", "example": "eda9e67f-24a3-4bd5-aeca-981d2abdb610", "description": "Id of the scene being shared" }, "shareKey": { "type": "string", "example": "eyJhbGciOiJ...", "description": "The share key to be used for authentication to the share." }, "expiration": { "type": "string", "format": "date-time", "example": "2027-05-07T12:00:00.0000000+00:00", "description": "The expiration for the share as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'" }, "createdById": { "type": "string", "format": "UUID", "example": "37f457a6-25fd-4d4a-8947-974b690158be", "description": "Id of the user who created the scene share" }, "contractName": { "type": "string", "example": "SceneDefault", "description": "Share contract name" }, "creationTime": { "type": "string", "format": "date-time", "example": "2025-05-04T04:14:08.0000000+00:00", "description": "Time the scene share was created as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'" }, "lastModified": { "type": "string", "format": "date-time", "example": "2025-05-07T01:15:25.0000000+00:00", "description": "Time the scene share was last modified as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'" }, "lastModifiedById": { "type": "string", "format": "UUID", "example": "37f457a6-25fd-4d4a-8947-974b690158be", "description": "Id of the user who last modified the scene share" } }, "additionalProperties": false }
SceneShareResponse
{ "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/SceneShareDTO" } }, "additionalProperties": false }
SceneShareCreateDTO
Optional share expiration timestamp (must be a future date)
{ "type": "object", "properties": { "expiration": { "type": "string", "format": "date-time", "description": "Optional share expiration timestamp (must be a future date)" } }, "additionalProperties": false }
Was this page helpful?