> For the complete documentation index, see [llms.txt](https://diffio.ai/llms.txt). This page is also available as HTML at https://diffio.ai/docs/overview/concepts/end-users/.

# End users: one key, many customers

An end user is one of your customers, named by the `Diffio-End-User` header your server sends; Diffio keeps their projects apart. A request with the header reaches only that end user's projects; one without it acts for the whole account.

## How it works

1. Your server → Diffio API: `POST /projects`, Diffio-End-User: customer-42
2. Diffio API → Your server: `project`, end_user: "customer-42"
3. Your server → Diffio API: `GET /projects/{id}`, Diffio-End-User: customer-7
4. Diffio API → Your server: `404 project_not_found`, another customer's project
5. Your server → Diffio API: `GET /usage`, Diffio-End-User: customer-42
6. Diffio API → Your server: `usage`, that customer's generations only
7. Diffio API → Your server: `webhook`, data.end_user on every event

**One API key, two customers. Without the header, a request sees every project on the account.**

## Limits

| Limit | Value |
| --- | --- |
| `Diffio-End-User` | up to 128 characters; longer is `400 invalid_header` |
| `end_user` in a body | refused (`400 invalid_field`); send the header |
| `POST /webhooks/portal` | account-wide; the header is refused (`403 permission_denied`) |
| Idempotency-Key on `POST /projects` | scoped to the account and the end user |

## Build with it

- Guide [Podcast cleanup in a SaaS app](https://diffio.ai/docs/developers/guides/saas-podcast-cleanup/)
- Guide [Bill your users from usage](https://diffio.ai/docs/developers/guides/bill-users-from-usage/)

- [`POST /projects`](https://diffio.ai/docs/api-reference/create-project/)
- [`GET /projects`](https://diffio.ai/docs/api-reference/list-projects/)
- [`GET /usage`](https://diffio.ai/docs/api-reference/usage-summary/)
- [`POST /webhooks/portal`](https://diffio.ai/docs/api-reference/open-webhook-portal/)

## Related pages

- Previous: [Shares](https://diffio.ai/docs/overview/concepts/shares/): A share is a revocable public link to one project's result that anyone with its id can play without an API key.
- Next: [Projects and uploads](https://diffio.ai/docs/overview/concepts/projects-and-uploads/): A project holds one uploaded recording; its status moves from awaiting_upload to ready as the file arrives.
