/** * 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 { TrailersCreateTrailerRequestBody } from '../samsara-models'; import { TrailersCreateTrailerResponseBody } from '../samsara-models'; import { TrailersGetTrailerResponseBody } from '../samsara-models'; import { TrailersListTrailersResponseBody } from '../samsara-models'; import { TrailersUpdateTrailerRequestBody } from '../samsara-models'; import { TrailersUpdateTrailerResponseBody } from '../samsara-models'; /** * TrailersApi - axios parameter creator * @export */ export declare const TrailersApiAxiosParamCreator: (configuration?: Configuration) => { /** * Creates a new trailer asset. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Creates a new trailer asset * @param {TrailersCreateTrailerRequestBody} createTrailerRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTrailer: (createTrailerRequestBody: TrailersCreateTrailerRequestBody, options?: RawAxiosRequestConfig) => Promise; /** * Delete a trailer with the given ID. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Delete a trailer * @param {string} id Unique identifier for the trailer to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteTrailer: (id: string, options?: RawAxiosRequestConfig) => Promise; /** * Retrieve a trailer with given ID. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Retrieve a trailer * @param {string} id ID of the trailer. 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, \"maintenanceId:250020\". * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTrailer: (id: string, options?: RawAxiosRequestConfig) => Promise; /** * List all trailers. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary List all trailers * @param {string} [tagIds] A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678` * @param {string} [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 {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 {*} [options] Override http request option. * @throws {RequiredError} */ listTrailers: (tagIds?: string, parentTagIds?: string, limit?: number, after?: string, options?: RawAxiosRequestConfig) => Promise; /** * Update a trailer. **Note** this implementation of patch uses [the JSON merge patch](https://tools.ietf.org/html/rfc7396) proposed standard. This means that any fields included in the patch request will _overwrite_ fields which exist on the target resource. For arrays, this means any array included in the request will _replace_ the array that exists at the specified path, it will not _add_ to the existing array Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Update a trailer * @param {string} id ID of the trailer. Can be either unique Samsara ID or an [external ID](https://developers.samsara.com/docs/external-ids) for the trailer. * @param {TrailersUpdateTrailerRequestBody} updateTrailerRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateTrailer: (id: string, updateTrailerRequestBody: TrailersUpdateTrailerRequestBody, options?: RawAxiosRequestConfig) => Promise; }; /** * TrailersApi - functional programming interface * @export */ export declare const TrailersApiFp: (configuration?: Configuration) => { /** * Creates a new trailer asset. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Creates a new trailer asset * @param {TrailersCreateTrailerRequestBody} createTrailerRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTrailer(createTrailerRequestBody: TrailersCreateTrailerRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Delete a trailer with the given ID. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Delete a trailer * @param {string} id Unique identifier for the trailer to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteTrailer(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Retrieve a trailer with given ID. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Retrieve a trailer * @param {string} id ID of the trailer. 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, \"maintenanceId:250020\". * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTrailer(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * List all trailers. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary List all trailers * @param {string} [tagIds] A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678` * @param {string} [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 {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 {*} [options] Override http request option. * @throws {RequiredError} */ listTrailers(tagIds?: string, parentTagIds?: string, limit?: number, after?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Update a trailer. **Note** this implementation of patch uses [the JSON merge patch](https://tools.ietf.org/html/rfc7396) proposed standard. This means that any fields included in the patch request will _overwrite_ fields which exist on the target resource. For arrays, this means any array included in the request will _replace_ the array that exists at the specified path, it will not _add_ to the existing array Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Update a trailer * @param {string} id ID of the trailer. Can be either unique Samsara ID or an [external ID](https://developers.samsara.com/docs/external-ids) for the trailer. * @param {TrailersUpdateTrailerRequestBody} updateTrailerRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateTrailer(id: string, updateTrailerRequestBody: TrailersUpdateTrailerRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; }; /** * TrailersApi - factory interface * @export */ export declare const TrailersApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Creates a new trailer asset. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Creates a new trailer asset * @param {TrailersApiCreateTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTrailer(requestParameters: TrailersApiCreateTrailerRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Delete a trailer with the given ID. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Delete a trailer * @param {TrailersApiDeleteTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteTrailer(requestParameters: TrailersApiDeleteTrailerRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Retrieve a trailer with given ID. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Retrieve a trailer * @param {TrailersApiGetTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTrailer(requestParameters: TrailersApiGetTrailerRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * List all trailers. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary List all trailers * @param {TrailersApiListTrailersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listTrailers(requestParameters?: TrailersApiListTrailersRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Update a trailer. **Note** this implementation of patch uses [the JSON merge patch](https://tools.ietf.org/html/rfc7396) proposed standard. This means that any fields included in the patch request will _overwrite_ fields which exist on the target resource. For arrays, this means any array included in the request will _replace_ the array that exists at the specified path, it will not _add_ to the existing array Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Update a trailer * @param {TrailersApiUpdateTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateTrailer(requestParameters: TrailersApiUpdateTrailerRequest, options?: RawAxiosRequestConfig): AxiosPromise; }; /** * Request parameters for createTrailer operation in TrailersApi. * @export * @interface TrailersApiCreateTrailerRequest */ export interface TrailersApiCreateTrailerRequest { /** * * @type {TrailersCreateTrailerRequestBody} * @memberof TrailersApiCreateTrailer */ readonly createTrailerRequestBody: TrailersCreateTrailerRequestBody; } /** * Request parameters for deleteTrailer operation in TrailersApi. * @export * @interface TrailersApiDeleteTrailerRequest */ export interface TrailersApiDeleteTrailerRequest { /** * Unique identifier for the trailer to delete. * @type {string} * @memberof TrailersApiDeleteTrailer */ readonly id: string; } /** * Request parameters for getTrailer operation in TrailersApi. * @export * @interface TrailersApiGetTrailerRequest */ export interface TrailersApiGetTrailerRequest { /** * ID of the trailer. 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, \"maintenanceId:250020\". * @type {string} * @memberof TrailersApiGetTrailer */ readonly id: string; } /** * Request parameters for listTrailers operation in TrailersApi. * @export * @interface TrailersApiListTrailersRequest */ export interface TrailersApiListTrailersRequest { /** * A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678` * @type {string} * @memberof TrailersApiListTrailers */ readonly tagIds?: 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 {string} * @memberof TrailersApiListTrailers */ readonly parentTagIds?: string; /** * The limit for how many objects will be in the response. Default and max for this value is 512 objects. * @type {number} * @memberof TrailersApiListTrailers */ 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 TrailersApiListTrailers */ readonly after?: string; } /** * Request parameters for updateTrailer operation in TrailersApi. * @export * @interface TrailersApiUpdateTrailerRequest */ export interface TrailersApiUpdateTrailerRequest { /** * ID of the trailer. Can be either unique Samsara ID or an [external ID](https://developers.samsara.com/docs/external-ids) for the trailer. * @type {string} * @memberof TrailersApiUpdateTrailer */ readonly id: string; /** * * @type {TrailersUpdateTrailerRequestBody} * @memberof TrailersApiUpdateTrailer */ readonly updateTrailerRequestBody: TrailersUpdateTrailerRequestBody; } /** * TrailersApi - object-oriented interface * @export * @class TrailersApi * @extends {BaseAPI} */ export declare class TrailersApi extends BaseAPI { /** * Creates a new trailer asset. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Creates a new trailer asset * @param {TrailersApiCreateTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TrailersApi */ createTrailer(requestParameters: TrailersApiCreateTrailerRequest, options?: RawAxiosRequestConfig): Promise>; /** * Delete a trailer with the given ID. Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Delete a trailer * @param {TrailersApiDeleteTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TrailersApi */ deleteTrailer(requestParameters: TrailersApiDeleteTrailerRequest, options?: RawAxiosRequestConfig): Promise>; /** * Retrieve a trailer with given ID. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Retrieve a trailer * @param {TrailersApiGetTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TrailersApi */ getTrailer(requestParameters: TrailersApiGetTrailerRequest, options?: RawAxiosRequestConfig): Promise>; /** * List all trailers. Rate limit: 5 requests/sec (learn more about rate limits here). To use this endpoint, select **Read Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary List all trailers * @param {TrailersApiListTrailersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TrailersApi */ listTrailers(requestParameters?: TrailersApiListTrailersRequest, options?: RawAxiosRequestConfig): Promise>; /** * Update a trailer. **Note** this implementation of patch uses [the JSON merge patch](https://tools.ietf.org/html/rfc7396) proposed standard. This means that any fields included in the patch request will _overwrite_ fields which exist on the target resource. For arrays, this means any array included in the request will _replace_ the array that exists at the specified path, it will not _add_ to the existing array Rate limit: 100 requests/min (learn more about rate limits here). To use this endpoint, select **Write Trailers** under the Trailers category when creating or editing an API token. Learn More. **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. * @summary Update a trailer * @param {TrailersApiUpdateTrailerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TrailersApi */ updateTrailer(requestParameters: TrailersApiUpdateTrailerRequest, options?: RawAxiosRequestConfig): Promise>; }