# List API keys.

> Session only.
> https://koi.dog/docs/api/api-keys/list-api-keys/

`GET /api/v1/api-keys` · Key: `session only`

Never includes a token. To call it outside the dashboard, send the dashboard's `koidog_session` cookie. No path parameters.

## Query parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | `1–200` | no | How many items to return, 1 to 200. Default 50. |
| `cursor` | `string` | no | The `nextCursor` of the previous page. Only valid with the same filters and order. At least 1 character. |
| `order` | `enum` | no | `desc` is newest first; `asc` is oldest first. Collections sort by creation time, then id. One of `asc`, `desc`. Default `desc`. |

## Response.

One page of a list: `data` holds the items (each a `ApiKey`); `nextCursor` and `hasMore` lead to the next page. The example has placeholder values.

## Request.

```sh
# The dashboard session only: an API key is refused (403 session_required).
curl https://app.koi.dog/api/v1/api-keys \
    -H "Cookie: koidog_session=$KOIDOG_SESSION"
```

```js
// The dashboard session only: an API key is refused (403 session_required).
const res = await fetch("https://app.koi.dog/api/v1/api-keys", {
  headers: {
    Cookie: `koidog_session=${process.env.KOIDOG_SESSION}`,
  },
});
console.log(await res.json());
```

```python
import os

import requests

# The dashboard session only: an API key is refused (403 session_required).
r = requests.get(
    "https://app.koi.dog/api/v1/api-keys",
    headers={
        "Cookie": f"koidog_session={os.environ['KOIDOG_SESSION']}",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "data": [],
  "nextCursor": "string",
  "hasMore": false
}
```
