> ## Documentation Index
> Fetch the complete documentation index at: https://docs.provisionapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Listing and filtering

> Page through list endpoints and narrow them with search, filters, sort, and include.

Every `GET .../list` endpoint (and `GET /v1/labels`) shares the same query parameters and the same response envelope. Learn them once and they work everywhere.

| Parameter | What it does |
| - | - |
| `limit` | Page size. 1 to 100, default 20. |
| `offset` | Number of records to skip. Default 0. |
| `search` | Full-text search, the same search the ProVision portal uses. |
| `filters` | A URL-encoded JSON array of conditions, all of which must match. |
| `sort` | Comma-separated fields to order by. Prefix a field with `-` for descending. |
| `include` | Comma-separated related resources to expand inline. |

Not every list supports every parameter. See [What each list supports](#what-each-list-supports).

## Pagination

Every list returns `{ data, meta }`:

```json theme={null}
{
  "data": [{ "id": "57f2d879-20f8-4106-9abb-44fa099e0448", "subject": "Gate camera offline" }],
  "meta": { "total": 137, "limit": 20, "offset": 0 }
}
```

`meta.total` is the number of records that match your `search` and `filters`, across all pages. Keep requesting with a larger `offset` until `offset + limit >= meta.total`:

```javascript theme={null}
async function listAll(path, params = {}) {
  const records = [];
  for (let offset = 0; ; offset += 100) {
    const query = new URLSearchParams({ ...params, limit: '100', offset: String(offset) });
    const response = await fetch(`https://connect.provisionapp.io${path}?${query}`, {
      headers: { 'x-api-key': process.env.PROVISION_API_KEY },
    });
    const { data, meta } = await response.json();
    records.push(...data);
    if (offset + meta.limit >= meta.total) return records;
  }
}

const sites = await listAll('/v1/site/list', { sort: 'createdAt' });
```

> [!WARNING]
>
> Always pass `sort` when you page through conversations, sites, clients, or users. Those lists
> have no default order, so without one the same record can appear on two pages and another can
> be skipped.

Lists that do have a default order:

| List | Default order |
| - | - |
| Projects | Newest first (`-createdAt`) |
| Signal incidents | Newest first (`-createdAt`) |
| Labels | By name (`displayName`) |
| User groups | By name (`name`) |
| Conversation messages | Oldest first |
| Site files | Pinned files first, then newest |

A `sort` you pass replaces the default.

## Search

`search` runs the same full-text search as the portal's search bar, and matches related records too. For example, searching conversations for a client's phone number finds the conversations that client requested, and searching sites for a client's name finds that client's sites.

```bash theme={null}
curl -sS -G "https://connect.provisionapp.io/v1/client/list" \
  -H "x-api-key: $PROVISION_API_KEY" \
  --data-urlencode "search=jordan@example.com"
```

`search` and `filters` can be combined. A record must match both.

## Filters

`filters` is a JSON array of conditions. A record must match **every** condition. Each condition has:

| Field | Required | Meaning |
| - | - | - |
| `attribute` | Yes | The field to test. Each list has its own allowed set. |
| `operator` | Yes | One of the operators below. |
| `value` | Yes | Always a string, even for numbers, booleans, and lists. |
| `valueType` | No | How to read `value`: `boolean`, `number`, `number[]`, `string`, or `string[]`. |

| Operator | Matches when the field... |
| - | - |
| `=` / `!=` | equals / does not equal `value` |
| `in` / `not_in` | is / is not one of the comma-separated values in `value` (read as `string[]` unless you set `valueType` to `number[]`) |
| `ilike` / `not_ilike` | matches / does not match a case-insensitive pattern; `%` is the wildcard |
| `<`, `<=`, `>`, `>=` | compares to `value` (numbers and ISO 8601 dates) |
| `is_null` / `is_not_null` | is empty / is set (send `""` as `value`) |

URL-encode the JSON. With curl, `-G` plus `--data-urlencode` does it for you:

```bash theme={null}
curl -sS -G "https://connect.provisionapp.io/v1/conversation/list" \
  -H "x-api-key: $PROVISION_API_KEY" \
  --data-urlencode 'filters=[{"attribute":"status","operator":"in","value":"new,open","valueType":"string[]"},{"attribute":"urgency","operator":"=","value":"urgent"}]' \
  --data-urlencode "sort=-lastMessageReceivedAt"
```

More examples:

```json theme={null}
// Conversations created in October 2026
[
  { "attribute": "createdAt", "operator": ">=", "value": "2026-10-01T00:00:00.000Z" },
  { "attribute": "createdAt", "operator": "<", "value": "2026-11-01T00:00:00.000Z" }
]

// Unassigned conversations
[{ "attribute": "assigneeId", "operator": "is_null", "value": "" }]

// Monitored sites in Texas
[
  { "attribute": "state", "operator": "=", "value": "TX" },
  { "attribute": "isMonitored", "operator": "=", "value": "true", "valueType": "boolean" }
]

