You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/fleet/fleet-api-docs.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -405,3 +405,51 @@ Example response (formatted for readability):
405
405
"total": 4
406
406
}
407
407
```
408
+
409
+
## List all {{agents}} [list-agents-api]
410
+
411
+
Use the [Get agents API](https://www.elastic.co/docs/api/doc/kibana/operation/operation-get-fleet-agents) to retrieve a list of currently enrolled {{agents}}:
412
+
413
+
```shell
414
+
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents
415
+
```
416
+
417
+
By default, a maximum of 10,000 agents are returned, with 20 agents listed per page.
418
+
419
+
### List all {{agents}} with `perPage` setting [list-agents-api-perpage]
420
+
421
+
The following query returns the same list, showing 10,000 {{agents}} per page:
422
+
423
+
```shell
424
+
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000'
425
+
```
426
+
427
+
### List the next set of 10,000 {{agents}} [list-agents-api-next-set]
428
+
```{applies_to}
429
+
stack: ga 9.1
430
+
```
431
+
432
+
Beginning with {{stack}} version 9.1, the previous query response includes a `nextSearchAfter` parameter that you can pass in a subsequent call, to retrieve the next page of 10,000 enrolled agents:
433
+
434
+
```shell
435
+
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000&searchAfter=<nextSearchAfter>'
436
+
```
437
+
438
+
### List all {{agents}} for a point in time [list-agents-api-point-in-time]
439
+
```{applies_to}
440
+
stack: ga 9.1
441
+
```
442
+
443
+
Beginning with {{stack}} version 9.1, you can also capture a point-in-time ID (`pitId`) parameter from the `Get agents API` response, and use that together with the `nextSearchAfter` parameter to capture the next page of 10,000 enrolled agents for a specific point in time.
444
+
445
+
Include the `openPit` and `pitKeepAlive` parameters in your initial request:
446
+
447
+
```shell
448
+
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000&openPit=true&pitKeepAlive=5m'
449
+
```
450
+
451
+
You can then use the returned values in a new request to retrieve the next set of 10,000 agents:
452
+
453
+
```shell
454
+
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000&searchAfter=<nextSearchAfter>&pitId=<pit id>&pitKeepAlive=5m'
0 commit comments