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

# Query resources

> Paginate, search, filter, project, sort, and cache V2 API responses.

Every V2 resource is read the same way. The core collections are agents, offices, teams, brokerages, and regions.

```http theme={null}
GET /{resource}
GET /{resource}/{id}
```

The query parameters on this page work across these collections. Listings support the same pagination, projection, and sorting, with their own filters. See [Listings](https://docs.windermere.com/api-reference/v2/guides/listings.md).

## Pagination

List endpoints support two pagination modes. Passing `?page=` switches to offset mode. Otherwise, you get cursor mode.

| Mode | How to use it | Best for |
| - | - | - |
| Cursor (default) | Pass `?limit=` (1–200, default 50) and `?cursor=`. The response includes `data` and `nextCursor`. `?pageSize=` works as an alias for `?limit=`. | Syncing data |
| Offset | Pass `?page=` (starting at 1) and optionally `?pageSize=` (default 50, max 200). The response includes `page`, `pageSize`, `totalCount`, and `totalPages`. | Page-jump interfaces |

### Cursor mode

Follow `nextCursor` until it comes back `null`.

```http theme={null}
GET /agents?limit=50
  -> { "data": [ ... ], "nextCursor": "eyJ1Ijo...", "totalCount": null }

GET /agents?limit=50&cursor=eyJ1Ijo...
```

In cursor mode, `totalCount` is `null`. To get a count of all matching records, add `?withTotal=true`:

```http theme={null}
GET /agents?limit=50&withTotal=true
  -> { "data": [ ... ], "nextCursor": "...", "totalCount": 13142 }
```

### Offset mode

When you pass `?page=`, the API ignores `cursor` and `limit`.

```http theme={null}
GET /agents?page=1&pageSize=50
  -> { "data": [ ... ], "page": 1, "pageSize": 50,
       "totalCount": 13142, "totalPages": 263 }
```

## Search

Use `?q=` for free-text search. The API splits your search on spaces. A record matches when every word appears in at least one searchable field. Matching is case-insensitive and matches partial text.

For example, `?q=jane seattle` returns records where both "jane" and "seattle" appear somewhere searchable.

| Resource | Searchable fields |
| - | - |
| Agents | `firstName`, `lastName`, `primaryEmailAddress`, `mlsAgentId`, and the name and common name of the agent's primary and additional offices |
| Offices | `name`, `commonName`, `city` |
| Teams | `name` |

## Filters

Filters combine with search and with each other. A record must match all of them.

| Resource | Filters |
| - | - |
| Agents | `officeId` (primary office), `secondaryOfficeId` (additional office), `regionId`, `permissionLevel`, `includeInactive` |
| Offices | `brokerageId`, `regionId`, `state` (two-letter code), `internalOfficeId`, `mlsAbbreviation`, `officeMlsId`, `includeInactive`, `includeSystem` |
| Teams | `regionId`, `active`, `includeInactive` |

Inactive and system records are hidden by default. To include them, pass `?includeInactive=true` or `?includeSystem=true`.

To get only records that changed after a point in time, pass `?updatedSince=` with an ISO 8601 timestamp that includes a time zone, for example `2026-09-04T15:00:00Z`.

## Fields, related data, and sorting

| Parameter | Effect |
| - | - |
| `?fields=a,b,c` | Returns only the named fields on each record. |
| `?include=...` | Adds related data to each record. Agents support `teams`. Offices support `counts`, which adds `agentCount`, `agentsPendingTos`, and `mlsUserCount`. Unknown values return `400`. |
| `?sort=field` | Sorts ascending. Prefix a field with `-` to sort descending. Separate multiple fields with commas, for example `?sort=lastName,-hireDate`. |

Each resource allows sorting on specific fields only. For example, agents can sort on `firstName`, `lastName`, `hireDate`, `lastUpdatedAt`, and `permissionLevel`. Sorting on any other field returns `400 INVALID_SORT_FIELD`, and the response lists the allowed fields.

All of these combine in one request:

```http theme={null}
GET /agents?officeId=<uuid>&permissionLevel=agent&q=jane%20seattle
          &fields=id,firstName,lastName,primaryEmailAddress
          &include=teams
          &sort=lastName,-hireDate
```

## Caching with ETags

Single-record reads return a weak `ETag` header. Send it back in `If-None-Match`. If the record hasn't changed, the API returns `304 Not Modified` with no body.

```http theme={null}
GET /agents/<id>
  -> 200  ETag: W/"<id>:1723200000000"

GET /agents/<id>
If-None-Match: W/"<id>:1723200000000"
  -> 304 Not Modified
```

## Office fields

### Legal and display names

An office's legal entity name is `name`. Its display name is `commonName`.

> [!WARNING]
>
> `legalName` is deprecated and will be removed in a later release. It's `null` for every office migrated from V1. Use `name` instead.

### Office numbers and MLS IDs

* `internalOfficeId` is the office's short V1 office number, for example `80000`. It's unique.
* `legacyMoxiOfficeId` is the office's MoxiWorks GUID.
* `mlsMemberships` lists the office's MLS memberships as `{ mlsAbbreviation, mlsName, officeMlsId }` entries. Within one MLS, an `officeMlsId` belongs to exactly one office.

To find an office by its MLS ID or office number, filter the office list:

```http theme={null}
GET /offices?mlsAbbreviation=PSM&officeMlsId=<officeMlsId>&includeInactive=true
GET /offices?internalOfficeId=80000
```

## Related endpoints

* [List agents](https://docs.windermere.com/api-reference/v2/agents/list-agents.md)
* [Get agent by ID](https://docs.windermere.com/api-reference/v2/agents/get-agent-by-id.md)
* [List offices](https://docs.windermere.com/api-reference/v2/offices/list-offices.md)
* [Get office by ID](https://docs.windermere.com/api-reference/v2/offices/get-office-by-id.md)
* [List teams](https://docs.windermere.com/api-reference/v2/teams/list-teams.md)


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