# Act for a customer with a key

Your platform's own credential never acts inside a customer. Mint one key per customer, with only the scopes your servers need.



1. **Mint.** `POST /v1/platforms/{orgId}/customers/{customerId}/api-keys` (Mint a customer API key) with a `name` that says which system holds it, and explicit `scopes`. Omitted scopes mean read-only.
2. **Store the secret.** It is returned once. Put it in your secrets manager, keyed by the customer's `org_id`.
3. **Call the customer API** with that key alone: `/v1/orgs/{customerId}/...`.
4. **Rotate** with `POST /v1/platforms/{orgId}/customers/{customerId}/api-keys/{keyId}/roll` (Roll a customer API key): the old secret keeps working for the overlap you set, at most 72 hours.
5. **Revoke** with `POST /v1/platforms/{orgId}/customers/{customerId}/api-keys/{keyId}/revoke` (Revoke a customer API key) when you stop serving the customer. Unlinking a customer revokes every key you minted for it.


Try it: `POST /v1/platforms/{orgId}/customers/{customerId}/api-keys`
## Choosing scopes

| Your servers need to | Scopes |
| --- | --- |
| Show balances and statements | `accounts:view` |
| Show funding instructions | `accounts:view` |
| Manage recipients | `counterparties:view`, `counterparties:manage` |
| Send payments | `payments:view`, `payments:create` |
| Approve payments on the customer's behalf | `payments:approve` (opt-in; only if the customer agreed) |
| Receive the customer's events | `webhooks:manage` |

`platform:*` and `api_keys:manage` can never be placed on a customer key.

> **Keep keys off devices**
Customer keys move money. Keep them on your servers. Your customer's mobile or web app talks to your backend, which calls Payezy.
> **call records `source=platform_api` and your platform id, on the customer's activity log and on yours.**
