Samsara Developer Portal

Integrate your data with the Samsara API, customize the Samsara experience, and join a community of developers building with Samsara.

Get Started

Filtering

By Tags

On most endpoints, you can optionally filter by tags.

To filter by tags, supply a comma-separated list of desired tag IDs in the tagIds query parameter. This will list all objects in any of the supplied tags.

For example:

curl -X GET \
  'https://api.samsara.com/fleet/vehicles?tagIds=55371,25956' \
  -H 'Authorization: Bearer <token>'

will list all the vehicles in either of the supplied tags (55371 or 25956).

By Object ID

On some endpoints, you can optionally filter by providing a comma-separated list of object IDs to the given query parameter. This will return data for any of the objects listed in the parameter,

For example:

curl -X GET \
  'https://api.samsara.com/fleet/vehicles/locations?vehicleIds=212014918234495,212014918481595' \
  -H 'Authorization: Bearer <token>'

will list location data for either of the vehicle IDs provided.

By Timestamp

Some endpoints support filtering based on when the objects were created or updated.

  • The createdAfterTime query parameter allows you to filter to objects that were created after a given time.
  • The updateAfterTime query parameter allows you to filter to objects that were created after a given time.

Timestamps should be provided in RFC 3339 format. See the Timestamps guide for details.

curl -X GET \
  'https://api.samsara.com/addresses?createdAfterTime=2020-05-26T00:00:00Z' \
  -H 'Authorization: Bearer <token>'

Updated 2 months ago


Filtering


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.