# List records (Proxy API)

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

`GET /proxy/{resource}`

Resource: **Proxy API**

Calls the `list` method of one of the integration's resources for an integrated account, with the account's credentials, and returns the integration's records as the integration returned them. Truto handles authentication, pagination and rate limits; it does not map the records to a unified model.

Query parameters other than `integrated_account_id` are passed to the integration's method config. Paginate with `next_cursor`.

**Auth:** an API token, or an integrated account token (then `integrated_account_id` comes from the token and can be left out).

## Path parameters

- **`resource`** _(string, required)_
  The name of a resource in the integration's config.

## Query parameters

- **`integrated_account_id`** _(string)_
  The integrated account to call. Required unless you call with an integrated account token.
- **`next_cursor`** _(string)_
  The `next_cursor` from the previous page.
- **`truto_response_format`** _(string)_
  `stream` returns the integration's response body as it arrives, without parsing it. Files and other non-JSON responses are already streamed; use `stream` for JSON or XML responses too large to process. `raw` returns the integration's whole response body instead of only the records at the method's response path.
  Allowed: `raw`, `stream`

## Response body

- **`result`** _(array<object> | object)_
  The records the integration returned, as the integration returned them.
- **`next_cursor`** _(string)_
  Pass this back as `next_cursor` to fetch the next page. Absent or `null` on the last page.
- **`prev_cursor`** _(string)_
  Pass this back as `prev_cursor` to fetch the previous page, when the integration supports it.
- **`result_count`** _(number)_
  The total number of records, when the integration reports one.

## Errors

| Status | Description |
| :----- | :---------- |
| `400` | `integrated_account_id` is missing, or the resource or method is not defined for the integration. |
| `404` | The integrated account was not found in your environments. |

## Code examples

### curl

```bash
curl -X GET 'https://api.truto.one/proxy/{resource}?integrated_account_id=<integrated_account_id>' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const integratedAccountId = '<integrated_account_id>';

const response = await fetch(`https://api.truto.one/proxy/{resource}?integrated_account_id=${integratedAccountId}`, {
  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/proxy/{resource}"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
    "integrated_account_id": "<integrated_account_id>"
}

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