# Get the API key's scopes

Answers the scopes of the API key that made the request. GET /key.

`GET https://api.tiktornado.com/api/v1/key`

Scope: none.

Answers the scopes of the API key that made the request. Use it to check that a key works. It needs no scope.

## Examples

```bash
curl 'https://api.tiktornado.com/api/v1/key' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY"
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/key", {
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
  },
});
const data = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://api.tiktornado.com/api/v1/key",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
    },
)
data = response.json()
```

## Response 200

The key works.

- `scopes` array of strings, required: What this key may do. Each: One of `posts:write`, `posts:read`, `stats:read`, `accounts:read`, `comments:read`, `comments:write`.

```json
{
  "scopes": [
    "accounts:read",
    "posts:read",
    "posts:write",
    "stats:read"
  ]
}
```

## Errors

| Status | Reason | Message |
| --- | --- | --- |
| 401 | `api_key_invalid` | This API key isn't valid. Check it, or create a new one in the app. |
| 403 | `access_locked` | Your subscription isn't active, so this can't be changed right now. Visit Billing to fix it. |
| 429 | `slow_down` | You're going a bit fast. Wait a moment and try again. |
| 500 | `unknown_error` | Something went wrong on our side. We're on it. |
| 503 | `service_unavailable` | Something went wrong on our side. We're on it. |