# Get the calling token (https://notert.io/docs/api/reference/get-the-calling-token)

`GET /api/v1/token`

The token the call is made with: its workspace, what it may do, the boards and networks it is held to, when it expires and whose role its writes act with. Any token may read it, whatever its scopes. Never answers its secret.

Access: Any token.

## Response 200

| Field | Type | Description |
| --- | --- | --- |
| `name` | string | The token's name, as its settings list it. |
| `workspaceId` | string | The id of the workspace the token works in. |
| `workspaceName` | string | The workspace's name. |
| `scopes` | string[] | What the token may do, each scope as an endpoint's access names it. A call that needs another is INSUFFICIENT_SCOPE. |
| `boardIds` | string[] or null | The boards whose requests it reads and changes, by id, in the team's order. Null for every board. A board deleted since is left out. |
| `networks` | string[] | The networks a call may come from, each a CIDR block. Empty for anywhere; a call from elsewhere is NETWORK_NOT_ALLOWED. |
| `expiresAt` | date-time or null | When it stops working. Null for a token that works until it is revoked. |
| `holderId` | string or null | The teammate whose role its writes act with, by their m_ id: whoever made or last rolled it. Null while it has none, so every write is HOLDER_NOT_ALLOWED until a teammate rolls it. |

## Errors

| Status | Code | Message |
| --- | --- | --- |
| 400 | `BAD_REQUEST` | Input validation failed. |
| 401 | `UNAUTHORIZED` | Send a valid API token as a Bearer token. |
| 403 | `HOLDER_NOT_ALLOWED` | The teammate who holds this API token's secret can't do this in the workspace now. A teammate who can should roll it in the workspace's settings. |
| 403 | `NETWORK_NOT_ALLOWED` | This API token works only from the networks it was made for. Call from one of them, or create a token for this one in the workspace's settings. |
| 429 | `TOO_MANY_REQUESTS` | Too Many Requests. Its data holds `retryAfter`. |

## Example request

```sh
curl https://app.notert.io/api/v1/token \
  -H "Authorization: Bearer $NOTERT_API_TOKEN"
```

## Example response 200

```json
{
  "name": "Linear sync",
  "workspaceId": "kZ2pQ7xR4vW9tB1m",
  "workspaceName": "Acme",
  "scopes": [
    "requests:read",
    "requests:write"
  ],
  "boardIds": [
    "2d9a7c41-6b3e-4e8f-a1c5-0f4b8d2e6a17"
  ],
  "networks": [
    "203.0.113.0/24"
  ],
  "expiresAt": "2027-05-24T00:00:00.000Z",
  "holderId": "m_8Kd2pQ7xZ1tR4vW9"
}
```
