Azure Digital Twins API (preview:2023-02-27)

2025/10/23 • 29 new methods

DigitalTwinModels_Add (new)
Description Uploads one or more models. When any error occurs, no models are uploaded. Status codes: * 201 Created * 400 Bad Request * DTDLParserError - The models provided are not valid DTDL. * InvalidArgument - The model id is invalid. * LimitExceeded - The maximum number of model ids allowed in 'dependenciesFor' has been reached. * ModelVersionNotSupported - The version of DTDL used is not supported. * 409 Conflict * ModelAlreadyExists - The model provided already exists.
Reference Link ¶

⚼ Request

POST:  /models
{
models: object ,
api-version: string ,
}

⚐ Response (201)

{
displayName: object ,
description: object ,
id: string ,
uploadTime: string ,
decommissioned: boolean ,
model: object ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwinModels_List (new)
Description Retrieves model metadata and, optionally, model definitions. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The model id is invalid. * LimitExceeded - The maximum number of model ids allowed in 'dependenciesFor' has been reached. * 404 Not Found * ModelNotFound - The model was not found.
Reference Link ¶

⚼ Request

GET:  /models
{
dependenciesFor: array ,
includeModelDefinition: boolean ,
max-items-per-page: integer ,
api-version: string ,
}

⚐ Response (200)

{
value:
[
{
displayName: object ,
description: object ,
id: string ,
uploadTime: string ,
decommissioned: boolean ,
model: object ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwinModels_GetById (new)
Description Retrieves model metadata and optionally the model definition. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The model id is invalid. * MissingArgument - The model id was not provided. * 404 Not Found * ModelNotFound - The model was not found.
Reference Link ¶

⚼ Request

GET:  /models/{id}
{
id: string ,
includeModelDefinition: boolean ,
api-version: string ,
}

⚐ Response (200)

{
displayName: object ,
description: object ,
id: string ,
uploadTime: string ,
decommissioned: boolean ,
model: object ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwinModels_Update (new)
Description Updates the metadata for a model. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The model id is invalid. * JsonPatchInvalid - The JSON Patch provided is invalid. * MissingArgument - The model id was not provided. * 404 Not Found * ModelNotFound - The model was not found. * 409 Conflict * ModelReferencesNotDecommissioned - The model refers to models that are not decommissioned.
Reference Link ¶

⚼ Request

PATCH:  /models/{id}
{
id: string ,
updateModel: object ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwinModels_Delete (new)
Description Deletes a model. A model can only be deleted if no other models reference it. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The model id is invalid. * MissingArgument - The model id was not provided. * 404 Not Found * ModelNotFound - The model was not found. * 409 Conflict * ModelReferencesNotDeleted - The model refers to models that are not deleted.
Reference Link ¶

⚼ Request

DELETE:  /models/{id}
{
id: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
Query_QueryTwins (new)
Description Executes a query that allows traversing relationships and filtering by property values. Status codes: * 200 OK * 400 Bad Request * BadRequest - The continuation token is invalid. * SqlQueryError - The query contains some errors. * TimeoutError - The query execution timed out after 60 seconds. Try simplifying the query or adding conditions to reduce the result size. * 429 Too Many Requests * QuotaReachedError - The maximum query rate limit has been reached.
Reference Link ¶

⚼ Request

POST:  /query
{
querySpecification:
{
query: string ,
continuationToken: string ,
}
,
max-items-per-page: integer ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
query-charge: number ,
}
,
$schema:
{
value:
[
object ,
]
,
continuationToken: string ,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_GetById (new)
Description Retrieves a digital twin. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The digital twin id is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found.
Reference Link ¶

⚼ Request

GET:  /digitaltwins/{id}
{
id: string ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
etag: string ,
}
,
$schema: object ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_Add (new)
Description Adds or replaces a digital twin. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The digital twin id or payload is invalid. * ModelDecommissioned - The model for the digital twin is decommissioned. * TwinLimitReached - The maximum number of digital twins allowed has been reached. * ValidationFailed - The digital twin payload is not valid. * 412 Precondition Failed * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.
Reference Link ¶

⚼ Request

PUT:  /digitaltwins/{id}
{
id: string ,
twin: object ,
If-None-Match: string ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
etag: string ,
}
,
$schema: object ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_Delete (new)
Description Deletes a digital twin. All relationships referencing the digital twin must already be deleted. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The digital twin id is invalid. * RelationshipsNotDeleted - The digital twin contains relationships. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * 412 Precondition Failed * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.
Reference Link ¶

⚼ Request

DELETE:  /digitaltwins/{id}
{
id: string ,
If-Match: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_Update (new)
Description Updates a digital twin. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The digital twin id or payload is invalid. * JsonPatchInvalid - The JSON Patch provided is invalid. * ValidationFailed - Applying the patch results in an invalid digital twin. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * 412 Precondition Failed * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.
Reference Link ¶

⚼ Request

PATCH:  /digitaltwins/{id}
{
id: string ,
patchDocument: object ,
If-Match: string ,
api-version: string ,
}

⚐ Response (204)

{
etag: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_GetRelationshipById (new)
Description Retrieves a relationship between two digital twins. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The digital twin id or relationship id is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * RelationshipNotFound - The relationship was not found.
Reference Link ¶

⚼ Request

GET:  /digitaltwins/{id}/relationships/{relationshipId}
{
id: string ,
relationshipId: string ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
etag: string ,
}
,
$schema: object ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_AddRelationship (new)
Description Adds a relationship between two digital twins. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The digital twin id, relationship id, or payload is invalid. * InvalidRelationship - The relationship is invalid. * OperationNotAllowed - The relationship cannot connect to the same digital twin. * ValidationFailed - The relationship content is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * TargetTwinNotFound - The digital twin target of the relationship was not found. * 412 Precondition Failed * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.
Reference Link ¶

⚼ Request

PUT:  /digitaltwins/{id}/relationships/{relationshipId}
{
id: string ,
relationshipId: string ,
relationship: object ,
If-None-Match: string ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
etag: string ,
}
,
$schema: object ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_DeleteRelationship (new)
Description Deletes a relationship between two digital twins. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The digital twin id or relationship id is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * RelationshipNotFound - The relationship was not found. * 412 Precondition Failed * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.
Reference Link ¶

⚼ Request

DELETE:  /digitaltwins/{id}/relationships/{relationshipId}
{
id: string ,
relationshipId: string ,
If-Match: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_UpdateRelationship (new)
Description Updates the properties on a relationship between two digital twins. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The digital twin id or relationship id is invalid. * InvalidRelationship - The relationship is invalid. * JsonPatchInvalid - The JSON Patch provided is invalid. * ValidationFailed - The relationship content is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * RelationshipNotFound - The relationship was not found. * 409 Conflict * RelationshipAlreadyExists - The relationship already exists. * 412 Precondition Failed * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.
Reference Link ¶

⚼ Request

PATCH:  /digitaltwins/{id}/relationships/{relationshipId}
{
id: string ,
relationshipId: string ,
patchDocument: object ,
If-Match: string ,
api-version: string ,
}

⚐ Response (204)

{
etag: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_ListRelationships (new)
Description Retrieves the relationships from a digital twin. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The digital twin id is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found.
Reference Link ¶

⚼ Request

GET:  /digitaltwins/{id}/relationships
{
id: string ,
relationshipName: string ,
api-version: string ,
}

⚐ Response (200)

{
value:
[
object ,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_ListIncomingRelationships (new)
Description Retrieves all incoming relationship for a digital twin. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The digital twin id is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found.
Reference Link ¶

⚼ Request

GET:  /digitaltwins/{id}/incomingrelationships
{
id: string ,
api-version: string ,
}

⚐ Response (200)

{
value:
[
{
$relationshipId: string ,
$sourceId: string ,
$relationshipName: string ,
$relationshipLink: string ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_SendTelemetry (new)
Description Sends telemetry on behalf of a digital twin. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The digital twin id or message id is invalid. * ValidationFailed - The telemetry content is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found.
Reference Link ¶

⚼ Request

POST:  /digitaltwins/{id}/telemetry
{
id: string ,
telemetry: object ,
Message-Id: string ,
Telemetry-Source-Time: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_SendComponentTelemetry (new)
Description Sends telemetry on behalf of a component in a digital twin. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The digital twin id, message id, or component path is invalid. * ValidationFailed - The telemetry content is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * ComponentNotFound - The component path was not found.
Reference Link ¶

⚼ Request

POST:  /digitaltwins/{id}/components/{componentPath}/telemetry
{
id: string ,
componentPath: string ,
telemetry: object ,
Message-Id: string ,
Telemetry-Source-Time: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_GetComponent (new)
Description Retrieves a component from a digital twin. Status codes: * 200 OK * 400 Bad Request * InvalidArgument - The digital twin id or component path is invalid. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * ComponentNotFound - The component path was not found.
Reference Link ¶

⚼ Request

GET:  /digitaltwins/{id}/components/{componentPath}
{
id: string ,
componentPath: string ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
etag: string ,
}
,
$schema: object ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
DigitalTwins_UpdateComponent (new)
Description Updates a component on a digital twin. Status codes: * 204 No Content * 400 Bad Request * InvalidArgument - The digital twin id, component path, or payload is invalid. * JsonPatchInvalid - The JSON Patch provided is invalid. * ValidationFailed - Applying the patch results in an invalid digital twin. * 404 Not Found * DigitalTwinNotFound - The digital twin was not found. * 412 Precondition Failed * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.
Reference Link ¶

⚼ Request

PATCH:  /digitaltwins/{id}/components/{componentPath}
{
id: string ,
componentPath: string ,
patchDocument: object ,
If-Match: string ,
api-version: string ,
}

⚐ Response (204)

{
etag: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
EventRoutes_List (new)
Description Retrieves all event routes. Status codes: * 200 OK
Reference Link ¶

⚼ Request

GET:  /eventroutes
{
max-items-per-page: integer ,
api-version: string ,
}

⚐ Response (200)

{
value:
[
{
id: string ,
endpointName: string ,
filter: string ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
EventRoutes_GetById (new)
Description Retrieves an event route. Status codes: * 200 OK * 404 Not Found * EventRouteNotFound - The event route was not found.
Reference Link ¶

⚼ Request

GET:  /eventroutes/{id}
{
id: string ,
api-version: string ,
}

⚐ Response (200)

{
id: string ,
endpointName: string ,
filter: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
EventRoutes_Add (new)
Description Adds or replaces an event route. Status codes: * 204 No Content * 400 Bad Request * EventRouteEndpointInvalid - The endpoint provided does not exist or is not active. * EventRouteFilterInvalid - The event route filter is invalid. * EventRouteIdInvalid - The event route id is invalid. * LimitExceeded - The maximum number of event routes allowed has been reached.
Reference Link ¶

⚼ Request

PUT:  /eventroutes/{id}
{
id: string ,
eventRoute:
{
id: string ,
endpointName: string ,
filter: string ,
}
,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
EventRoutes_Delete (new)
Description Deletes an event route. Status codes: * 204 No Content * 404 Not Found * EventRouteNotFound - The event route was not found.
Reference Link ¶

⚼ Request

DELETE:  /eventroutes/{id}
{
id: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
ImportJobs_List (new)
Description Retrieves all import jobs. Status codes: * 200 OK
Reference Link ¶

⚼ Request

GET:  /jobs/imports
{
max-items-per-page: integer ,
api-version: string ,
}

⚐ Response (200)

{
value:
[
{
id: string ,
inputBlobUri: string ,
outputBlobUri: string ,
status: enum ,
createdDateTime: string ,
lastActionDateTime: string ,
finishedDateTime: string ,
purgeDateTime: string ,
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
ImportJobs_Add (new)
Description Creates an import job. Status codes: * 201 Created * 400 Bad Request * JobLimitReached - The maximum number of import jobs allowed has been reached. * ValidationFailed - The import job request is not valid.
Reference Link ¶

⚼ Request

PUT:  /jobs/imports/{id}
{
id: string ,
importJob:
{
id: string ,
inputBlobUri: string ,
outputBlobUri: string ,
status: enum ,
createdDateTime: string ,
lastActionDateTime: string ,
finishedDateTime: string ,
purgeDateTime: string ,
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
api-version: string ,
}

⚐ Response (201)

{
id: string ,
inputBlobUri: string ,
outputBlobUri: string ,
status: enum ,
createdDateTime: string ,
lastActionDateTime: string ,
finishedDateTime: string ,
purgeDateTime: string ,
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
ImportJobs_GetById (new)
Description Retrieves an import job. Status codes: * 200 OK * 404 Not Found * ImportJobNotFound - The import job was not found.
Reference Link ¶

⚼ Request

GET:  /jobs/imports/{id}
{
id: string ,
api-version: string ,
}

⚐ Response (200)

{
id: string ,
inputBlobUri: string ,
outputBlobUri: string ,
status: enum ,
createdDateTime: string ,
lastActionDateTime: string ,
finishedDateTime: string ,
purgeDateTime: string ,
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
ImportJobs_Delete (new)
Description Deletes an import job. Status codes: * 204 No Content * 400 Bad Request * ValidationFailed - The import job request is not valid.
Reference Link ¶

⚼ Request

DELETE:  /jobs/imports/{id}
{
id: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
ImportJobs_Cancel (new)
Description Cancels an import job. Status codes: * 200 Request Accepted * 400 Bad Request * ValidationFailed - The import job request is not valid.
Reference Link ¶

⚼ Request

POST:  /jobs/imports/{id}/cancel
{
id: string ,
api-version: string ,
}

⚐ Response (200)

{
id: string ,
inputBlobUri: string ,
outputBlobUri: string ,
status: enum ,
createdDateTime: string ,
lastActionDateTime: string ,
finishedDateTime: string ,
purgeDateTime: string ,
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}