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

# Revoke leaked credentials

> Revoke Inworld API keys found somewhere they shouldn't be. Send each key's credential; no authentication needed. The response never says whether a key existed.


## API reference

**Endpoint:** `POST https://api.inworld.ai/v1/credentials:revoke`

### Request body

Content type: `application/json`

- `credentials` (string[]; required) — The credentials to revoke, each as you found it: the Base64 credential Portal and the Inworld CLI give out, the same value with a `Basic ` or `Bearer ` prefix, or `key_id:secret`. A value in none of these forms, or longer than 1,024 characters, is skipped. Send 1 to 100 credentials per request; more than 100 is refused with `400`, so split a longer list across requests.

#### Request example

```json
{
  "credentials": [
    "<leaked-key>"
  ]
}
```

### Response examples

#### 202: accepted

```json
{}
```

#### 400: empty

```json
{
  "code": 3,
  "message": "credentials must name at least one credential",
  "details": []
}
```

#### 405: default_response

```json
{
  "code": 0,
  "message": "string",
  "details": []
}
```

#### 408: default_response

```json
{
  "code": 0,
  "message": "string",
  "details": []
}
```

#### 413: default_response

```json
{
  "code": 0,
  "message": "string",
  "details": []
}
```

#### 429: default_response

```json
{
  "code": 0,
  "message": "string",
  "details": []
}
```

#### 503: default_response

```json
{
  "code": 0,
  "message": "string",
  "details": []
}
```

### Code examples

#### cURL

```bash
curl https://api.inworld.ai/v1/credentials:revoke \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{"credentials": ["<leaked-key>"]}'
```

#### Python

```python
import requests

response = requests.post(
    "https://api.inworld.ai/v1/credentials:revoke",
    json={"credentials": ["<leaked-key>"]},
    timeout=60,
)
print(response.status_code)  # 202 means Inworld accepted the request
```

#### JavaScript

```javascript
// Node.js 18 or later. Browsers can't call this API.
const response = await fetch('https://api.inworld.ai/v1/credentials:revoke', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ credentials: ['<leaked-key>'] }),
});
console.log(response.status); // 202 means Inworld accepted the request
```
