{ "swagger": "2.0", "info": { "title": "ProvisioningServiceClient", "version": "2026-11-01", "description": "API for service operations with the Azure IoT Hub Device Provisioning Service", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "https://{dpsName}.azure-devices-provisioning.net", "useSchemePrefix": false, "parameters": [ { "name": "dpsName", "in": "path", "description": "The DPS instance hostname.", "required": true, "type": "string" } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "ApiKeyAuth": [] } ], "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } }, "tags": [], "paths": { "/enrollmentGroups": { "post": { "operationId": "EnrollmentGroup_RunBulkOperation", "summary": "Bulk device enrollment group operation with maximum of 10 groups.", "description": "Bulk device enrollment group operation with maximum of 10 groups.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "body", "in": "body", "description": "The bulk enrollment group operation.", "required": true, "schema": { "$ref": "#/definitions/BulkEnrollmentGroupOperation" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/BulkEnrollmentGroupOperationResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "EnrollmentGroup_RunBulkOperation_MaximumSet_Gen": { "$ref": "./examples/EnrollmentGroup_RunBulkOperation_MaximumSet_Gen.json" }, "EnrollmentGroup_RunBulkOperation_MinimumSet_Gen": { "$ref": "./examples/EnrollmentGroup_RunBulkOperation_MinimumSet_Gen.json" } } } }, "/enrollmentGroups/{id}": { "get": { "operationId": "EnrollmentGroup_Get", "summary": "Get a device enrollment group.", "description": "Get a device enrollment group.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Enrollment group ID.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/EnrollmentGroup" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "EnrollmentGroup_Get_MaximumSet_Gen": { "$ref": "./examples/EnrollmentGroup_Get_MaximumSet_Gen.json" }, "EnrollmentGroup_Get_MinimumSet_Gen": { "$ref": "./examples/EnrollmentGroup_Get_MinimumSet_Gen.json" } } }, "put": { "operationId": "EnrollmentGroup_CreateOrUpdate", "summary": "Create or update a device enrollment group.", "description": "Create or update a device enrollment group.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Enrollment group ID.", "required": true, "type": "string" }, { "name": "If-Match", "in": "header", "description": "The ETag of the enrollment record.", "required": false, "type": "string" }, { "name": "body", "in": "body", "description": "The device enrollment group.", "required": true, "schema": { "$ref": "#/definitions/EnrollmentGroup" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/EnrollmentGroup" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "EnrollmentGroup_CreateOrUpdate_MaximumSet_Gen": { "$ref": "./examples/EnrollmentGroup_CreateOrUpdate_MaximumSet_Gen.json" }, "EnrollmentGroup_CreateOrUpdate_MinimumSet_Gen": { "$ref": "./examples/EnrollmentGroup_CreateOrUpdate_MinimumSet_Gen.json" } } }, "delete": { "operationId": "EnrollmentGroup_Delete", "summary": "Delete a device enrollment group.", "description": "Delete a device enrollment group.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Enrollment group ID.", "required": true, "type": "string" }, { "name": "If-Match", "in": "header", "description": "The ETag of the enrollment group record.", "required": false, "type": "string" } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. " }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "EnrollmentGroup_Delete_MaximumSet_Gen": { "$ref": "./examples/EnrollmentGroup_Delete_MaximumSet_Gen.json" }, "EnrollmentGroup_Delete_MinimumSet_Gen": { "$ref": "./examples/EnrollmentGroup_Delete_MinimumSet_Gen.json" } } } }, "/enrollmentGroups/{id}/attestationmechanism": { "post": { "operationId": "EnrollmentGroup_GetAttestationMechanism", "summary": "Get the attestation mechanism in the device enrollment group record.", "description": "Get the attestation mechanism in the device enrollment group record.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Enrollment group ID", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AttestationMechanism" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "EnrollmentGroup_GetAttestationMechanism_MaximumSet_Gen": { "$ref": "./examples/EnrollmentGroup_GetAttestationMechanism_MaximumSet_Gen.json" }, "EnrollmentGroup_GetAttestationMechanism_MinimumSet_Gen": { "$ref": "./examples/EnrollmentGroup_GetAttestationMechanism_MinimumSet_Gen.json" } } } }, "/enrollmentGroups/query": { "post": { "operationId": "EnrollmentGroup_Query", "summary": "Query the device enrollment groups.", "description": "Query the device enrollment groups.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "x-ms-max-item-count", "in": "header", "description": "Page size", "required": false, "type": "integer", "format": "int32" }, { "name": "x-ms-continuation", "in": "header", "description": "Continuation token", "required": false, "type": "string" }, { "name": "body", "in": "body", "description": "The query specification.", "required": true, "schema": { "$ref": "#/definitions/QuerySpecification" } } ], "responses": { "200": { "description": "Response model for enrollment group query operations.\nUses int64 for x-ms-max-item-count in the preview version to match original behavior.", "schema": { "type": "array", "items": { "$ref": "#/definitions/EnrollmentGroup" } }, "headers": { "x-ms-continuation": { "type": "string", "description": "The continuation token for getting the next page of results." }, "x-ms-item-type": { "type": "string", "description": "The list of values returned from the query." }, "x-ms-max-item-count": { "type": "integer", "format": "int64", "description": "The maximum number of items returned in a page." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "EnrollmentGroup_Query_MaximumSet_Gen": { "$ref": "./examples/EnrollmentGroup_Query_MaximumSet_Gen.json" }, "EnrollmentGroup_Query_MinimumSet_Gen": { "$ref": "./examples/EnrollmentGroup_Query_MinimumSet_Gen.json" } } } }, "/enrollments": { "post": { "operationId": "IndividualEnrollment_RunBulkOperation", "summary": "Bulk device enrollment operation with maximum of 10 enrollments.", "description": "Bulk device enrollment operation with maximum of 10 enrollments.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "body", "in": "body", "description": "The bulk enrollment operation.", "required": true, "schema": { "$ref": "#/definitions/BulkEnrollmentOperation" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/BulkEnrollmentOperationResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "IndividualEnrollment_RunBulkOperation_MaximumSet_Gen": { "$ref": "./examples/IndividualEnrollment_RunBulkOperation_MaximumSet_Gen.json" }, "IndividualEnrollment_RunBulkOperation_MinimumSet_Gen": { "$ref": "./examples/IndividualEnrollment_RunBulkOperation_MinimumSet_Gen.json" } } } }, "/enrollments/{id}": { "get": { "operationId": "IndividualEnrollment_Get", "summary": "Get a device enrollment record.", "description": "Get a device enrollment record.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "This id is used to uniquely identify a device registration of an enrollment. A\ncase-insensitive string (up to 128 characters long) of alphanumeric characters\nplus certain special characters : . _ -. No special characters allowed at start\nor end.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/IndividualEnrollment" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "IndividualEnrollment_Get_MaximumSet_Gen": { "$ref": "./examples/IndividualEnrollment_Get_MaximumSet_Gen.json" }, "IndividualEnrollment_Get_MinimumSet_Gen": { "$ref": "./examples/IndividualEnrollment_Get_MinimumSet_Gen.json" } } }, "put": { "operationId": "IndividualEnrollment_CreateOrUpdate", "summary": "Create or update a device enrollment record.", "description": "Create or update a device enrollment record.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "This id is used to uniquely identify a device registration of an enrollment. A\ncase-insensitive string (up to 128 characters long) of alphanumeric characters\nplus certain special characters : . _ -. No special characters allowed at start\nor end.", "required": true, "type": "string" }, { "name": "If-Match", "in": "header", "description": "The ETag of the enrollment record.", "required": false, "type": "string" }, { "name": "body", "in": "body", "description": "The device enrollment record.", "required": true, "schema": { "$ref": "#/definitions/IndividualEnrollment" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/IndividualEnrollment" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "IndividualEnrollment_CreateOrUpdate_MaximumSet_Gen": { "$ref": "./examples/IndividualEnrollment_CreateOrUpdate_MaximumSet_Gen.json" }, "IndividualEnrollment_CreateOrUpdate_MinimumSet_Gen": { "$ref": "./examples/IndividualEnrollment_CreateOrUpdate_MinimumSet_Gen.json" } } }, "delete": { "operationId": "IndividualEnrollment_Delete", "summary": "Delete a device enrollment record.", "description": "Delete a device enrollment record.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "This id is used to uniquely identify a device registration of an enrollment. A\ncase-insensitive string (up to 128 characters long) of alphanumeric characters\nplus certain special characters : . _ -. No special characters allowed at start\nor end.", "required": true, "type": "string" }, { "name": "If-Match", "in": "header", "description": "The ETag of the enrollment record.", "required": false, "type": "string" } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. " }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "IndividualEnrollment_Delete_MaximumSet_Gen": { "$ref": "./examples/IndividualEnrollment_Delete_MaximumSet_Gen.json" }, "IndividualEnrollment_Delete_MinimumSet_Gen": { "$ref": "./examples/IndividualEnrollment_Delete_MinimumSet_Gen.json" } } } }, "/enrollments/{id}/attestationmechanism": { "post": { "operationId": "IndividualEnrollment_GetAttestationMechanism", "summary": "Get the attestation mechanism in the device enrollment record.", "description": "Get the attestation mechanism in the device enrollment record.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "This id is used to uniquely identify a device registration of an enrollment. A\ncase-insensitive string (up to 128 characters long) of alphanumeric characters\nplus certain special characters : . _ -. No special characters allowed at start\nor end.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AttestationMechanism" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "IndividualEnrollment_GetAttestationMechanism_MaximumSet_Gen": { "$ref": "./examples/IndividualEnrollment_GetAttestationMechanism_MaximumSet_Gen.json" }, "IndividualEnrollment_GetAttestationMechanism_MinimumSet_Gen": { "$ref": "./examples/IndividualEnrollment_GetAttestationMechanism_MinimumSet_Gen.json" } } } }, "/enrollments/query": { "post": { "operationId": "IndividualEnrollment_Query", "summary": "Query the device enrollment records.", "description": "Query the device enrollment records.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "x-ms-max-item-count", "in": "header", "description": "Page size", "required": false, "type": "integer", "format": "int32" }, { "name": "x-ms-continuation", "in": "header", "description": "Continuation token", "required": false, "type": "string" }, { "name": "body", "in": "body", "description": "The query specification.", "required": true, "schema": { "$ref": "#/definitions/QuerySpecification" } } ], "responses": { "200": { "description": "Response model for query operations that includes pagination headers.", "schema": { "type": "array", "items": { "$ref": "#/definitions/IndividualEnrollment" } }, "headers": { "x-ms-continuation": { "type": "string", "description": "The continuation token for getting the next page of results." }, "x-ms-item-type": { "type": "string", "description": "The list of values returned from the query." }, "x-ms-max-item-count": { "type": "integer", "format": "int32", "description": "The maximum number of items returned in a page." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "IndividualEnrollment_Query_MaximumSet_Gen": { "$ref": "./examples/IndividualEnrollment_Query_MaximumSet_Gen.json" }, "IndividualEnrollment_Query_MinimumSet_Gen": { "$ref": "./examples/IndividualEnrollment_Query_MinimumSet_Gen.json" } } } }, "/registrations/{id}": { "get": { "operationId": "DeviceRegistrationState_Get", "summary": "Gets the device registration state.", "description": "Gets the device registration state.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Registration ID.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/DeviceRegistrationState" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "DeviceRegistrationState_Get_MaximumSet_Gen": { "$ref": "./examples/DeviceRegistrationState_Get_MaximumSet_Gen.json" }, "DeviceRegistrationState_Get_MinimumSet_Gen": { "$ref": "./examples/DeviceRegistrationState_Get_MinimumSet_Gen.json" } } }, "delete": { "operationId": "DeviceRegistrationState_Delete", "summary": "Deletes the device registration", "description": "Deletes the device registration", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Registration ID.", "required": true, "type": "string" }, { "name": "If-Match", "in": "header", "description": "The ETag of the registration status record.", "required": false, "type": "string" } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. " }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "DeviceRegistrationState_Delete_MaximumSet_Gen": { "$ref": "./examples/DeviceRegistrationState_Delete_MaximumSet_Gen.json" }, "DeviceRegistrationState_Delete_MinimumSet_Gen": { "$ref": "./examples/DeviceRegistrationState_Delete_MinimumSet_Gen.json" } } } }, "/registrations/{id}/query": { "post": { "operationId": "DeviceRegistrationState_Query", "summary": "Gets the registration state of devices in this enrollmentGroup.", "description": "Gets the registration state of devices in this enrollmentGroup.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Enrollment group ID.", "required": true, "type": "string" }, { "name": "x-ms-max-item-count", "in": "header", "description": "pageSize", "required": false, "type": "integer", "format": "int32" }, { "name": "x-ms-continuation", "in": "header", "description": "continuation token", "required": false, "type": "string" } ], "responses": { "200": { "description": "Response model for query operations that includes pagination headers.", "schema": { "type": "array", "items": { "$ref": "#/definitions/DeviceRegistrationState" } }, "headers": { "x-ms-continuation": { "type": "string", "description": "The continuation token for getting the next page of results." }, "x-ms-item-type": { "type": "string", "description": "The list of values returned from the query." }, "x-ms-max-item-count": { "type": "integer", "format": "int32", "description": "The maximum number of items returned in a page." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ProvisioningServiceErrorDetails" }, "headers": { "x-ms-error-code": { "type": "string", "description": "The error code for specific error that occurred." } } } }, "x-ms-examples": { "DeviceRegistrationState_Query_MaximumSet_Gen": { "$ref": "./examples/DeviceRegistrationState_Query_MaximumSet_Gen.json" }, "DeviceRegistrationState_Query_MinimumSet_Gen": { "$ref": "./examples/DeviceRegistrationState_Query_MinimumSet_Gen.json" } } } } }, "definitions": { "AllocationPolicy": { "type": "string", "description": "The allocation policy of this resource. This policy overrides the tenant level\nallocation policy for this individual enrollment or enrollment group. Possible\nvalues include 'hashed': Linked IoT hubs are equally likely to have devices\nprovisioned to them, 'geoLatency': Devices are provisioned to an IoT hub with\nthe lowest latency to the device.If multiple linked IoT hubs would provide the\nsame lowest latency, the provisioning service hashes devices across those hubs,\n'static' : Specification of the desired IoT hub in the enrollment list takes\npriority over the service-level allocation policy, 'custom': Devices are\nprovisioned to an IoT hub based on your own custom logic. The provisioning\nservice passes information about the device to the logic, and the logic returns\nthe desired IoT hub as well as the desired initial configuration. We recommend\nusing Azure Functions to host your logic.", "enum": [ "hashed", "geoLatency", "static", "custom" ], "x-ms-enum": { "name": "AllocationPolicy", "modelAsString": true, "values": [ { "name": "hashed", "value": "hashed", "description": "hashed" }, { "name": "geoLatency", "value": "geoLatency", "description": "geoLatency" }, { "name": "static", "value": "static", "description": "static" }, { "name": "custom", "value": "custom", "description": "custom" } ] } }, "AssignedDeviceSubstatus": { "type": "string", "description": "Substatus for 'Assigned' devices. Possible values include -\n'initialAssignment': Device has been assigned to an IoT hub for the first time,\n'deviceDataMigrated': Device has been assigned to a different IoT hub and its\ndevice data was migrated from the previously assigned IoT hub. Device data was\nremoved from the previously assigned IoT hub, 'deviceDataReset': Device has\nbeen assigned to a different IoT hub and its device data was populated from the\ninitial state stored in the enrollment. Device data was removed from the\npreviously assigned IoT hub, 'reprovisionedToInitialAssignment': Device has\nbeen re-provisioned to a previously assigned IoT hub.", "enum": [ "initialAssignment", "deviceDataMigrated", "deviceDataReset", "reprovisionedToInitialAssignment" ], "x-ms-enum": { "name": "AssignedDeviceSubstatus", "modelAsString": true, "values": [ { "name": "initialAssignment", "value": "initialAssignment", "description": "initialAssignment" }, { "name": "deviceDataMigrated", "value": "deviceDataMigrated", "description": "deviceDataMigrated" }, { "name": "deviceDataReset", "value": "deviceDataReset", "description": "deviceDataReset" }, { "name": "reprovisionedToInitialAssignment", "value": "reprovisionedToInitialAssignment", "description": "reprovisionedToInitialAssignment" } ] } }, "AttestationMechanism": { "type": "object", "description": "Attestation mechanism for individualEnrollment as well as enrollmentGroup.", "properties": { "type": { "$ref": "#/definitions/AttestationType", "description": "Attestation Type." }, "tpm": { "$ref": "#/definitions/TpmAttestation", "description": "TPM attestation method." }, "x509": { "$ref": "#/definitions/X509Attestation", "description": "X509 attestation method." }, "symmetricKey": { "$ref": "#/definitions/SymmetricKeyAttestation", "description": "Symmetric Key attestation method." } }, "required": [ "type" ] }, "AttestationType": { "type": "string", "description": "Attestation Type.", "enum": [ "none", "tpm", "x509", "symmetricKey" ], "x-ms-enum": { "name": "AttestationType", "modelAsString": true, "values": [ { "name": "none", "value": "none", "description": "none" }, { "name": "tpm", "value": "tpm", "description": "tpm" }, { "name": "x509", "value": "x509", "description": "x509" }, { "name": "symmetricKey", "value": "symmetricKey", "description": "symmetricKey" } ] } }, "BulkEnrollmentGroupOperation": { "type": "object", "description": "Bulk enrollment operation.", "properties": { "enrollmentGroups": { "type": "array", "description": "Enrollment items", "items": { "$ref": "#/definitions/EnrollmentGroup" } }, "mode": { "$ref": "#/definitions/BulkEnrollmentMode", "description": "Operation mode." } }, "required": [ "enrollmentGroups", "mode" ] }, "BulkEnrollmentGroupOperationError": { "type": "object", "description": "Bulk enrollment operation error.", "properties": { "enrollmentGroupId": { "type": "string", "description": "Enrollment group id.", "minLength": 1 }, "errorCode": { "type": "integer", "format": "int32", "description": "Error code" }, "errorStatus": { "type": "string", "description": "Error status.", "minLength": 1 } }, "required": [ "enrollmentGroupId", "errorCode", "errorStatus" ] }, "BulkEnrollmentGroupOperationResult": { "type": "object", "description": "Results of a bulk enrollment group operation.", "properties": { "errors": { "type": "array", "description": "Registration errors", "items": { "$ref": "#/definitions/BulkEnrollmentGroupOperationError" } }, "isSuccessful": { "type": "boolean", "description": "Indicates if the operation was successful in its entirety." } }, "required": [ "isSuccessful" ] }, "BulkEnrollmentMode": { "type": "string", "description": "Bulk enrollment operation mode.", "enum": [ "create", "update", "updateIfMatchETag", "delete" ], "x-ms-enum": { "name": "BulkEnrollmentMode", "modelAsString": true, "values": [ { "name": "create", "value": "create", "description": "create" }, { "name": "update", "value": "update", "description": "update" }, { "name": "updateIfMatchETag", "value": "updateIfMatchETag", "description": "updateIfMatchETag" }, { "name": "delete", "value": "delete", "description": "delete" } ] } }, "BulkEnrollmentOperation": { "type": "object", "description": "Bulk enrollment operation.", "properties": { "enrollments": { "type": "array", "description": "Enrollment items", "items": { "$ref": "#/definitions/IndividualEnrollment" } }, "mode": { "$ref": "#/definitions/BulkEnrollmentMode", "description": "Operation mode." } }, "required": [ "enrollments", "mode" ] }, "BulkEnrollmentOperationError": { "type": "object", "description": "Bulk enrollment operation error", "properties": { "registrationId": { "type": "string", "description": "This id is used to uniquely identify a device registration of an enrollment.\nA case-insensitive string (up to 128 characters long) of alphanumeric\ncharacters plus certain special characters : . _ -. No special characters\nallowed at start or end.", "minLength": 1 }, "errorCode": { "type": "integer", "format": "int32", "description": "Error code" }, "errorStatus": { "type": "string", "description": "Error status.", "minLength": 1 } }, "required": [ "registrationId", "errorCode", "errorStatus" ] }, "BulkEnrollmentOperationResult": { "type": "object", "description": "Results of a bulk enrollment operation", "properties": { "errors": { "type": "array", "description": "Registration errors", "items": { "$ref": "#/definitions/BulkEnrollmentOperationError" } }, "isSuccessful": { "type": "boolean", "description": "Indicates if the operation was successful in its entirety." } }, "required": [ "isSuccessful" ] }, "CustomAllocationDefinition": { "type": "object", "description": "This tells DPS which webhook to call when using custom allocation.", "properties": { "webhookUrl": { "type": "string", "description": "The webhook URL used for allocation requests.", "minLength": 1 }, "apiVersion": { "type": "string", "description": "The API version of the provisioning service types (such as\nIndividualEnrollment) sent in the custom allocation request. Minimum supported\nversion: \"2018-09-01-preview\".", "minLength": 1 } }, "required": [ "webhookUrl", "apiVersion" ] }, "DeviceCapabilities": { "type": "object", "description": "Device capabilities.", "properties": { "iotEdge": { "type": "boolean", "description": "If set to true, this device is an IoTEdge device.", "default": false } }, "required": [ "iotEdge" ] }, "DeviceRegistrationState": { "type": "object", "description": "Device registration state.", "properties": { "registrationId": { "type": "string", "description": "This id is used to uniquely identify a device registration of an enrollment.\nA case-insensitive string (up to 128 characters long) of alphanumeric\ncharacters plus certain special characters : . _ -. No special characters\nallowed at start or end.", "readOnly": true }, "createdDateTimeUtc": { "type": "string", "format": "date-time", "description": "Registration create date time (in UTC).", "readOnly": true }, "assignedHub": { "type": "string", "description": "Assigned Azure IoT Hub.", "readOnly": true }, "deviceId": { "type": "string", "description": "Device ID.", "readOnly": true }, "status": { "$ref": "#/definitions/EnrollmentStatus", "description": "Enrollment status.", "readOnly": true }, "substatus": { "$ref": "#/definitions/AssignedDeviceSubstatus", "description": "Substatus for 'Assigned' devices. Possible values include -\n'initialAssignment': Device has been assigned to an IoT hub for the first time,\n'deviceDataMigrated': Device has been assigned to a different IoT hub and its\ndevice data was migrated from the previously assigned IoT hub. Device data was\nremoved from the previously assigned IoT hub, 'deviceDataReset': Device has\nbeen assigned to a different IoT hub and its device data was populated from the\ninitial state stored in the enrollment. Device data was removed from the\npreviously assigned IoT hub, 'reprovisionedToInitialAssignment': Device has\nbeen re-provisioned to a previously assigned IoT hub.", "readOnly": true }, "errorCode": { "type": "integer", "format": "int32", "description": "Error code.", "readOnly": true }, "errorMessage": { "type": "string", "description": "Error message.", "readOnly": true }, "lastUpdatedDateTimeUtc": { "type": "string", "format": "date-time", "description": "Last updated date time (in UTC).", "readOnly": true }, "etag": { "type": "string", "description": "The entity tag associated with the resource.", "readOnly": true }, "payload": { "type": "object", "description": "Custom allocation payload returned from the webhook to the device.", "additionalProperties": {}, "readOnly": true } } }, "EnrollmentGroup": { "type": "object", "description": "Enrollment group record.", "properties": { "enrollmentGroupId": { "type": "string", "description": "Enrollment Group ID.", "minLength": 1 }, "attestation": { "$ref": "#/definitions/AttestationMechanism", "description": "Attestation method used by the device." }, "capabilities": { "$ref": "#/definitions/DeviceCapabilities", "description": "Capabilities of the device." }, "iotHubHostName": { "type": "string", "description": "The Iot Hub host name." }, "namespaceName": { "type": "string", "description": "Name of the Azure Device Registry namespace that contains the referenced\ncertificate authority and certificate policy.", "minLength": 3, "maxLength": 64, "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$" }, "certificateAuthorityName": { "type": "string", "description": "Name of the Azure Device Registry certificate authority resource that owns the\nreferenced certificate policy.", "minLength": 3, "maxLength": 63, "pattern": "^[0-9a-zA-Z][a-zA-Z0-9-]*$" }, "certificatePolicyName": { "type": "string", "description": "Name of the Azure Device Registry certificate policy resource.", "minLength": 3, "maxLength": 63, "pattern": "^[0-9a-zA-Z][a-zA-Z0-9-]*$" }, "initialTwin": { "$ref": "#/definitions/InitialTwin", "description": "Initial device twin." }, "etag": { "type": "string", "description": "The entity tag associated with the resource." }, "provisioningStatus": { "type": "string", "description": "The provisioning status.", "default": "enabled", "enum": [ "enabled", "disabled" ], "x-ms-enum": { "name": "ProvisioningStatus", "modelAsString": true, "values": [ { "name": "enabled", "value": "enabled", "description": "enabled" }, { "name": "disabled", "value": "disabled", "description": "disabled" } ] } }, "reprovisionPolicy": { "$ref": "#/definitions/ReprovisionPolicy", "description": "The behavior when a device is re-provisioned to an IoT hub." }, "createdDateTimeUtc": { "type": "string", "format": "date-time", "description": "The DateTime this resource was created.", "readOnly": true }, "lastUpdatedDateTimeUtc": { "type": "string", "format": "date-time", "description": "The DateTime this resource was last updated.", "readOnly": true }, "allocationPolicy": { "$ref": "#/definitions/AllocationPolicy", "description": "The allocation policy of this resource. This policy overrides the tenant level\nallocation policy for this individual enrollment or enrollment group. Possible\nvalues include 'hashed': Linked IoT hubs are equally likely to have devices\nprovisioned to them, 'geoLatency': Devices are provisioned to an IoT hub with\nthe lowest latency to the device.If multiple linked IoT hubs would provide the\nsame lowest latency, the provisioning service hashes devices across those hubs,\n'static' : Specification of the desired IoT hub in the enrollment list takes\npriority over the service-level allocation policy, 'custom': Devices are\nprovisioned to an IoT hub based on your own custom logic. The provisioning\nservice passes information about the device to the logic, and the logic returns\nthe desired IoT hub as well as the desired initial configuration. We recommend\nusing Azure Functions to host your logic." }, "iotHubs": { "type": "array", "description": "The list of IoT Hub hostnames the device(s) in this resource can be allocated\nto. Must be a subset of tenant level list of IoT hubs.", "items": { "type": "string" } }, "customAllocationDefinition": { "$ref": "#/definitions/CustomAllocationDefinition", "description": "This tells DPS which webhook to call when using custom allocation." } }, "required": [ "enrollmentGroupId", "attestation" ] }, "EnrollmentGroupQueryResponse": { "type": "object", "description": "Response model for enrollment group query operations.\nUses int64 for x-ms-max-item-count in the preview version to match original behavior.", "properties": { "body": { "type": "array", "description": "The list of enrollment groups.", "items": { "$ref": "#/definitions/EnrollmentGroup" } } }, "required": [ "body" ] }, "EnrollmentStatus": { "type": "string", "description": "Enrollment status.", "enum": [ "unassigned", "assigning", "assigned", "failed", "disabled" ], "x-ms-enum": { "name": "EnrollmentStatus", "modelAsString": true, "values": [ { "name": "unassigned", "value": "unassigned", "description": "unassigned" }, { "name": "assigning", "value": "assigning", "description": "assigning" }, { "name": "assigned", "value": "assigned", "description": "assigned" }, { "name": "failed", "value": "failed", "description": "failed" }, { "name": "disabled", "value": "disabled", "description": "disabled" } ] } }, "IndividualEnrollment": { "type": "object", "description": "The device enrollment record.", "properties": { "registrationId": { "type": "string", "description": "This id is used to uniquely identify a device registration of an enrollment.\nA case-insensitive string (up to 128 characters long) of alphanumeric\ncharacters plus certain special characters : . _ -. No special characters\nallowed at start or end.", "minLength": 1 }, "deviceId": { "type": "string", "description": "Desired IoT Hub device ID (optional)." }, "namespaceName": { "type": "string", "description": "Name of the Azure Device Registry namespace that contains the referenced\ncertificate authority and certificate policy.", "minLength": 3, "maxLength": 64, "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$" }, "certificateAuthorityName": { "type": "string", "description": "Name of the Azure Device Registry certificate authority resource that owns the\nreferenced certificate policy.", "minLength": 3, "maxLength": 63, "pattern": "^[0-9a-zA-Z][a-zA-Z0-9-]*$" }, "certificatePolicyName": { "type": "string", "description": "Name of the Azure Device Registry certificate policy resource.", "minLength": 3, "maxLength": 63, "pattern": "^[0-9a-zA-Z][a-zA-Z0-9-]*$" }, "registrationState": { "$ref": "#/definitions/DeviceRegistrationState", "description": "Current registration status.", "readOnly": true }, "optionalDeviceInformation": { "$ref": "#/definitions/TwinCollection", "description": "Optional Device Information." }, "attestation": { "$ref": "#/definitions/AttestationMechanism", "description": "Attestation method used by the device." }, "capabilities": { "$ref": "#/definitions/DeviceCapabilities", "description": "Capabilities of the device." }, "iotHubHostName": { "type": "string", "description": "The Iot Hub host name." }, "initialTwin": { "$ref": "#/definitions/InitialTwin", "description": "Initial device twin." }, "etag": { "type": "string", "description": "The entity tag associated with the resource." }, "provisioningStatus": { "type": "string", "description": "The provisioning status.", "default": "enabled", "enum": [ "enabled", "disabled" ], "x-ms-enum": { "name": "ProvisioningStatus", "modelAsString": true, "values": [ { "name": "enabled", "value": "enabled", "description": "enabled" }, { "name": "disabled", "value": "disabled", "description": "disabled" } ] } }, "reprovisionPolicy": { "$ref": "#/definitions/ReprovisionPolicy", "description": "The behavior when a device is re-provisioned to an IoT hub." }, "createdDateTimeUtc": { "type": "string", "format": "date-time", "description": "The DateTime this resource was created.", "readOnly": true }, "lastUpdatedDateTimeUtc": { "type": "string", "format": "date-time", "description": "The DateTime this resource was last updated.", "readOnly": true }, "allocationPolicy": { "$ref": "#/definitions/AllocationPolicy", "description": "The allocation policy of this resource. This policy overrides the tenant level\nallocation policy for this individual enrollment or enrollment group. Possible\nvalues include 'hashed': Linked IoT hubs are equally likely to have devices\nprovisioned to them, 'geoLatency': Devices are provisioned to an IoT hub with\nthe lowest latency to the device.If multiple linked IoT hubs would provide the\nsame lowest latency, the provisioning service hashes devices across those hubs,\n'static' : Specification of the desired IoT hub in the enrollment list takes\npriority over the service-level allocation policy, 'custom': Devices are\nprovisioned to an IoT hub based on your own custom logic. The provisioning\nservice passes information about the device to the logic, and the logic returns\nthe desired IoT hub as well as the desired initial configuration. We recommend\nusing Azure Functions to host your logic." }, "iotHubs": { "type": "array", "description": "The list of IoT Hub hostnames the device(s) in this resource can be allocated\nto. Must be a subset of tenant level list of IoT hubs.", "items": { "type": "string" } }, "customAllocationDefinition": { "$ref": "#/definitions/CustomAllocationDefinition", "description": "This tells DPS which webhook to call when using custom allocation." } }, "required": [ "registrationId", "attestation" ] }, "InitialTwin": { "type": "object", "description": "Initial device twin. Contains a subset of the properties of Twin.", "properties": { "tags": { "$ref": "#/definitions/TwinCollection", "description": "Twin tags." }, "properties": { "$ref": "#/definitions/InitialTwinProperties", "description": "Twin desired properties." } } }, "InitialTwinProperties": { "type": "object", "description": "Represents the initial properties that will be set on the device twin.", "properties": { "desired": { "$ref": "#/definitions/TwinCollection", "description": "Gets and sets the InitialTwin desired properties." } } }, "Metadata": { "type": "object", "description": "Metadata for the TwinCollection", "properties": { "lastUpdated": { "type": "string", "format": "date-time", "description": "Last time the TwinCollection was updated" }, "lastUpdatedVersion": { "type": "integer", "format": "int32", "description": "This is null for reported properties metadata and is not null for desired\nproperties metadata." } } }, "ProvisioningServiceErrorDetails": { "type": "object", "description": "Contains the properties of an error returned by the Azure IoT Hub Provisioning\nService.", "properties": { "errorCode": { "type": "integer", "format": "int32", "description": "Error code for the operation." }, "trackingId": { "type": "string", "description": "Tracking ID for the error." }, "message": { "type": "string", "description": "Human-readable error message." }, "info": { "type": "object", "description": "Dictionary of ", "additionalProperties": { "type": "string" } }, "timestampUtc": { "type": "string", "format": "date-time", "description": "UTC timestamp of the error." } } }, "ProvisioningStatus": { "type": "string", "description": "The provisioning status.", "enum": [ "enabled", "disabled" ], "x-ms-enum": { "name": "ProvisioningStatus", "modelAsString": true, "values": [ { "name": "enabled", "value": "enabled", "description": "enabled" }, { "name": "disabled", "value": "disabled", "description": "disabled" } ] } }, "QuerySpecification": { "type": "object", "description": "Query specification for enrollment queries.", "properties": { "query": { "type": "string", "description": "OData query string." } }, "required": [ "query" ] }, "ReprovisionPolicy": { "type": "object", "description": "The behavior of the service when a device is re-provisioned to an IoT hub.", "properties": { "updateHubAssignment": { "type": "boolean", "description": "When set to true (default), the Device Provisioning Service will evaluate the\ndevice's IoT Hub assignment and update it if necessary for any provisioning\nrequests beyond the first from a given device. If set to false, the device will\nstay assigned to its current IoT hub.", "default": true }, "migrateDeviceData": { "type": "boolean", "description": "When set to true (default), the Device Provisioning Service will migrate the\ndevice's data (twin, device capabilities, and device ID) from one IoT hub to\nanother during an IoT hub assignment update. If set to false, the Device\nProvisioning Service will reset the device's data to the initial desired\nconfiguration stored in the corresponding enrollment list.", "default": true } }, "required": [ "updateHubAssignment", "migrateDeviceData" ] }, "SymmetricKeyAttestation": { "type": "object", "description": "Attestation via SymmetricKey.", "properties": { "primaryKey": { "type": "string", "description": "Primary symmetric key." }, "secondaryKey": { "type": "string", "description": "Secondary symmetric key." } } }, "TpmAttestation": { "type": "object", "description": "Attestation via TPM.", "properties": { "endorsementKey": { "type": "string", "description": "TPM endorsement key." }, "storageRootKey": { "type": "string", "description": "TPM storage root key." } }, "required": [ "endorsementKey" ] }, "TwinCollection": { "type": "object", "description": "Represents a collection of properties within a Twin", "properties": { "version": { "type": "integer", "format": "int32", "description": "Version of the TwinCollection" }, "count": { "type": "integer", "format": "int32", "description": "Number of properties in the TwinCollection" }, "metadata": { "$ref": "#/definitions/Metadata", "description": "Metadata for the TwinCollection" } }, "additionalProperties": { "type": "object" } }, "X509Attestation": { "type": "object", "description": "Attestation via X509.", "properties": { "clientCertificates": { "$ref": "#/definitions/X509Certificates", "description": "Primary and secondary certificates" }, "signingCertificates": { "$ref": "#/definitions/X509Certificates", "description": "Primary and secondary certificates" }, "caReferences": { "$ref": "#/definitions/X509CAReferences", "description": "Primary and secondary CA references." } } }, "X509CAReferences": { "type": "object", "description": "Primary and secondary CA references.", "properties": { "primary": { "type": "string", "description": "Primary CA reference." }, "secondary": { "type": "string", "description": "Secondary CA reference." } } }, "X509CertificateInfo": { "type": "object", "description": "X509 certificate info.", "properties": { "subjectName": { "type": "string", "description": "Subject name of the certificate." }, "sha1Thumbprint": { "type": "string", "description": "SHA-1 thumbprint of the certificate." }, "sha256Thumbprint": { "type": "string", "description": "SHA-256 thumbprint of the certificate." }, "issuerName": { "type": "string", "description": "Issuer name of the certificate." }, "notBeforeUtc": { "type": "string", "format": "date-time", "description": "Certificate validity start (UTC)." }, "notAfterUtc": { "type": "string", "format": "date-time", "description": "Certificate validity end (UTC)." }, "serialNumber": { "type": "string", "description": "Serial number of the certificate." }, "version": { "type": "integer", "format": "int32", "description": "Version of the certificate." } }, "required": [ "subjectName", "sha1Thumbprint", "sha256Thumbprint", "issuerName", "notBeforeUtc", "notAfterUtc", "serialNumber", "version" ] }, "X509CertificateWithInfo": { "type": "object", "description": "Certificate and Certificate info", "properties": { "certificate": { "type": "string", "description": "PEM-formatted certificate string." }, "info": { "$ref": "#/definitions/X509CertificateInfo", "description": "X509 certificate info." } } }, "X509Certificates": { "type": "object", "description": "Primary and secondary certificates", "properties": { "primary": { "$ref": "#/definitions/X509CertificateWithInfo", "description": "Certificate and Certificate info" }, "secondary": { "$ref": "#/definitions/X509CertificateWithInfo", "description": "Certificate and Certificate info" } } } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" } } }