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

# Rotate Keys

> Rotate API keys for an upload endpoint

# Rotate Keys

Rotate API keys for an upload endpoint. The old keys remain valid until they expire.

## Endpoint

```
POST /upload endpoints/{upload endpoint_id}/rotate-keys
```

## Path Parameters

| Parameter            | Type   | Required | Description            |
| -------------------- | ------ | -------- | ---------------------- |
| `upload endpoint_id` | string | Yes      | The upload endpoint ID |

## Request

```bash theme={null}
curl -X POST https://api.docyard.io/v1/upload endpoints/upload endpoint-xyz789/rotate-keys \
  -H "X-API-Key: dk_live_dist_aaaaaaaa" \
  -H "X-API-Secret: dk_secret_dist_bbbbbbbb"
```

## Response

```json theme={null}
{
  "new_api_key": "dk_live_dist_cccccccc",
  "new_api_secret": "dk_secret_dist_dddddddd",
  "old_key_expires_at": "2026-03-16T10:00:00Z",
  "message": "New keys generated. Old keys expire at the specified time."
}
```

**Important**: Update your applications with the new keys before the old key expires.

***

## Related Endpoints

* \[Create Upload]\(/api-reference/upload endpoints/create)
