# Quickstart

> List the devices in your organization with one request, then narrow it down with a filter.

Source: https://docs.capaone.com/capaone/mcp-and-api/quickstart/  
Product: CapaOne — a separate CapaSystems product; do not apply this page to any other.

List the devices in your organization with one request, then narrow it down with a filter.

## Get an API key

You need an API key and the ID of the organization it belongs to. An organization manager creates
keys in the CapaOne console, under **Users & Organization → Edit → API Keys**. See
[Authentication](/capaone/mcp-and-api/authentication/#create-a-key) for the steps. The examples
below use `123456` as the organization ID; replace it with yours.

## Make your first request

Send the key in the `X-Api-Key` header. This returns the first 10 devices, sorted by name:

**curl**

```sh
export CAPAONE_API_KEY="<your API key>"

curl -H "X-Api-Key: $CAPAONE_API_KEY" \
  "https://mcp.capaone.com/api/organizations/123456/mcp/device/search?pageSize=10"
```

**PowerShell**

```powershell
$env:CAPAONE_API_KEY = '<your API key>'

Invoke-RestMethod -Headers @{ 'X-Api-Key' = $env:CAPAONE_API_KEY } `
  -Uri 'https://mcp.capaone.com/api/organizations/123456/mcp/device/search?pageSize=10'
```

The response is one page of devices:

```json title="Response (shortened)"
{
  "content": [
    {
      "id": "65f1c0a2e4b0a1b2c3d4e5f6",
      "name": "LAPTOP-0042",
      "osName": "Windows 11 Enterprise",
      "online": true,
      "lastCheckIn": "2026-09-30T08:12:44Z",
      "tags": ["finance"]
    }
  ],
  "totalElements": 1342,
  "totalPages": 135,
  "size": 10,
  "first": true,
  "last": false
}
```

- `content` holds the devices on this page. The [API Reference](https://mcp.capaone.com/docs/api/)
  lists every device field.
- `totalElements` and `totalPages` count every device that matches.
- Page with `pageNumber` (starting at 1) and `pageSize`: 25 devices by default, at most 200.

## Filter the results

Pass a `$filterV2` document in the `filter` query parameter. This one keeps the devices that are
online, with the most recent check-in first:

**curl**

```sh
curl -G -H "X-Api-Key: $CAPAONE_API_KEY" \
  --data-urlencode 'filter={"$filterV2":{"anyOf":[{"allOf":[{"field":"online","operator":"EQ","values":["true"]}]}]}}' \
  --data pageSize=25 \
  --data orderBy=lastCheckIn,desc \
  "https://mcp.capaone.com/api/organizations/123456/mcp/device/search"
```

**PowerShell**

```powershell
$filter = @{ '$filterV2' = @{ anyOf = @(@{ allOf = @(
  @{ field = 'online'; operator = 'EQ'; values = @('true') }
) }) } } | ConvertTo-Json -Depth 6 -Compress

Invoke-RestMethod -Headers @{ 'X-Api-Key' = $env:CAPAONE_API_KEY } `
  -Uri ('https://mcp.capaone.com/api/organizations/123456/mcp/device/search?pageSize=25&filter=' + [uri]::EscapeDataString($filter))
```

[Filtering Devices](/capaone/mcp-and-api/filtering-devices/) covers combining conditions, every
filterable field and inventory filters.
