Users - Create
Create a user in the application
PUT https://{subdomain}.{baseDomain}/api/users/{userId}?api-version=2022-07-31
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
base
|
path | True |
string |
The base domain for all Azure IoT Central service requests. |
subdomain
|
path | True |
string |
The application subdomain. |
user
|
path | True |
string |
Unique ID for the user. Regex pattern: |
api-version
|
query | True |
string |
The version of the API being called. |
Request Body
The request body can be one of the following:
Name | Description |
---|---|
ADGroup |
The active directory group user definition. |
Email |
The email user definition. |
Service |
The service principal user definition. |
ADGroupUser
The active directory group user definition.
Name | Required | Type | Description |
---|---|---|---|
objectId | True |
string |
The AAD object ID of the AD Group. |
roles | True |
List of role assignments that specify the permissions to access the application. |
|
tenantId | True |
string |
The AAD tenant ID of the AD Group. |
type | True |
string:
ad |
Type of the user. |
EmailUser
The email user definition.
Name | Required | Type | Description |
---|---|---|---|
True |
string |
Email address of the user. |
|
roles | True |
List of role assignments that specify the permissions to access the application. |
|
type | True |
string:
|
Type of the user. |
ServicePrincipalUser
The service principal user definition.
Name | Required | Type | Description |
---|---|---|---|
objectId | True |
string |
The AAD object ID of the service principal. |
roles | True |
List of role assignments that specify the permissions to access the application. |
|
tenantId | True |
string |
The AAD tenant ID of the service principal. |
type | True |
string:
service |
Type of the user. |
Responses
Name | Type | Description |
---|---|---|
200 OK | User: |
Success |
Other Status Codes |
An error response received from the IoT Central Service. Headers x-ms-error-code: string |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Add or update a service principal user |
Add or update an email user |
Add or update a service principal user
Sample request
PUT https://appsubdomain.azureiotcentral.com/api/users/123?api-version=2022-07-31
{
"type": "servicePrincipal",
"tenantId": "027fdad7-cf0f-470a-a26a-272197813322",
"objectId": "65e13aac-1443-4c49-9d49-57b87197cfff",
"roles": [
{
"role": "c7be2c6b-797e-4551-bb24-33709f6b2e20"
},
{
"role": "c495eb57-eb18-489e-9802-62c474e5645c",
"organization": "seattle"
}
]
}
Sample response
{
"id": "123",
"type": "servicePrincipal",
"tenantId": "027fdad7-cf0f-470a-a26a-272197813322",
"objectId": "65e13aac-1443-4c49-9d49-57b87197cfff",
"roles": [
{
"role": "c7be2c6b-797e-4551-bb24-33709f6b2e20"
},
{
"role": "c495eb57-eb18-489e-9802-62c474e5645c",
"organization": "seattle"
}
]
}
Add or update an email user
Sample request
PUT https://appsubdomain.azureiotcentral.com/api/users/123?api-version=2022-07-31
{
"type": "email",
"roles": [
{
"role": "ca310b8d-2f4a-44e0-a36e-957c202cd8d4"
},
{
"role": "c495eb57-eb18-489e-9802-62c474e5645c",
"organization": "seattle"
}
],
"email": "bob@contoso.com"
}
Sample response
{
"type": "email",
"roles": [
{
"role": "ca310b8d-2f4a-44e0-a36e-957c202cd8d4"
},
{
"role": "c495eb57-eb18-489e-9802-62c474e5645c",
"organization": "seattle"
}
],
"email": "bob@contoso.com"
}
Definitions
Name | Description |
---|---|
ADGroup |
The active directory group user definition. |
Email |
The email user definition. |
Error |
The response error definition. |
Error |
The detail information of the error. |
Role |
The role assignment definition. |
Service |
The service principal user definition. |
ADGroupUser
The active directory group user definition.
Name | Type | Description |
---|---|---|
id |
string |
Unique ID of the user. |
objectId |
string |
The AAD object ID of the AD Group. |
roles |
List of role assignments that specify the permissions to access the application. |
|
tenantId |
string |
The AAD tenant ID of the AD Group. |
type |
string:
ad |
Type of the user. |
EmailUser
The email user definition.
Name | Type | Description |
---|---|---|
string |
Email address of the user. |
|
id |
string |
Unique ID of the user. |
roles |
List of role assignments that specify the permissions to access the application. |
|
type |
string:
|
Type of the user. |
Error
The response error definition.
Name | Type | Description |
---|---|---|
error |
Error details for current request. |
ErrorDetails
The detail information of the error.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
message |
string |
Error message details. |
requestId |
string |
Correlation Id for current request. |
time |
string |
The time that error request failed. |
RoleAssignment
The role assignment definition.
Name | Type | Description |
---|---|---|
organization |
string |
ID of the organization for this role assignment. |
role |
string |
ID of the role for this role assignment. |
ServicePrincipalUser
The service principal user definition.
Name | Type | Description |
---|---|---|
id |
string |
Unique ID of the user. |
objectId |
string |
The AAD object ID of the service principal. |
roles |
List of role assignments that specify the permissions to access the application. |
|
tenantId |
string |
The AAD tenant ID of the service principal. |
type |
string:
service |
Type of the user. |