Delete a user by ID
DELETE/users/:userId
The Remove User request allows you to remove a user from ANSCER ANYA. This request takes in the user's unique ID as a parameter, and will permanently delete the user's account and all associated data from the ANSCER ANYA database.
Request
Path Parameters
userId stringrequired
The ID of the user to retrieve, update or delete
Responses
- 200
- 401
- 403
- 404
- 500
User deleted
- application/json
- Schema
- Example (from schema)
Schema
_id uuid
name string
Possible values: >= 3 characters and <= 50 characters
email email
Possible values: >= 5 characters and <= 255 characters
isActive boolean
role userRoles
Possible values: [developer, admin, user]
createdBy object
The user who created this user
_id string
name string
email email
updatedBy object
The user who last updated this user
_id string
name string
email email
createdAt date-time
The date and time this user was created
updatedAt date-time
The date and time this user was last updated
{
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"email": "user@example.com",
"isActive": true,
"role": "developer",
"createdBy": {
"_id": "string",
"name": "string",
"email": "user@example.com"
},
"updatedBy": {
"_id": "string",
"name": "string",
"email": "user@example.com"
},
"createdAt": "2024-12-03T13:26:27.374Z",
"updatedAt": "2024-12-03T13:26:27.374Z"
}
Unauthorized.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Authentication token not provided."
}
{
"message": "Authentication token not provided."
}
Forbidden.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Access to this resource is forbidden."
}
{
"message": "Access to this resource is forbidden."
}
Resource not found.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Resource not found."
}
{
"message": "Resource not found."
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Internal Server Error. Please try again later."
}
{
"message": "Internal Server Error. Please try again later."
}
Loading...