Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Endpoints that GET a list of objects are paginated. This means that every time you make a request, you’ll receive one “page” of results and anendCursor to retrieve the next page:
| Call Sequence | Description |
|---|---|
| Call #1 | GET /fleet/vehicles First page of data endCursor: abcdefghasNextPage: true |
| Call #2 | GET /fleet/vehicles?after=abcdefg Second page of data endCursor: hijklmnophasNextPage: true |
| Call #3 | GET /fleet/vehicles?after=hijklmnop Third page of data endCursor: qrstuvwxyzhasNextPage: false |
Use the endCursor for subsequent requests
If
hasNextPage is true, use the endCursor to request the next page of data by providing it as the after parameter in your subsequent request. Continue to use any additional parameters you had passed in the 1st request.Sample Code
The limit Parameter
Some API endpoints support an optional limit query parameter. This parameter allows you to limit the number of objects returned on each page. The default and max for this value is 512.
If the endpoint does not support a limit parameter, then Samsara tunes the number of results on each page in order to optimize performance and may change the number of results on each page at any time.
Cursor Expiration
Cursors expire after 30 days.Real-time Data
Some API endpoints allow you to follow a feed of real-time data. These endpoints utilize pagination. Each time you make a request to one of the/feed endpoints with a cursor, you will receive all of the updates to the data since that cursor.
If hasNextPage is false, it is recommended that you wait at least 5 seconds before making another request to retrieve new data.
You can see an example of following real-time data in the Telematics Sync guide.
Short or Empty Pages
Sometimes a page might have very few results or might be empty buthasNextPage may still be true.
This behavior is due to how Samsara collects and stores data. Sometimes drivers, vehicles, or other objects will be inactive or will not have produced new data since the last time a request was made. In these cases, that object is omitted from the page of that response. However, objects on subsequent pages may still have updates.
It is important that you always keep paginating if hasNextPage is true. This will allow you to collect all the available data.