// Clients whose last name starts with "Mc"
[{ "attribute": "lastName", "operator": "ilike", "value": "Mc%" }]

// Sites whose "Tech Review Due" custom property is set
[{ "attribute": "customProperties.ca_tech_review_due", "operator": "is_not_null", "value": "" }]
```

Sites, clients, and conversations can also filter on their custom properties with `customProperties.<id>`. See [Filtering custom properties](https://docs.provisionapp.io/custom-properties-and-labels.md#filtering) for the operators each property type accepts.

A malformed array, an attribute the list doesn't allow, or an unknown operator returns `400 BAD_REQUEST`. See [Errors](https://docs.provisionapp.io/errors.md).

## Sort

`sort` takes a comma-separated list of fields, applied in order. Prefix a field with `-` to sort it descending:

```text theme={null}
sort=-urgency,lastMessageReceivedAt
```

## Include

`include` expands related resources inline, so you don't need a second request for each record. It takes a comma-separated list and works on the matching `GET` detail endpoint too:

```bash theme={null}
curl -sS "https://connect.provisionapp.io/v1/conversation/list?include=requester,assignee,labels" \
  -H "x-api-key: $PROVISION_API_KEY"
```

Leave out `include` when you don't need the related data. Responses are smaller and faster without it.

## What each list supports

### Conversations

`GET /v1/conversation/list`

* **search:** Yes
* **filters:** `id`, `type`, `status`, `urgency`, `assigneeId`, `conversationAssigneeGroupId`, `requesterId`, `createdAt`, `lastMessageReceivedAt`, `conversationStatusUpdatedAt`, `assigneeUpdatedAt`, `assigneeGroupUpdatedAt`, `requesterUpdatedAt`, `customProperties.<id>`
* **sort:** `createdAt`, `lastMessageReceivedAt`, `conversationStatusUpdatedAt`, `assigneeUpdatedAt`, `assigneeGroupUpdatedAt`, `requesterUpdatedAt`, `subject`, `status`, `urgency`
* **include:** `sites`, `participants`, `requester`, `labels`, `assignee`, `conversationAssigneeGroup`

### Sites

`GET /v1/site/list`

* **search:** Yes
* **filters:** `id`, `address1`, `address2`, `city`, `state`, `zip`, `businessName`, `brandId`, `isMonitored`, `sla`, `platformSlaId`, `createdAt`, `updatedAt`, `customProperties.<id>`
* **sort:** `address1`, `city`, `state`, `businessName`, `isMonitored`, `sla`, `platformSlaId`, `createdAt`, `updatedAt`
* **include:** `clients`, `projects`

### Clients

`GET /v1/client/list`

* **search:** Yes
* **filters:** `id`, `firstName`, `lastName`, `marketingOptOut`, `createdAt`, `updatedAt`, `email`, `phoneNumber`, `customProperties.<id>`
* **sort:** `firstName`, `lastName`, `marketingOptOut`, `createdAt`, `updatedAt`
* **include:** `emails`, `phoneNumbers`

### Users

`GET /v1/user/list`

* **search:** Yes
* **filters:** `id`, `firstName`, `lastName`, `email`, `phoneNumber`, `isActive`, `createdAt`, `updatedAt`
* **sort:** `firstName`, `lastName`, `email`, `isActive`, `createdAt`, `updatedAt`
* **include:** `conversationAssigneeGroups`, `userGroups`

### Projects

`GET /v1/project/list`

* **search:** Yes
* **filters:** `id`, `siteId`, `name`, `stage`, `isPrimary`, `estimatedDay1`, `day1StartDate`, `warrantyExpiration`, `signingDate`
* **sort:** `name`, `stage`, `estimatedDay1`, `day1StartDate`, `warrantyExpiration`, `signingDate`
* **include:** None

### Signal incidents

`GET /v1/signal-incident/list`

* **search:** Ignored
* **filters:** `id`, `conversationId`, `status`, `urgency`, `notificationTargetType`, `resolverId`, `createdAt`, `resolvedAt`, `updatedAt`
* **sort:** `createdAt`, `resolvedAt`, `updatedAt`, `status`, `urgency`
* **include:** None

### Labels

`GET /v1/labels`

* **search:** No
* **filters:** `labelId`, `displayName`, `labelGroupId`
* **sort:** `displayName`, `labelGroupId`
* **include:** None

### User groups

`GET /v1/user-group/list`

* **search:** No
* **filters:** `id`, `name`
* **sort:** `name`, `id`
* **include:** None

### Conversation messages

`GET /v1/conversation/{id}/message/list`

* **search:** No
* **filters:** None
* **sort:** None
* **include:** None

### Site files

`GET /v1/site/{id}/file/list`

* **search:** No
* **filters:** None
* **sort:** None
* **include:** None

The last two take `limit` and `offset` only. Signal incidents accept `search` but don't use it. Narrow them with `filters` instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.