Skip to main content

Hosts

Hosts is the Falcon Hosts collection for this CID. Paths are under /devices/…. Deprecated host-hide and devices-actions RPCs are not implemented.

This collection is not CrowdStrike production. It does not call Falcon cloud.

RPC field notes: HostsService. REST schemas: API reference. Filter syntax: FQL.

These curls use Host: crowdstrike-api.localhost against Compose Traefik on :8088. If the hostname already resolves to Traefik, you can omit the Host header and call http://crowdstrike-api.localhost instead.

Auth​

Every call needs a console session or a Bearer token:

  • Cookie cs_console from CreateSession (POST /identity/entities/sessions/v1)
  • Authorization: Bearer with hosts:read for query and get

A session cookie bypasses OAuth scopes. Seed client cs-local-hosts / cs-local-hosts-secret has hosts:read and can query devices. That token cannot query or PATCH alerts.

HTTP paths​

MethodPathUse
GET/devices/queries/devices/v1Query ids. Query: filter, limit, offset, sort (hostname.asc / status.desc). Empty filter returns all ids.
GET/devices/entities/devices/v2?ids=Get devices. Missing id → 200 with only found resources.

Allowed FQL properties: hostname, status, platform_name. Unknown property or invalid filter → 400.

Device JSON: device_id, hostname, platform_name, status, last_seen.

Seed devices​

device_idhostnameplatform_namestatus
aid-win-01win-dc-01Windowsnormal
aid-win-02win-lap-02Windowsnormal
aid-lin-01lin-app-01Linuxnormal
aid-lin-02lin-build-02Linuxcontained
curl -sS -c cookies.txt -H 'Host: crowdstrike-api.localhost' \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","password":"FalconLocal!1","cloud":"us-1"}' \
http://127.0.0.1:8088/identity/entities/sessions/v1

Empty filter returns at least the four seed ids, including aid-win-01. hostname:'win*' returns only the Windows hosts:

curl -sS -H 'Host: crowdstrike-api.localhost' -b cookies.txt \
'http://127.0.0.1:8088/devices/queries/devices/v1?filter=hostname:%27win*%27&sort=hostname.asc'

Invalid FQL is 400:

curl -sS -o /dev/null -w '%{http_code}\n' \
-H 'Host: crowdstrike-api.localhost' -b cookies.txt \
'http://127.0.0.1:8088/devices/queries/devices/v1?filter=not-fql'
curl -sS -H 'Host: crowdstrike-api.localhost' -b cookies.txt \
'http://127.0.0.1:8088/devices/entities/devices/v2?ids=aid-win-01,aid-lin-02'

Query devices (Bearer)​

TOKEN='<access_token from POST /oauth2/token with cs-local-hosts>'
curl -sS -H 'Host: crowdstrike-api.localhost' \
-H "Authorization: Bearer ${TOKEN}" \
'http://127.0.0.1:8088/devices/queries/devices/v1'

hosts:read → 200. A token without that scope → 403. Missing or revoked token → 401.

OAuth2 mint/revoke: OAuth2.