Delete user
Request description
Endpoint: /users/:id/delete
Method: DELETE
The following parameter must be passed through the URL:
id: specifies the unique user identifier
Header
{
"Content-Type": "application/json",
"Authorization": "Bearer <accessToken>"
}
Note: the <accessToken> is obtained as a result of the authentication. The authentication flow you have to follow depends on the access mode, see Access modes.
Access modes
This endpoint accepts two kinds of access token. The meaning of :id depends on which one you use:
| Access token | Deletes a user from | :id is |
|---|---|---|
| Platform user | Your platform organization | The unique user identifier |
| Dictation service | Your organization's corporate dictation server | The user login |
No request body is required in either case.
appId:apiKey) and sent as Basic <token> to the /api/v1/token endpoint. See AI Services — Credentials for the full procedure and code examples.Responses
Correct response
Successful request
Describe the characteristics of a satisfactory response
200
Response structure:
{
"message": "Data deleted successfully"
}
Wrong responses
Unauthorized request
Describe the characteristics of an unauthorized request
401
Response body
{
"message": "Unauthorized"
}
Description: this error occurs when endpoint authorizers fail to validate the token sent in the request header.
Not found — platform user
Describe the characteristics of a not found request
404
Response body
{
"errorType": "InvalidParameters",
"errorMessage": "User not found",
"message": "User not found",
"details": [
/* validation detail */
]
}
Description: there is no user with the identifier sent in the URL. Deleting a user that has already been deleted returns this same response.
Bad request — platform user
Describe the characteristics of a bad request
400
Response body
type DeleteUserResponseType = {
errorType: DELETE_USER_ERROR_TYPE;
errorMessage: string;
message?: string; // Present on validation errors
details?: object[]; // Present on validation errors
};
enum DELETE_USER_ERROR_TYPE {
INVALID_REQUEST_FORMAT = "invalidRequestFormat",
UNAUTHORIZED_RESOURCE = "unauthorizedResource",
NOT_ALLOWED_RESOURCE = "notAllowedResource",
}
errorType | errorMessage | Meaning |
|---|---|---|
invalidRequestFormat | Invalid user id | the id in the URL is not a valid user identifier |
unauthorizedResource | Unauthorized resource | the user does not belong to your organization |
notAllowedResource | noOrganizationOwnerError | the user is the last Owner of the organization |
Forbidden — platform user
Describe the characteristics of a forbidden request
403
Response body
{
"errorType": "notAllowedResource",
"errorMessage": "Unauthorized",
"message": "Unauthorized"
}
{
"errorMessage": "User does not have permission to remove themselves"
}
errorType.Forbidden — dictation user
Describe the characteristics of a forbidden request
403
Response body
{
"message": "Forbidden"
}
{
"message": "Dictation server rejected the operation"
}
Not found — dictation user
Describe the characteristics of a not found request
404
Response body
{
"message": "There is no user with that login in the dictation server"
}
{
"message": "Tenant not found"
}
Server error — platform user
Describe the characteristics of an unexpected error
500
Response body
{
"errorMessage": "Error removing user"
}
Dictation server unavailable
Describe the characteristics of an unreachable dictation server
502
Response body
{
"message": "Dictation server unavailable"
}
Description: the dictation server could not complete the request.
Dictation server timeout
Describe the characteristics of a dictation server that does not answer in time
504
Response body
{
"message": "Dictation server did not respond in time"
}
Description: the dictation server did not answer within the allowed time. Check whether the user still exists before retrying.