/** * 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 { CreateDriverRequestAttributes } from './create-driver-request-attributes'; import { DriverCarrierSettings } from './driver-carrier-settings'; import { DriverHosSetting } from './driver-hos-setting'; import { UsDriverRulesetOverride } from './us-driver-ruleset-override'; /** * Driver that should be created. * @export * @interface CreateDriverRequest */ export interface CreateDriverRequest { /** * * @type {Array} * @memberof CreateDriverRequest */ 'attributes'?: Array; /** * * @type {DriverCarrierSettings} * @memberof CreateDriverRequest */ 'carrierSettings'?: DriverCarrierSettings; /** * The ID Card Code on the back of the physical card assigned to the driver. Contact Samsara if you would like to enable this feature. * @type {string} * @memberof CreateDriverRequest */ 'currentIdCardCode'?: string; /** * Flag indicating this driver may use Adverse Weather exemptions in ELD logs. * @type {boolean} * @memberof CreateDriverRequest */ 'eldAdverseWeatherExemptionEnabled'?: boolean; /** * Flag indicating this driver may use Big Day exemption in ELD logs. * @type {boolean} * @memberof CreateDriverRequest */ 'eldBigDayExemptionEnabled'?: boolean; /** * `0` indicating midnight-to-midnight ELD driving hours, `12` to indicate noon-to-noon driving hours. * @type {number} * @memberof CreateDriverRequest */ 'eldDayStartHour'?: number; /** * Flag indicating this driver is exempt from the Electronic Logging Mandate. * @type {boolean} * @memberof CreateDriverRequest */ 'eldExempt'?: boolean; /** * Reason that this driver is exempt from the Electronic Logging Mandate (see eldExempt). * @type {string} * @memberof CreateDriverRequest */ 'eldExemptReason'?: string; /** * Flag indicating this driver may select the Personal Conveyance duty status in ELD logs. * @type {boolean} * @memberof CreateDriverRequest */ 'eldPcEnabled'?: boolean; /** * Flag indicating this driver may select the Yard Move duty status in ELD logs. * @type {boolean} * @memberof CreateDriverRequest */ 'eldYmEnabled'?: boolean; /** * The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object. * @type {{ [key: string]: string; }} * @memberof CreateDriverRequest */ 'externalIds'?: { [key: string]: string; }; /** * A boolean indicating whether the driver has driving-related features hidden in the Driver App, including Vehicle selection, HOS, Routing, Team Driving, Documents, and Trip Logs. Default value is false if omitted. Note: only available to customers of Connected Forms. * @type {boolean} * @memberof CreateDriverRequest */ 'hasDrivingFeaturesHidden'?: boolean; /** * * @type {DriverHosSetting} * @memberof CreateDriverRequest */ 'hosSetting'?: DriverHosSetting; /** * Driver\'s state issued license number. The combination of this number and `licenseState` must be unique. * @type {string} * @memberof CreateDriverRequest */ 'licenseNumber'?: string; /** * Abbreviation of US state, Canadian province, or US territory that issued driver\'s license. * @type {string} * @memberof CreateDriverRequest */ 'licenseState'?: string; /** * Locale override (uncommon). These are specified by ISO 3166-2 country codes for supported locales. Valid values: `us`, `at`, `be`, `ca`, `gb`, `fr`, `de`, `ie`, `it`, `lu`, `mx`, `nl`, `es`, `ch`, `pr`. * @type {string} * @memberof CreateDriverRequest */ 'locale'?: CreateDriverRequestLocaleEnum; /** * Driver\'s name. * @type {string} * @memberof CreateDriverRequest */ 'name': string; /** * Notes about the driver. * @type {string} * @memberof CreateDriverRequest */ 'notes'?: string; /** * Password that the driver can use to login to the Samsara driver app. * @type {string} * @memberof CreateDriverRequest */ 'password': string; /** * The peer group tag id this driver belong to, used for gamification. * @type {string} * @memberof CreateDriverRequest */ 'peerGroupTagId'?: string; /** * Phone number of the driver. * @type {string} * @memberof CreateDriverRequest */ 'phone'?: string; /** * ID of vehicle that the driver is permanently assigned to. (uncommon). * @type {string} * @memberof CreateDriverRequest */ 'staticAssignedVehicleId'?: string; /** * Driver\'s assigned tachograph card number (Europe specific) * @type {string} * @memberof CreateDriverRequest */ 'tachographCardNumber'?: string; /** * IDs of tags the driver is associated with. If your access to the API is scoped by one or more tags, this field is required to pass in. * @type {Array} * @memberof CreateDriverRequest */ 'tagIds'?: Array; /** * Home terminal timezone, in order to indicate what time zone should be used to calculate the ELD logs. Driver timezones use [IANA timezone database](https://www.iana.org/time-zones) keys (e.g. `America/Los_Angeles`, `America/New_York`, `Europe/London`, etc.). You can find a mapping of common timezone formats to IANA timezone keys [here](https://unicode.org/cldr/charts/latest/supplemental/zone_tzid.html). * @type {string} * @memberof CreateDriverRequest */ 'timezone'?: string; /** * * @type {UsDriverRulesetOverride} * @memberof CreateDriverRequest */ 'usDriverRulesetOverride'?: UsDriverRulesetOverride; /** * Driver\'s login username into the driver app. The username may not contain spaces or the \'@\' symbol. The username must be unique. * @type {string} * @memberof CreateDriverRequest */ 'username': string; /** * Tag ID which determines which vehicles a driver will see when selecting vehicles. * @type {string} * @memberof CreateDriverRequest */ 'vehicleGroupTagId'?: string; /** * Flag indicating this driver may select waiting time duty status in ELD logs * @type {boolean} * @memberof CreateDriverRequest */ 'waitingTimeDutyStatusEnabled'?: boolean; } export declare const CreateDriverRequestLocaleEnum: { readonly Us: "us"; readonly At: "at"; readonly Be: "be"; readonly Ca: "ca"; readonly Gb: "gb"; readonly Fr: "fr"; readonly De: "de"; readonly Ie: "ie"; readonly It: "it"; readonly Lu: "lu"; readonly Mx: "mx"; readonly Nl: "nl"; readonly Es: "es"; readonly Ch: "ch"; readonly Pr: "pr"; }; export type CreateDriverRequestLocaleEnum = typeof CreateDriverRequestLocaleEnum[keyof typeof CreateDriverRequestLocaleEnum];