Skip to main content
The users endpoints provide user management functionality. All endpoints require JWT authentication and specific role permissions.

Delete user

DELETE /api/users/:id Delete a user account. This endpoint requires the admin role. Authentication required: Yes (JWT Bearer token)
Required role: admin

Path parameters

id
string
required
The unique identifier (UUID) of the user to delete

Response

Returns 204 No Content on successful deletion.

Example request

curl -X DELETE https://your-domain.com/api/users/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const userId = '550e8400-e29b-41d4-a716-446655440000';

const response = await fetch(`https://your-domain.com/api/users/${userId}`, {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${token}`
  }
});

if (response.status === 204) {
  console.log('User deleted successfully');
}

Error responses

401 Unauthorized - Missing or invalid token
{
  "statusCode": 401,
  "message": "Unauthorized"
}
403 Forbidden - Insufficient permissions
{
  "statusCode": 403,
  "message": "Forbidden resource"
}
404 Not Found - User does not exist
{
  "statusCode": 404,
  "message": "User not found"
}

User object structure

When users are returned in responses (from auth endpoints), they follow this structure:
id
string
Unique user identifier (UUID)
email
string
User’s email address (unique)
name
string
User’s full name
phone
string
User’s phone number (optional, unique)
status
string
User account status: active or inactive
createdAt
string
Timestamp when the user was created (ISO 8601)
updatedAt
string
Timestamp when the user was last updated (ISO 8601)

Notes

  • User deletion is permanent and cannot be undone
  • Deleting a user cascades to their associated resources (artists, labels, releases)
  • Only users with the admin role can delete users
  • You cannot delete your own user account through this endpoint

Build docs developers (and LLMs) love