# Roll an API key

`POST /v1/orgs/{orgId}/api-keys/{keyId}/roll`

Mint a replacement secret. The current secret keeps working for the overlap, at most 72 hours (api_keys:manage, AAL2).

When to use it: Rotate a secret with an overlap so running systems can switch without downtime.

Requires: permission api_keys:manage; second factor for browser sessions

## Request body

- `overlap_hours` (integer): 

```json
{
  "overlap_hours": 24
}
```

Errors: invalid_overlap, api_key_inactive

```bash
curl -X POST "https://sandbox-api.payezy.io/v1/orgs/$ORG_ID/api-keys/$KEY_ID/roll" \
  -H "Authorization: Bearer $PAYEZY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "overlap_hours": 24
}'
```
