> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usehasp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Customers

> Group projects under the end client they belong to — for agencies, MSPs, and anyone building on HASP on someone else's behalf.

A **customer** records the end client a set of projects belongs to. If you build on HASP for other organizations — an agency, an MSP, a consultancy — customers let you attribute projects to the client they serve without giving each client a separate HASP org.

Requires the `customer.read` / `customer.write` capabilities.

## Create a customer

```
POST https://api.usehasp.com/v1/customers
Authorization: Bearer hasp_api_live_...
Content-Type: application/json
```

| Field      | Type   | Description                                                                           |
| ---------- | ------ | ------------------------------------------------------------------------------------- |
| `name`     | string | **Required.** The client's name.                                                      |
| `metadata` | object | Optional free-form key/value data — your own identifiers, billing references, region. |

## List and retrieve

```
GET https://api.usehasp.com/v1/customers
GET https://api.usehasp.com/v1/customers/{customer_id}
```

Cursor-paginated and scoped to the caller's org. See [Pagination](/ai-api/concepts/pagination).

## Update

```
PATCH https://api.usehasp.com/v1/customers/{customer_id}
```

| Field      | Type   | Description                          |
| ---------- | ------ | ------------------------------------ |
| `name`     | string | New display name.                    |
| `metadata` | object | Replaces the stored metadata object. |
| `status`   | string | Customer lifecycle status.           |

Every field is optional — only the fields you send change.

## Assign and release projects

```
POST   https://api.usehasp.com/v1/customers/{customer_id}/projects
DELETE https://api.usehasp.com/v1/customers/{customer_id}/projects/{project_id}
```

`POST` takes a single required `project_id` and attributes that project to the customer. `DELETE` releases the project back to the builder's directly-held set — it does not delete the project.

Projects themselves are managed through the [public authoring API](/studio/api-reference#1-public-authoring-api).

## Errors

| Code                | HTTP | Meaning                                           |
| ------------------- | ---- | ------------------------------------------------- |
| `VALIDATION_FAILED` | 422  | Missing `name` on create, or an unknown `status`. |
| `NOT_FOUND`         | 404  | No such customer or project in the caller's org.  |
