Skip to main content
DELETE
/
api
/
v1
/
users
/
{id}
Delete User
curl --request DELETE \
  --url https://api.example.com/api/v1/users/{id}
{
  "204": {},
  "404": {},
  "500": {}
}

Endpoint

DELETE /api/v1/users/{id}
Performs a soft delete of a user. The user is marked as deleted but not physically removed from the database.

Path Parameters

id
UUID
required
Unique user identifier.Example: 0f4df2de-fffb-4a24-9891-381ecf4f0f87

Response

This endpoint returns no content on success (HTTP 204).

Status Codes

204
No Content
User deleted successfully
404
Not Found
User with the specified ID does not exist
500
Internal Server Error
An unexpected error occurred

Example Request

curl -X DELETE http://localhost:8080/api/v1/users/0f4df2de-fffb-4a24-9891-381ecf4f0f87

Example Response

Success (204 No Content): No response body is returned. Only the HTTP status code 204 is sent.

Error Response Example

User Not Found (404)

{
  "type": "about:blank",
  "title": "User Not Found",
  "status": 404,
  "detail": "User not found with id: 0f4df2de-fffb-4a24-9891-381ecf4f0f87",
  "userId": "0f4df2de-fffb-4a24-9891-381ecf4f0f87",
  "timestamp": "2024-01-15T10:30:00"
}

Notes

  • This operation performs a soft delete, meaning the user record is marked as deleted but remains in the database
  • Deleted users will not appear in standard user queries
  • The deletion is idempotent - deleting an already deleted user returns 404
  • Consider implementing a restore endpoint if you need to recover soft-deleted users

Build docs developers (and LLMs) love