# Customers

Manage the workspace's customers (Invoices → Customers on the dashboard) and the projects linked to them. Owner/Executive Manager role only. Customer and project ids are raw integers. A customer has many projects and a project many customers. The reports take customer ids as `customers` and narrow to the linked projects.

 - [GET /customers](https://api-docs.webwork-tracker.com/api/customers/getcustomers.md): List the workspace's customers (Invoices → Customers on the dashboard), paginated and sorted by name. Each customer includes its linked projects (the workspace's live projects only). `search` matches
 - [POST /customers](https://api-docs.webwork-tracker.com/api/customers/createcustomer.md): Create a customer. `name` (max 50) and `email` are required and trimmed. Another customer of the workspace with the same name and email, letter case ignored, is a 422, the dashboard's rule. The custom
 - [GET /customers/{customer_id}](https://api-docs.webwork-tracker.com/api/customers/getcustomer.md): Retrieve one customer with its linked projects. **Access**: Owner / Executive Manager only.
 - [PUT /customers/{customer_id}](https://api-docs.webwork-tracker.com/api/customers/updatecustomer.md): Update a customer. Only the fields sent change; a `name` or `email` that is sent must not be blank. When the name or email changes, another customer of the workspace with the same name and email is a
 - [DELETE /customers/{customer_id}](https://api-docs.webwork-tracker.com/api/customers/deletecustomer.md): Delete a customer and its project links. The projects themselves are not deleted. Invoices billed to the customer without a stored bill-to copy no longer show its name and email. **Access**: Owner / E
 - [POST /customers/{customer_id}/assign/{project_id}](https://api-docs.webwork-tracker.com/api/customers/assigncustomerproject.md): Link a project to a customer. A project can belong to several customers; linking a project that is already linked to this customer returns 422. **Access**: Owner / Executive Manager only.
 - [DELETE /customers/{customer_id}/unassign/{project_id}](https://api-docs.webwork-tracker.com/api/customers/unassigncustomerproject.md): Unlink a project from a customer. The project itself is not deleted. Returns 404 if the project is not linked to that customer. **Access**: Owner / Executive Manager only.
