# Your first API call

> Check your token with one request, read the answer, then list your servers.

This page takes you from a new token to your first answers from the API. Every call needs only the **Read** ability.

## Prerequisites

- An API token. See [Create and manage API tokens](/docs/developers/api-token).

## Make the call

<Steps>
<Step title="Call GET /platform">
Send the token in the `Authorization` header. Replace `YOUR_API_TOKEN` with your token.

The Node.js sample uses `await` at the top level. Save it as a `.mjs` file, or set `"type": "module"` in your `package.json`.

<CodeGroup>
```bash cURL
curl 'https://app.clokeep.com/api/v1/platform' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Accept: application/json'
```

```php PHP
<?php

$ch = curl_init('https://app.clokeep.com/api/v1/platform');

curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer YOUR_API_TOKEN',
    'Accept: application/json',
  ],
]);

$response = curl_exec($ch);

echo $response;
```

```javascript Node.js
const response = await fetch("https://app.clokeep.com/api/v1/platform", {
  headers: {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json",
  },
});

console.log(await response.text());
```

```python Python
import requests

response = requests.get(
    "https://app.clokeep.com/api/v1/platform",
    headers={
        "Authorization": "Bearer YOUR_API_TOKEN",
        "Accept": "application/json",
    },
)

print(response.text)
```
</CodeGroup>
</Step>
<Step title="Read the answer">
A working token gets `200` and this JSON object:

```json Response
{
  "version": "4.2.0",
  "api_version": "v1",
  "min_agent_version": "1.2.0",
  "panel_egress_ips": [
    "203.0.113.10",
    "2001:db8::10"
  ],
  "client": {
    "slug": "example-hosting",
    "limits": {
      "servers": 25,
      "storages": 10,
      "plans": 100,
      "users": 5
    },
    "usage": {
      "servers": 3,
      "storages": 1,
      "plans": 4,
      "users": 2
    }
  }
}
```

- `version` is the panel release that answered.
- `api_version` is `v1`, the version in every path.
- `min_agent_version` is the oldest agent release the panel still accepts.
- `panel_egress_ips` lists the addresses the panel connects to storages from. Allow them on a storage that accepts only known addresses. The list is empty when Clokeep has not published them. The addresses above are placeholders. See [The panel's addresses](/docs/how-clokeep-works#the-panels-addresses).
- `client.slug` is the short name of the client your token belongs to.
- `client.limits` is your cap for each resource. `null` means no cap.
- `client.usage` is how many of each you have now.

`GET /platform` answers with its own top-level fields. Most endpoints put their answer under `data`, as the next call shows.
</Step>
<Step title="List your servers">
Call `GET /servers`:

```bash cURL
curl 'https://app.clokeep.com/api/v1/servers' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Accept: application/json'
```

The answer is a page of servers under `data`, with `links` and `meta` beside it. Response, shortened: most of each server's keys, and `links` and `meta`, are left out.

```json Response, shortened
{
  "data": [
    {
      "id": 12,
      "name": "web-01",
      "ip": "203.0.113.10",
      "status": "online",
      "status_label": "Online",
      "control_panel": "plesk",
      "last_seen_at": "2026-11-20T02:00:04+00:00",
      "agent_version": "1.4.1"
    }
  ]
}
```

- `id` is the server's id. Other endpoints take it, such as `server_id` in `GET /backup-runs?server_id=12`.
- `status` is `online`, `offline` or `pending`, as **Agent status** on the server's page. See [Install the agent](/docs/servers/install-agent).
- `last_seen_at` is when the agent last checked in. Timestamps are in UTC.
</Step>
</Steps>

Lists come 15 items to a page. To read the next page, follow `links.next`. See [Pagination](/docs/api-reference/introduction#pagination).

The full answers, with every field, are on [Show the platform and your client](/docs/api-reference/platform/show-the-platform-and-your-client) and [List servers](/docs/api-reference/servers/list-servers).

## Troubleshooting

<Accordion title="401 with Unauthenticated.">
The token is missing, mistyped, revoked or expired. Check that the header reads `Authorization: Bearer` followed by a space and the whole token. Check the token's **Expires at** on **API Tokens**. If you no longer have the token, create a new one.
</Accordion>

<Accordion title="403 with Your role does not permit this action.">
Your role in the client no longer allows the call. A Customer cannot use the API. Ask an Admin to check your role on **Users**.
</Accordion>

## Next steps

<CardGroup cols="2">
<Card title="Run a backup through the API" href="/docs/developers/run-backup" icon="play">
Start a plan's backup and follow it to the end.
</Card>
<Card title="API introduction" href="/docs/api-reference/introduction" icon="code">
Abilities, conventions, errors and the rate limit.
</Card>
</CardGroup>
