`lumail@2.1.0` · [`lumail.tokens`](/docs/sdk/v2/tokens)

```typescript
tokens.list(): Promise<LumailResult<ListApiTokensResponse>>
```

Secrets are last-4 only. The SDK takes no arguments and does not forward `?limit=`. The HTTP route may still accept `limit` if you call it with fetch.

## Parameters

No parameters.

## Response Fields

| Field | Type | Description |
| ---------- | ------------------- | ---------------------------------------------------------------------------------------------------------- |
| `object` | `"list"` | Discriminator. Always `list`. |
| `has_more` | boolean | `true` when the HTTP `limit` slice hid more rows. The SDK never sends `limit`, so this is usually `false`. |
| `data` | `ApiTokenSummary[]` | Tokens. Each row: `id`, `name`, `last4`, `permissions`, `createdAt`. |

`data` is `{ object, data, has_more }`. Failures return `{ data: null, error: { name, message, statusCode } }`.


## API Reference
**Method:** GET
**Endpoint:** /api/v2/tokens

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.tokens.list();
if (error) {
  throw error;
}
for (const token of data.data) {
  console.log(token.name, token.last4);
}
```

### cURL
```bash
curl https://lumail.io/api/v2/tokens \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### JavaScript
```javascript
const response = await fetch("https://lumail.io/api/v2/tokens", {
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
});
const data = await response.json();
```

### Success Response
```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "tok_abc123",
      "name": "CI",
      "last4": "9k2m",
      "permissions": ["emails", "subscribers"],
      "createdAt": "2026-09-05T10:30:00.000Z"
    }
  ]
}
```

### Error Response
```json
{
  "name": "missing_api_key",
  "message": "Missing API key",
  "statusCode": 401
}
```
