Unassign User from Role
Remove a user from a role. The user will lose access to resources granted exclusively by this role.
Request
DELETE https://api.entryguard.io/api/v1/roles/{id}/users/{userId}
Authentication
Requires a valid Bearer JWT token with ORG_ADMIN role.
Authorization: Bearer <access_token>
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | UUID | Yes | The unique identifier of the role |
userId | UUID | Yes | The unique identifier of the user to unassign |
Response
Success Response
Status Code: 204 No Content
No response body is returned on successful removal.
Error Responses
| Status Code | Description |
|---|---|
401 Unauthorized | Missing or invalid authentication token |
403 Forbidden | User does not have ORG_ADMIN role |
404 Not Found | Role or user with the specified ID does not exist, or user is not assigned to this role |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Server error occurred |
Error Response Examples:
{
"timestamp": "2026-02-18T10:30:00Z",
"status": 404,
"error": "Not Found",
"message": "Role not found with id: 550e8400-e29b-41d4-a716-446655440000",
"path": "/api/v1/roles/550e8400-e29b-41d4-a716-446655440000/users/770e8400-e29b-41d4-a716-446655440003"
}
{
"timestamp": "2026-02-18T10:30:00Z",
"status": 404,
"error": "Not Found",
"message": "User not assigned to this role",
"path": "/api/v1/roles/550e8400-e29b-41d4-a716-446655440000/users/770e8400-e29b-41d4-a716-446655440003"
}
Example
Request
curl -X DELETE https://api.entryguard.io/api/v1/roles/550e8400-e29b-41d4-a716-446655440000/users/770e8400-e29b-41d4-a716-446655440003 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Response
HTTP/1.1 204 No Content
Notes
- Removing a user from a role does not delete the user account
- Users may still have access to resources through other roles or direct resource assignments
- Active sessions from this user will continue until they expire
- This operation takes effect immediately for new sessions
- If the user loses access to all resources, they will not be able to start new sessions