Create a workspace or service user, optionally setting an initial local password for a workspace user.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/users"), Content = new StringContent("{ \"UserName\": \"example\", \"Email\": \"example\", \"FirstName\": \"example\", \"LastName\": \"example\", \"UserType\": 0, \"RoleIds\": [ \"example\" ], \"UserId\": \"example\", \"EmailConfirmed\": true, \"IsBlocked\": true, \"ExtendedData\": { \"additionalProperty\": \"example\" }, \"Password\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/users';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"UserName":"example","Email":"example","FirstName":"example","LastName":"example","UserType":0,"RoleIds":["example"],"UserId":"example","EmailConfirmed":true,"IsBlocked":true,"ExtendedData":{"additionalProperty":"example"},"Password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspace/users \ --header 'Content-Type: application/json' \ --data '{ "UserName": "example", "Email": "example", "FirstName": "example", "LastName": "example", "UserType": 0, "RoleIds": [ "example" ], "UserId": "example", "EmailConfirmed": true, "IsBlocked": true, "ExtendedData": { "additionalProperty": "example" }, "Password": "example" }'Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.
Request Body
Section titled “Request Body”Request payload to create a workspace user.
object
Exact Unicode login name. Lookup uniqueness uses trim, NFC, and invariant uppercase.
Optional email address.
First name (required).
Last name.
Optional role identifiers to assign.
Optional caller-supplied stable user identifier.
Whether the optional email is confirmed.
Whether the created user is blocked.
Optional non-secret integration metadata.
object
Optional initial local password. Supported only for workspace users; omit it for passwordless provisioning and service users.
Request payload to create a workspace user.
object
Exact Unicode login name. Lookup uniqueness uses trim, NFC, and invariant uppercase.
Optional email address.
First name (required).
Last name.
Optional role identifiers to assign.
Optional caller-supplied stable user identifier.
Whether the optional email is confirmed.
Whether the created user is blocked.
Optional non-secret integration metadata.
object
Optional initial local password. Supported only for workspace users; omit it for passwordless provisioning and service users.
Request payload to create a workspace user.
object
Exact Unicode login name. Lookup uniqueness uses trim, NFC, and invariant uppercase.
Optional email address.
First name (required).
Last name.
Optional role identifiers to assign.
Optional caller-supplied stable user identifier.
Whether the optional email is confirmed.
Whether the created user is blocked.
Optional non-secret integration metadata.
object
Optional initial local password. Supported only for workspace users; omit it for passwordless provisioning and service users.
Responses
Section titled “Responses”OK
object
Detailed representation of a workspace user.
object
User identifier.
Exact stored Unicode login name.
Optional email address.
First name.
Last name.
Whether the user is blocked from signing in.
Whether the user is soft deleted.
Avatar presentation values for a workspace user.
object
Initials derived from the user name.
Hex color for the avatar background.
Hex color for the avatar text.
Creation timestamp.
Deletion timestamp, if deleted.
Original user name before deletion.
Original email before deletion.
Roles assigned to the user.
Summary of a workspace role.
object
Role identifier.
Role display name.
Role description.
Whether the role is auto-assigned to new users.
Whether the role is a protected system role.
Number of users assigned to this role.
Number of permissions assigned to this role.
Tag names assigned to the role.
Non-secret integration metadata.
object
Whether local password authentication is available.
Safe current external identity state attached to a local user projection.
object
Provider-owned profile metadata. It is never an authorization input.
object
Whether the optional email address has been confirmed.
Opaque concurrency token.
Non-secret integration metadata.
object
Canonical display name.
Current Work Schedule association projected into a user read model.
object
Field-safe reference to the Worker associated with a workspace user.
object
object
object
object
object
Example
{ "Data": { "UserType": 0, "ExternalIdentity": { "ProviderKind": 1, "Status": 1, "DiagnosticCode": 0 } }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Bad Request
object
Detailed representation of a workspace user.
object
User identifier.
Exact stored Unicode login name.
Optional email address.
First name.
Last name.
Whether the user is blocked from signing in.
Whether the user is soft deleted.
Avatar presentation values for a workspace user.
object
Initials derived from the user name.
Hex color for the avatar background.
Hex color for the avatar text.
Creation timestamp.
Deletion timestamp, if deleted.
Original user name before deletion.
Original email before deletion.
Roles assigned to the user.
Summary of a workspace role.
object
Role identifier.
Role display name.
Role description.
Whether the role is auto-assigned to new users.
Whether the role is a protected system role.
Number of users assigned to this role.
Number of permissions assigned to this role.
Tag names assigned to the role.
Non-secret integration metadata.
object
Whether local password authentication is available.
Safe current external identity state attached to a local user projection.
object
Provider-owned profile metadata. It is never an authorization input.
object
Whether the optional email address has been confirmed.
Opaque concurrency token.
Non-secret integration metadata.
object
Canonical display name.
Current Work Schedule association projected into a user read model.
object
Field-safe reference to the Worker associated with a workspace user.
object
object
object
object
object
Example
{ "Data": { "UserType": 0, "ExternalIdentity": { "ProviderKind": 1, "Status": 1, "DiagnosticCode": 0 } }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}