# Check a key

`GET /v1/ping`

Needs an API key.

Confirm the presented key authenticates and report the organisation it acts for.

## Example request

cURL:

```bash
curl https://api.voxoria.ai/v1/ping \
  -H "Authorization: Bearer $VOXORIA_API_KEY"
```

Python:

```python
import os

import httpx

response = httpx.get(
    "https://api.voxoria.ai/v1/ping",
    headers={"Authorization": f"Bearer {os.environ['VOXORIA_API_KEY']}"},
)
print(response.json())
```

TypeScript:

```ts
const response = await fetch("https://api.voxoria.ai/v1/ping", {
  headers: {
    Authorization: `Bearer ${process.env.VOXORIA_API_KEY}`,
  },
});
console.log(await response.json());
```

## Response

### 200

The key is valid. The workspace it acts for.

The workspace the presented key acts for.

| Field | Type | Nullable | Description |
| --- | --- | --- | --- |
| `organization_id` | string | No | The ID of the workspace the key acts for. The API calls it an organization. |

### Example 200 response

```json
{
  "organization_id": "org_3nV7qL2xT9mK4pR8wY6cZb"
}
```

## Errors

| Status | Body | Description |
| --- | --- | --- |
| 400 | [Refused request](/docs/call-response.md#refused-request) | The request was refused. |
| 401 | [Refused request](/docs/call-response.md#refused-request) | The API key is missing, wrong or revoked (`INVALID_AUTH_TOKEN`). |
| 422 | [Invalid request](/docs/call-response.md#invalid-request) | The request is not valid (`VALIDATION`). |
| 429 | [Refused request](/docs/call-response.md#refused-request) | Too many requests with this API key (`RATE_LIMITED`). |
