SitesDevices

searchSiteDeviceEvents

GET
/api/v1/sites/{site_id}/devices/events/search

Search device events for a site with filters for MAC address, model, event type, message text, and time range. Use Search Org Device Events to search device events across the organization.

Authorization

Authorization<token>

Preferred authentication method for automation and integrations. Send the API token in the HTTP Authorization header.

Format: Authorization: Token {apitoken}

Notes:

  • An API token generated for a specific admin has the same privileges as that admin
  • An API token is automatically removed if it is not used for more than 90 days
  • SSO admins cannot generate admin API tokens. Use organization API tokens when scoped Org/Site privileges are needed.

In: header

Path Parameters

site_id*string
Formatuuid

Query Parameters

mac?string

Filter results by MAC address

model?string

Filter results by device model

text?string

Filter results by event message text

type?string
last_by?string

Return last/recent event for passed in field

includes?string

Keyword to include events from additional indices (e.g. ext_tunnel for prisma events)

limit?integer

Maximum number of results to return per page

Range0 <= value
Default100
start?string

Lower bound of the time range, as an epoch timestamp in seconds or a relative value such as -1d or -1w

end?string

Upper bound of the time range, as an epoch timestamp in seconds or a relative value such as -1d, -2h, or now

duration?string

Time range duration for the query, using relative units such as 10m, 7d, or 2w

Default"1d"
sort?string

On which field the list should be sorted, -prefix represents DESC order

Default"timestamp"
search_after?string

Pagination cursor for retrieving subsequent pages of results. This value is automatically populated by Mist in the next URL from the previous response and should not be manually constructed.

Response Body

curl -X GET "https://example.com/api/v1/sites/000000ab-00ab-00ab-00ab-0000000000ab/devices/events/search?last_by=port_id"
{  "end": 1531862583,  "limit": 2,  "next": "/api/v1/sites/8aaba0aa-09cc-44bd-9709-33b98040550c/devices/events/search?ap=5c5b350e0001&end=1531855849.000&limit=2&start=1531776183.0",  "results": [    {      "chassis_mac": "60c78d939c0f",      "count": 1,      "device_type": "switch",      "mac": "60c78d939c0f",      "model": "EX4100-48MP",      "org_id": "9777c1a0-6ef6-11e6-8bbf-02e208b2d34f",      "port_id": "ge-0/0/17",      "site_id": "978c48e6-6ef6-11e6-8bbf-02e208b2d34f",      "text": "ifIndex 533, ifAdminStatus up(1), ifOperStatus down(2), ifName ge-0/0/17",      "timestamp": 1764236687.435,      "type": "SW_PORT_DOWN",      "version": "23.4R2-S4.11"    },    {      "ap": "5c5b35d0077b",      "device_type": "ap",      "mac": "5c5b35d0077b",      "model": "AP43",      "org_id": "9777c1a0-6ef6-11e6-8bbf-02e208b2d34f",      "site_id": "46fc665e-9706-4296-8fe2-78f42f2e67e4",      "timestamp": 1764235684.467825,      "type": "AP_CONFIGURED"    }  ],  "start": 1531776183,  "total": 14}