/**
* 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 { CreateUserRequest } from '../samsara-models';
import { ListUserRolesResponse } from '../samsara-models';
import { ListUsersResponse } from '../samsara-models';
import { UpdateUserRequest } from '../samsara-models';
import { UserResponse } from '../samsara-models';
/**
* UsersApi - axios parameter creator
* @export
*/
export declare const UsersApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Add a user 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create a user
* @param {CreateUserRequest} user The user to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createUser: (user: CreateUserRequest, options?: RawAxiosRequestConfig) => Promise;
/**
* Delete the given user. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Delete a user
* @param {string} id Unique identifier for the user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteUser: (id: string, options?: RawAxiosRequestConfig) => Promise;
/**
* Get a specific user\'s information. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve a user
* @param {string} id Unique identifier for the user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUser: (id: string, options?: RawAxiosRequestConfig) => Promise;
/**
* Returns a list of all user roles 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all user roles
* @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}
*/
listUserRoles: (limit?: number, after?: string, options?: RawAxiosRequestConfig) => Promise;
/**
* Returns a list of all users in an organization. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all users
* @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}
*/
listUsers: (limit?: number, after?: string, options?: RawAxiosRequestConfig) => Promise;
/**
* Update a specific user\'s information. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update a user
* @param {string} id Unique identifier for the user.
* @param {UpdateUserRequest} user Updates to the user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateUser: (id: string, user: UpdateUserRequest, options?: RawAxiosRequestConfig) => Promise;
};
/**
* UsersApi - functional programming interface
* @export
*/
export declare const UsersApiFp: (configuration?: Configuration) => {
/**
* Add a user 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create a user
* @param {CreateUserRequest} user The user to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createUser(user: CreateUserRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Delete the given user. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Delete a user
* @param {string} id Unique identifier for the user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteUser(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Get a specific user\'s information. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve a user
* @param {string} id Unique identifier for the user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUser(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Returns a list of all user roles 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all user roles
* @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}
*/
listUserRoles(limit?: number, after?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Returns a list of all users in an organization. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all users
* @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}
*/
listUsers(limit?: number, after?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Update a specific user\'s information. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update a user
* @param {string} id Unique identifier for the user.
* @param {UpdateUserRequest} user Updates to the user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateUser(id: string, user: UpdateUserRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
};
/**
* UsersApi - factory interface
* @export
*/
export declare const UsersApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Add a user 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create a user
* @param {UsersApiCreateUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createUser(requestParameters: UsersApiCreateUserRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Delete the given user. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Delete a user
* @param {UsersApiDeleteUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteUser(requestParameters: UsersApiDeleteUserRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Get a specific user\'s information. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve a user
* @param {UsersApiGetUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUser(requestParameters: UsersApiGetUserRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Returns a list of all user roles 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all user roles
* @param {UsersApiListUserRolesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listUserRoles(requestParameters?: UsersApiListUserRolesRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Returns a list of all users in an organization. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all users
* @param {UsersApiListUsersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listUsers(requestParameters?: UsersApiListUsersRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Update a specific user\'s information. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update a user
* @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateUser(requestParameters: UsersApiUpdateUserRequest, options?: RawAxiosRequestConfig): AxiosPromise;
};
/**
* Request parameters for createUser operation in UsersApi.
* @export
* @interface UsersApiCreateUserRequest
*/
export interface UsersApiCreateUserRequest {
/**
* The user to create.
* @type {CreateUserRequest}
* @memberof UsersApiCreateUser
*/
readonly user: CreateUserRequest;
}
/**
* Request parameters for deleteUser operation in UsersApi.
* @export
* @interface UsersApiDeleteUserRequest
*/
export interface UsersApiDeleteUserRequest {
/**
* Unique identifier for the user.
* @type {string}
* @memberof UsersApiDeleteUser
*/
readonly id: string;
}
/**
* Request parameters for getUser operation in UsersApi.
* @export
* @interface UsersApiGetUserRequest
*/
export interface UsersApiGetUserRequest {
/**
* Unique identifier for the user.
* @type {string}
* @memberof UsersApiGetUser
*/
readonly id: string;
}
/**
* Request parameters for listUserRoles operation in UsersApi.
* @export
* @interface UsersApiListUserRolesRequest
*/
export interface UsersApiListUserRolesRequest {
/**
* The limit for how many objects will be in the response. Default and max for this value is 512 objects.
* @type {number}
* @memberof UsersApiListUserRoles
*/
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 UsersApiListUserRoles
*/
readonly after?: string;
}
/**
* Request parameters for listUsers operation in UsersApi.
* @export
* @interface UsersApiListUsersRequest
*/
export interface UsersApiListUsersRequest {
/**
* The limit for how many objects will be in the response. Default and max for this value is 512 objects.
* @type {number}
* @memberof UsersApiListUsers
*/
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 UsersApiListUsers
*/
readonly after?: string;
}
/**
* Request parameters for updateUser operation in UsersApi.
* @export
* @interface UsersApiUpdateUserRequest
*/
export interface UsersApiUpdateUserRequest {
/**
* Unique identifier for the user.
* @type {string}
* @memberof UsersApiUpdateUser
*/
readonly id: string;
/**
* Updates to the user.
* @type {UpdateUserRequest}
* @memberof UsersApiUpdateUser
*/
readonly user: UpdateUserRequest;
}
/**
* UsersApi - object-oriented interface
* @export
* @class UsersApi
* @extends {BaseAPI}
*/
export declare class UsersApi extends BaseAPI {
/**
* Add a user 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create a user
* @param {UsersApiCreateUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UsersApi
*/
createUser(requestParameters: UsersApiCreateUserRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Delete the given user. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Delete a user
* @param {UsersApiDeleteUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UsersApi
*/
deleteUser(requestParameters: UsersApiDeleteUserRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Get a specific user\'s information. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve a user
* @param {UsersApiGetUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UsersApi
*/
getUser(requestParameters: UsersApiGetUserRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Returns a list of all user roles 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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all user roles
* @param {UsersApiListUserRolesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UsersApi
*/
listUserRoles(requestParameters?: UsersApiListUserRolesRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Returns a list of all users in an organization. Users that have expired access will not be returned. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all users
* @param {UsersApiListUsersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UsersApi
*/
listUsers(requestParameters?: UsersApiListUsersRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Update a specific user\'s information. **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 Users** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update a user
* @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UsersApi
*/
updateUser(requestParameters: UsersApiUpdateUserRequest, options?: RawAxiosRequestConfig): Promise>;
}