/** * Samsara API * # Overview Something new! Welcome Samsara\'s new and improved API. Check out our FAQ [here](https://developers.samsara.com/docs/introducing-our-next-generation-api) to see what\'s changed and learn how to get started.

Want to access the legacy API docs? You can find them [here](https://www.samsara.com/api-legacy).

*Note: Because this is a new set of APIs, we have not transitioned all endpoints over to this standard. Endpoints that still use the legacy standards are indicated in the reference documentation. If you can\'t find an API that you\'re looking for, we encourage you to look for it in our [legacy API docs](https://www.samsara.com/api-legacy) as we continue to transition all endpoints over. Check back here for updates!*

Submit your feedback [here](https://forms.gle/r4bs6HQshQAvBuwv6)!
Samsara provides API endpoints so that you can build powerful applications and custom solutions with sensor data. Samsara has endpoints available to track and analyze sensors, vehicles, and entire fleets. The Samsara API is a [RESTful API](https://en.wikipedia.org/wiki/Representational_state_transfer). It uses standard [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) authentication, verbs, and response codes, and it returns [JSON](http://www.json.org/) response bodies. If you\'re familiar with what you can build with a REST API, then this will be your go-to API reference. Visit [developers.samsara.com](https://developers.samsara.com) to find getting started guides and an API overview. If you have any questions, please visit https://samsara.com/help. ## Endpoints All our APIs can be accessed through HTTP requests to URLs like: ``` https://api.samsara.com/ ``` For EU customers, this URL will be: ``` https://api.eu.samsara.com/ ``` Note Legacy endpoints will have the URL: `https://api.samsara.com/v1/` or `https://api.eu.samsara.com/v1/` ## Authentication To authenticate your API request you will need to include your secret token. You can manage your API tokens in the [Dashboard](https://cloud.samsara.com). They are visible under `Settings->Organization->API Tokens`. Your API tokens carry many privileges, so be sure to keep them secure. Do not share your secret API tokens in publicly accessible areas such as GitHub, client-side code, and so on. Authentication to the API is performed via Bearer Token in the HTTP Authorization header. Provide your API token as the `access_token` value in an `Authorization: Bearer` header. You do not need to provide a password: ```curl Authorization: Bearer {access_token} ``` All API requests must be made over [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP or without authentication will fail. ### OAuth2 If building an application for our marketplace, our API is accessible via. OAuth2 as well. | Type | Value | | ------------- |:-------------:| | Security scheme | OAuth2 | | OAuth2 Flow | accessCode | | Authorization URL | https://api.samsara.com/oauth2/authorize | | Token URL | https://api.samsara.com/oauth2/token | ## Common Patterns You can find more info about request methods, response codes, error codes, versioning, pagination, timestamps, and mini-objects [here](https://developers.samsara.com/docs/common-structures). * * The version of the OpenAPI document: 2024-11-18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import { RequestArgs, BaseAPI } from '../base'; import { CreateDriverRequest } from '../samsara-models'; import { DriverResponse } from '../samsara-models'; import { ListDriversResponse } from '../samsara-models'; import { UpdateDriverRequest } from '../samsara-models'; /** * DriversApi - axios parameter creator * @export */ export declare const DriversApiAxiosParamCreator: (configuration?: Configuration) => { /** * Add a driver to the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Create a driver * @param {CreateDriverRequest} driver The driver to create. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createDriver: (driver: CreateDriverRequest, options?: RawAxiosRequestConfig) => Promise; /** * Get information about a driver. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Retrieve a driver * @param {string} id ID of the driver. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: `key:value`. For example, `payrollId:ABFS18600` * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDriver: (id: string, options?: RawAxiosRequestConfig) => Promise; /** * Get all drivers in organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary List all drivers * @param {ListDriversDriverActivationStatusEnum} [driverActivationStatus] If value is `deactivated`, only drivers that are deactivated will appear in the response. This parameter will default to `active` if not provided (fetching only active drivers). * @param {number} [limit] The limit for how many objects will be in the response. Default and max for this value is 512 objects. * @param {string} [after] If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results. * @param {Array} [parentTagIds] A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678` * @param {Array} [tagIds] A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678` * @param {Array} [attributeValueIds] A filter on the data based on this comma-separated list of attribute value IDs. Only entities associated with ALL of the referenced values will be returned (i.e. the intersection of the sets of entities with each value). Example: `attributeValueIds=076efac2-83b5-47aa-ba36-18428436dcac,6707b3f0-23b9-4fe3-b7be-11be34aea544` * @param {string} [updatedAfterTime] A filter on data to have an updated at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). * @param {string} [createdAfterTime] A filter on data to have a created at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDrivers: (driverActivationStatus?: ListDriversDriverActivationStatusEnum, limit?: number, after?: string, parentTagIds?: Array, tagIds?: Array, attributeValueIds?: Array, updatedAfterTime?: string, createdAfterTime?: string, options?: RawAxiosRequestConfig) => Promise; /** * Update a specific driver\'s information. This can also be used to activate or de-activate a given driver by setting the driverActivationStatus field. If the driverActivationStatus field is \'deactivated\' then the user can also specify the deactivatedAtTime. The deactivatedAtTime cannot be more than 6 months in the past and must not come before the dirver\'s latest active HOS log. It will be considered an error if deactivatedAtTime is provided with a driverActivationStatus of active. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Update a driver * @param {string} id ID of the driver. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: `key:value`. For example, `payrollId:ABFS18600` * @param {UpdateDriverRequest} driver Updates to the driver properties. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDriver: (id: string, driver: UpdateDriverRequest, options?: RawAxiosRequestConfig) => Promise; }; /** * DriversApi - functional programming interface * @export */ export declare const DriversApiFp: (configuration?: Configuration) => { /** * Add a driver to the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Create a driver * @param {CreateDriverRequest} driver The driver to create. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createDriver(driver: CreateDriverRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Get information about a driver. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Retrieve a driver * @param {string} id ID of the driver. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: `key:value`. For example, `payrollId:ABFS18600` * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDriver(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Get all drivers in organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary List all drivers * @param {ListDriversDriverActivationStatusEnum} [driverActivationStatus] If value is `deactivated`, only drivers that are deactivated will appear in the response. This parameter will default to `active` if not provided (fetching only active drivers). * @param {number} [limit] The limit for how many objects will be in the response. Default and max for this value is 512 objects. * @param {string} [after] If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results. * @param {Array} [parentTagIds] A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678` * @param {Array} [tagIds] A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678` * @param {Array} [attributeValueIds] A filter on the data based on this comma-separated list of attribute value IDs. Only entities associated with ALL of the referenced values will be returned (i.e. the intersection of the sets of entities with each value). Example: `attributeValueIds=076efac2-83b5-47aa-ba36-18428436dcac,6707b3f0-23b9-4fe3-b7be-11be34aea544` * @param {string} [updatedAfterTime] A filter on data to have an updated at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). * @param {string} [createdAfterTime] A filter on data to have a created at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDrivers(driverActivationStatus?: ListDriversDriverActivationStatusEnum, limit?: number, after?: string, parentTagIds?: Array, tagIds?: Array, attributeValueIds?: Array, updatedAfterTime?: string, createdAfterTime?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Update a specific driver\'s information. This can also be used to activate or de-activate a given driver by setting the driverActivationStatus field. If the driverActivationStatus field is \'deactivated\' then the user can also specify the deactivatedAtTime. The deactivatedAtTime cannot be more than 6 months in the past and must not come before the dirver\'s latest active HOS log. It will be considered an error if deactivatedAtTime is provided with a driverActivationStatus of active. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Update a driver * @param {string} id ID of the driver. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: `key:value`. For example, `payrollId:ABFS18600` * @param {UpdateDriverRequest} driver Updates to the driver properties. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDriver(id: string, driver: UpdateDriverRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; }; /** * DriversApi - factory interface * @export */ export declare const DriversApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Add a driver to the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Create a driver * @param {DriversApiCreateDriverRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createDriver(requestParameters: DriversApiCreateDriverRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Get information about a driver. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Retrieve a driver * @param {DriversApiGetDriverRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDriver(requestParameters: DriversApiGetDriverRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Get all drivers in organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary List all drivers * @param {DriversApiListDriversRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDrivers(requestParameters?: DriversApiListDriversRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Update a specific driver\'s information. This can also be used to activate or de-activate a given driver by setting the driverActivationStatus field. If the driverActivationStatus field is \'deactivated\' then the user can also specify the deactivatedAtTime. The deactivatedAtTime cannot be more than 6 months in the past and must not come before the dirver\'s latest active HOS log. It will be considered an error if deactivatedAtTime is provided with a driverActivationStatus of active. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Update a driver * @param {DriversApiUpdateDriverRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDriver(requestParameters: DriversApiUpdateDriverRequest, options?: RawAxiosRequestConfig): AxiosPromise; }; /** * Request parameters for createDriver operation in DriversApi. * @export * @interface DriversApiCreateDriverRequest */ export interface DriversApiCreateDriverRequest { /** * The driver to create. * @type {CreateDriverRequest} * @memberof DriversApiCreateDriver */ readonly driver: CreateDriverRequest; } /** * Request parameters for getDriver operation in DriversApi. * @export * @interface DriversApiGetDriverRequest */ export interface DriversApiGetDriverRequest { /** * ID of the driver. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: `key:value`. For example, `payrollId:ABFS18600` * @type {string} * @memberof DriversApiGetDriver */ readonly id: string; } /** * Request parameters for listDrivers operation in DriversApi. * @export * @interface DriversApiListDriversRequest */ export interface DriversApiListDriversRequest { /** * If value is `deactivated`, only drivers that are deactivated will appear in the response. This parameter will default to `active` if not provided (fetching only active drivers). * @type {'active' | 'deactivated'} * @memberof DriversApiListDrivers */ readonly driverActivationStatus?: ListDriversDriverActivationStatusEnum; /** * The limit for how many objects will be in the response. Default and max for this value is 512 objects. * @type {number} * @memberof DriversApiListDrivers */ readonly limit?: number; /** * If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results. * @type {string} * @memberof DriversApiListDrivers */ readonly after?: string; /** * A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678` * @type {Array} * @memberof DriversApiListDrivers */ readonly parentTagIds?: Array; /** * A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678` * @type {Array} * @memberof DriversApiListDrivers */ readonly tagIds?: Array; /** * A filter on the data based on this comma-separated list of attribute value IDs. Only entities associated with ALL of the referenced values will be returned (i.e. the intersection of the sets of entities with each value). Example: `attributeValueIds=076efac2-83b5-47aa-ba36-18428436dcac,6707b3f0-23b9-4fe3-b7be-11be34aea544` * @type {Array} * @memberof DriversApiListDrivers */ readonly attributeValueIds?: Array; /** * A filter on data to have an updated at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). * @type {string} * @memberof DriversApiListDrivers */ readonly updatedAfterTime?: string; /** * A filter on data to have a created at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). * @type {string} * @memberof DriversApiListDrivers */ readonly createdAfterTime?: string; } /** * Request parameters for updateDriver operation in DriversApi. * @export * @interface DriversApiUpdateDriverRequest */ export interface DriversApiUpdateDriverRequest { /** * ID of the driver. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: `key:value`. For example, `payrollId:ABFS18600` * @type {string} * @memberof DriversApiUpdateDriver */ readonly id: string; /** * Updates to the driver properties. * @type {UpdateDriverRequest} * @memberof DriversApiUpdateDriver */ readonly driver: UpdateDriverRequest; } /** * DriversApi - object-oriented interface * @export * @class DriversApi * @extends {BaseAPI} */ export declare class DriversApi extends BaseAPI { /** * Add a driver to the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Create a driver * @param {DriversApiCreateDriverRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DriversApi */ createDriver(requestParameters: DriversApiCreateDriverRequest, options?: RawAxiosRequestConfig): Promise>; /** * Get information about a driver. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Retrieve a driver * @param {DriversApiGetDriverRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DriversApi */ getDriver(requestParameters: DriversApiGetDriverRequest, options?: RawAxiosRequestConfig): Promise>; /** * Get all drivers in organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary List all drivers * @param {DriversApiListDriversRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DriversApi */ listDrivers(requestParameters?: DriversApiListDriversRequest, options?: RawAxiosRequestConfig): Promise>; /** * Update a specific driver\'s information. This can also be used to activate or de-activate a given driver by setting the driverActivationStatus field. If the driverActivationStatus field is \'deactivated\' then the user can also specify the deactivatedAtTime. The deactivatedAtTime cannot be more than 6 months in the past and must not come before the dirver\'s latest active HOS log. It will be considered an error if deactivatedAtTime is provided with a driverActivationStatus of active. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Drivers** under the Drivers category when creating or editing an API token. Learn More. * @summary Update a driver * @param {DriversApiUpdateDriverRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DriversApi */ updateDriver(requestParameters: DriversApiUpdateDriverRequest, options?: RawAxiosRequestConfig): Promise>; } /** * @export */ export declare const ListDriversDriverActivationStatusEnum: { readonly Active: "active"; readonly Deactivated: "deactivated"; }; export type ListDriversDriverActivationStatusEnum = typeof ListDriversDriverActivationStatusEnum[keyof typeof ListDriversDriverActivationStatusEnum];