Quickstart

Samsara provides a robust set of REST APIs and Webhooks to allow you to integrate Samsara into virtually any platform. These APIs cover all of Samsara's major product areas, including telematics, safety, connected driver, and industrial management.

To make a call to the Samsara REST API, you need an API token. Go to the Settings page of the Samsara Dashboard by clicking the gear icon on the left-side nav bar. Then scroll down to "API Tokens".

19201920

Samsara Dashboard -> Settings -> API Tokens

Click "Add an API Token". You can select which Tags to limit the API token to and you can select which Scopes the API token should have (e.g. Routes, Compliance, Addresses, Drivers, Vehicles). Learn more about scopes in the Authentication developer guide.

13521352

Samsara uses the Bearer Token HTTP authentication scheme. In order to use the authentication token, include it in the Authorization header in your HTTP request:

curl --request GET 'https://api.samsara.com/fleet/vehicles' \
--header 'Authorization: Bearer <<token>>'

The Samsara API returns JSON-encoded responses:

{
    "data": [
        {
            "id": "212014918732717",
            "name": "Little Red",
            "vin": "JTMBK32V895081147",
            "serial": "GCKT9ZM8R9",
            "make": "Toyota",
            "model": "Rav4",
            "year": "2008",
            "harshAccelerationSettingType": "automatic",
            "notes": "",
            "licensePlate": "6KDB798",
            "externalIds": {
                "samsara.serial": "GCKT9ZM8R9",
                "samsara.vin": "JTMBK32V895081147"
            }
        }
    ],
    "pagination": {
        "endCursor": "",
        "hasNextPage": false
    }
}

Check out the REST API Overview to learn about the different capabilities of the Samsara REST API. Also check out the Webhooks guide to see how you can set up webhooks to notify your applications of different events of interest.


Did this page help you?