/** * 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 { AddressResponse } from '../samsara-models'; import { CreateAddressRequest } from '../samsara-models'; import { ListAddressesResponse } from '../samsara-models'; import { UpdateAddressRequest } from '../samsara-models'; /** * AddressesApi - axios parameter creator * @export */ export declare const AddressesApiAxiosParamCreator: (configuration?: Configuration) => { /** * Creates a new address in 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Create an address * @param {CreateAddressRequest} address The address to create. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAddress: (address: CreateAddressRequest, options?: RawAxiosRequestConfig) => Promise; /** * Delete a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Delete an address * @param {string} id ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAddress: (id: string, options?: RawAxiosRequestConfig) => Promise; /** * Returns a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Retrieve an address * @param {string} id ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAddress: (id: string, options?: RawAxiosRequestConfig) => Promise; /** * Returns a list of all addresses in an 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary List all addresses * @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 {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} */ listAddresses: (limit?: number, after?: string, parentTagIds?: Array, tagIds?: Array, createdAfterTime?: string, options?: RawAxiosRequestConfig) => Promise; /** * Update a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Update an address * @param {string} id ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @param {UpdateAddressRequest} address The address fields to update. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAddress: (id: string, address: UpdateAddressRequest, options?: RawAxiosRequestConfig) => Promise; }; /** * AddressesApi - functional programming interface * @export */ export declare const AddressesApiFp: (configuration?: Configuration) => { /** * Creates a new address in 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Create an address * @param {CreateAddressRequest} address The address to create. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAddress(address: CreateAddressRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Delete a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Delete an address * @param {string} id ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAddress(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Returns a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Retrieve an address * @param {string} id ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAddress(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Returns a list of all addresses in an 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary List all addresses * @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 {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} */ listAddresses(limit?: number, after?: string, parentTagIds?: Array, tagIds?: Array, createdAfterTime?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Update a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Update an address * @param {string} id ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @param {UpdateAddressRequest} address The address fields to update. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAddress(id: string, address: UpdateAddressRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; }; /** * AddressesApi - factory interface * @export */ export declare const AddressesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Creates a new address in 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Create an address * @param {AddressesApiCreateAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAddress(requestParameters: AddressesApiCreateAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Delete a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Delete an address * @param {AddressesApiDeleteAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAddress(requestParameters: AddressesApiDeleteAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Returns a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Retrieve an address * @param {AddressesApiGetAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAddress(requestParameters: AddressesApiGetAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Returns a list of all addresses in an 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary List all addresses * @param {AddressesApiListAddressesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAddresses(requestParameters?: AddressesApiListAddressesRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Update a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Update an address * @param {AddressesApiUpdateAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAddress(requestParameters: AddressesApiUpdateAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise; }; /** * Request parameters for createAddress operation in AddressesApi. * @export * @interface AddressesApiCreateAddressRequest */ export interface AddressesApiCreateAddressRequest { /** * The address to create. * @type {CreateAddressRequest} * @memberof AddressesApiCreateAddress */ readonly address: CreateAddressRequest; } /** * Request parameters for deleteAddress operation in AddressesApi. * @export * @interface AddressesApiDeleteAddressRequest */ export interface AddressesApiDeleteAddressRequest { /** * ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @type {string} * @memberof AddressesApiDeleteAddress */ readonly id: string; } /** * Request parameters for getAddress operation in AddressesApi. * @export * @interface AddressesApiGetAddressRequest */ export interface AddressesApiGetAddressRequest { /** * ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @type {string} * @memberof AddressesApiGetAddress */ readonly id: string; } /** * Request parameters for listAddresses operation in AddressesApi. * @export * @interface AddressesApiListAddressesRequest */ export interface AddressesApiListAddressesRequest { /** * The limit for how many objects will be in the response. Default and max for this value is 512 objects. * @type {number} * @memberof AddressesApiListAddresses */ 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 AddressesApiListAddresses */ 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 AddressesApiListAddresses */ readonly parentTagIds?: Array; /** * A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678` * @type {Array} * @memberof AddressesApiListAddresses */ readonly tagIds?: Array; /** * 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 AddressesApiListAddresses */ readonly createdAfterTime?: string; } /** * Request parameters for updateAddress operation in AddressesApi. * @export * @interface AddressesApiUpdateAddressRequest */ export interface AddressesApiUpdateAddressRequest { /** * ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123` * @type {string} * @memberof AddressesApiUpdateAddress */ readonly id: string; /** * The address fields to update. * @type {UpdateAddressRequest} * @memberof AddressesApiUpdateAddress */ readonly address: UpdateAddressRequest; } /** * AddressesApi - object-oriented interface * @export * @class AddressesApi * @extends {BaseAPI} */ export declare class AddressesApi extends BaseAPI { /** * Creates a new address in 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Create an address * @param {AddressesApiCreateAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AddressesApi */ createAddress(requestParameters: AddressesApiCreateAddressRequest, options?: RawAxiosRequestConfig): Promise>; /** * Delete a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Delete an address * @param {AddressesApiDeleteAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AddressesApi */ deleteAddress(requestParameters: AddressesApiDeleteAddressRequest, options?: RawAxiosRequestConfig): Promise>; /** * Returns a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Retrieve an address * @param {AddressesApiGetAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AddressesApi */ getAddress(requestParameters: AddressesApiGetAddressRequest, options?: RawAxiosRequestConfig): Promise>; /** * Returns a list of all addresses in an 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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary List all addresses * @param {AddressesApiListAddressesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AddressesApi */ listAddresses(requestParameters?: AddressesApiListAddressesRequest, options?: RawAxiosRequestConfig): Promise>; /** * Update a specific address. **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 Addresses** under the Addresses category when creating or editing an API token. Learn More. * @summary Update an address * @param {AddressesApiUpdateAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AddressesApi */ updateAddress(requestParameters: AddressesApiUpdateAddressRequest, options?: RawAxiosRequestConfig): Promise>; }