Skip to main content
DELETE
/
api
/
clientes
/
:id
Delete Client
curl --request DELETE \
  --url https://api.example.com/api/clientes/:id
{
  "message": "<string>"
}

Overview

Permanently deletes a public client from the system.
Destructive OperationThis is currently a public endpoint. Deleting a client will also cascade delete all associated appointments and contact messages due to database constraints.

Path Parameters

id
number
required
The unique identifier of the client to delete

Response

message
string
Success message: “Cliente eliminado correctamente”

Example Request

cURL
curl -X DELETE http://localhost:3000/api/clientes/42
JavaScript
const response = await fetch('http://localhost:3000/api/clientes/42', {
  method: 'DELETE'
});
const data = await response.json();

Example Response

200 OK
{
  "message": "Cliente eliminado correctamente"
}

Error Responses

{
  "message": "Cliente no encontrado"
}
No client exists with the specified ID.
{
  "message": "Error al eliminar cliente"
}
An error occurred while deleting the client. This may happen if there are database constraints preventing deletion.

Cascade Effects

When a client is deleted, the following related records are also deleted due to cascade constraints:
  • All appointments (citas) associated with the client
  • All contact messages (contacto) from the client
  • Any medical history (historial) linked to deleted appointments

Use Cases

  • GDPR/data privacy compliance (right to be forgotten)
  • Removing duplicate or test client records
  • Data cleanup operations
Consider implementing soft deletes or archiving instead of permanent deletion to maintain data integrity and audit trails.
Source: /home/daytona/workspace/source/src/routes/clientes.routes.js:95

Build docs developers (and LLMs) love