> This page is for API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.eon.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.eon.io/_mcp/server.

# Rotate Current API Client Secret

POST https://%7Baccount-domain%7D.console.eon.io/api/v1/api-credentials/current/rotate

Replaces the client secret for the currently used set of API credentials.

This method can be used to rotate a secret only for the access key passed in the `Authorization` header.
To replace client secrets for other sets of API credentials, use [Rotate API Client Secret].

Once replaced, the old client secret can't be used to authenticate or obtain new tokens.
However, access tokens that were issued before the rotation remain valid until they expire.
This means there is an effective grace period of up to 12 hours where previously issued access tokens continue to work, even though the client secret used to obtain them has been rotated.

[Rotate API Client Secret]: ./rotate-api-client-secret


Reference: https://docs.eon.io/api/api-reference/auth/rotate-current-api-client-secret

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Response

### 200

Client secret rotated.

- `clientId` (string, required) — API client ID.
- `clientSecret` (string, required) — API client secret.

## Examples

**Response**

```json
{
  "clientId": "yaeiq73af5cbxibLiu22yw2t5ezeozxu5itv43uw2tyn3xpqprta",
  "clientSecret": "eon_sample620a571c00caf772b8e1b69de703792ba12c9eadef689725e0489324a093a64b4459ffecbaaa441c377950628b6b9042af728056d1d060b8f5d5sample"
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/v1/api-credentials/current/rotate"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{account-domain}.console.eon.io/api/v1/api-credentials/current/rotate';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://{account-domain}.console.eon.io/api/v1/api-credentials/current/rotate")
  .header("Authorization", "Bearer <token>")
  .asString();
```