Skip to main content

👥 Clients

➕ Add Client (POST)

POST http://localhost:8081/clients

Headers

KeyValue
Content-Typeapplication/json

Body

{
"name": "New Client",
"email": "client@example.com",
"phone": "0501234567",
"projectIds": ["665ab321f7c9a5f03b1a8def"]
}

Response

{
"message": "Client created",
"id": "682eed1bf817dc2357000002"
}

📥 Get All Clients (GET)

GET http://localhost:8081/clients

Response

[
{
"_id": "682eed1bf817dc2357000002",
"name": "New Client",
"email": "client@example.com",
"phone": "0501234567",
"projectIds": [...],
"createdAt": "...",
"deletedAt": null
}
]

🔍 Get Client by ID (GET)

GET http://localhost:8081/clients/{id}


✏️ Update Client (PUT)

PUT http://localhost:8081/clients/{id}

Body

{
"name": "Updated Client",
"email": "updated@example.com"
}

Response

{
"message": "Client updated"
}

💤 Soft Delete Client (PATCH)

PATCH http://localhost:8081/clients/{id}/soft-delete

Response

{
"message": "Client soft-deleted"
}

🗑️ Hard Delete Client (DELETE)

DELETE http://localhost:8081/clients/{id}

Response

{
"message": "Client hard-deleted"
}