# List tenants

> Source: https://truto.one/docs/api-reference/admin/tenants/list/

`GET /tenant`

Resource: **Tenants**

## Query parameters

- **`id`** _(string)_
  Filter by tenant id (supports exact match and admin operators like `id[like]=acme%`).
- **`name`** _(string)_
  Filter by tenant display name.
- **`environment_id`** _(string)_
  Filter by environment. Only applicable to session auth; ignored for API tokens (already scoped to one environment).
- **`limit`** _(integer)_
  Page size (default 100, max 1000).
- **`next_cursor`** _(string)_
  Cursor from a previous response to fetch the next page.

## Response body

- **`result`** _(array<object>)_
  - **`id`** _(string)_
    The tenant identifier — caller-chosen, URL-path-safe, and immutable once created. Composite primary key with `environment_id`, so the same value can exist independently in `development`, `staging`, and `production`. Must match `^[A-Za-z0-9._:@+-]{1,255}$`.
  - **`environment_id`** _(string)_
    The environment this tenant belongs to.
  - **`name`** _(string)_
    Display name shown in the dashboard. Defaults to the tenant `id` on create if not supplied; can be edited later via `PATCH /tenant/{id}`.
  - **`metadata`** _(object)_
    Free-form JSON object stored verbatim. Truto does not interpret this field — use it for tier, region, billing plan, or any other customer attribute your app cares about.
  - **`created_at`** _(string)_
    The date and time when the tenant was created.
  - **`updated_at`** _(string)_
    The date and time when the tenant was last updated.
- **`next_cursor`** _(string)_
- **`limit`** _(number)_

## Code examples

### curl

```bash
curl -X GET 'https://api.truto.one/tenant' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.truto.one/tenant', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/tenant"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```
