Samsara Vehicle API
The Vehicle API from Samsara — 1 operation(s) for vehicle.
The Vehicle API from Samsara — 1 operation(s) for vehicle.
openapi: 3.0.1
info:
description: Gain greater visibility by connecting your fleets, equipment, sites, and people.
title: Samsara Vehicle API
version: '2024-11-18'
servers:
- url: https://api.samsara.com/
- url: https://api.eu.samsara.com/
security:
- AccessTokenHeader: []
tags:
- name: Vehicle
paths:
/fleet/reports/ifta/vehicle:
get:
description: "Get all vehicle IFTA reports for the requested time duration. Data is returned in your organization's defined timezone.\n\n**Note:** The most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours.\n\n <b>Rate limit:</b> 25 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Read IFTA (US)** under the Compliance category when creating or editing an API token. <a href=\"https://developers.samsara.com/docs/authentication#scopes-for-api-tokens\" target=\"_blank\">Learn More.</a>\n \n\n **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href=\"https://forms.gle/zkD4NCH7HjKb7mm69\" target=\"_blank\">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href=\"https://www.samsara.com/help\" target=\"_blank\">submit a case</a> to our support team."
operationId: getIftaVehicleReports
parameters:
- description: ' The year of the requested IFTA report summary. Must be provided with a month or quarter param. Example: `year=2021`'
in: query
name: year
required: true
schema:
maximum: 2100
minimum: 2015
type: integer
- description: ' The month of the requested IFTA report summary. Can not be provided with the quarter param. Example: `month=January` Valid values: `January`, `February`, `March`, `April`, `May`, `June`, `July`, `August`, `September`, `October`, `November`, `December`'
in: query
name: month
schema:
enum:
- January
- February
- March
- April
- May
- June
- July
- August
- September
- October
- November
- December
type: string
- description: ' The quarter of the requested IFTA report summary. Can not be provided with the month param. Q1: January, February, March. Q2: April, May, June. Q3: July, August, September. Q4: October, November, December. Example: `quarter=Q1` Valid values: `Q1`, `Q2`, `Q3`, `Q4`'
in: query
name: quarter
schema:
enum:
- Q1
- Q2
- Q3
- Q4
type: string
- description: ' A filter on the data based on this comma-separated list of jurisdictions. Example: `jurisdictions=GA`'
in: query
name: jurisdictions
schema:
type: string
- description: ' A filter on the data based on this comma-separated list of IFTA fuel types. Example: `fuelType=Diesel` Valid values: `Unspecified`, `A55`, `Biodiesel`, `CompressedNaturalGas`, `Diesel`, `E85`, `Electricity`, `Ethanol`, `Gasohol`, `Gasoline`, `Hydrogen`, `LiquifiedNaturalGas`, `M85`, `Methanol`, `Propane`, `Other`'
in: query
name: fuelType
schema:
enum:
- Unspecified
- A55
- Biodiesel
- CompressedNaturalGas
- Diesel
- E85
- Electricity
- Ethanol
- Gasohol
- Gasoline
- Hydrogen
- LiquifiedNaturalGas
- M85
- Methanol
- Propane
- Other
type: string
- description: ' A filter on the data based on this comma-separated list of vehicle IDs and externalIds. Example: `vehicleIds=1234,5678,samsara.vin:1HGBH41JXMN109186`'
in: query
name: vehicleIds
schema:
type: string
- description: ' A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678`'
in: query
name: tagIds
schema:
type: string
- description: ' 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`'
in: query
name: parentTagIds
schema:
type: string
- description: ' 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.'
in: query
name: after
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsResponseBody'
description: OK response.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsUnauthorizedErrorResponseBody'
description: Unauthorized response.
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsNotFoundErrorResponseBody'
description: Not Found response.
'405':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsMethodNotAllowedErrorResponseBody'
description: Method Not Allowed response.
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsTooManyRequestsErrorResponseBody'
description: Too Many Requests response.
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsInternalServerErrorResponseBody'
description: Internal Server Error response.
'501':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsNotImplementedErrorResponseBody'
description: Not Implemented response.
'502':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsBadGatewayErrorResponseBody'
description: Bad Gateway response.
'503':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsServiceUnavailableErrorResponseBody'
description: Service Unavailable response.
'504':
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsGatewayTimeoutErrorResponseBody'
description: Gateway Timeout response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/IFTAGetIftaVehicleReportsBadRequestErrorResponseBody'
description: Bad Request response.
summary: Get IFTA Vehicle Reports.
tags:
- Vehicle
components:
schemas:
IFTAGetIftaVehicleReportsInternalServerErrorResponseBody:
description: An internal server error occurred
properties:
message:
description: Message of error
example: Failed to execute GraphQL query.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IftaJurisdictionSummaryObjectResponseBody:
description: A summary of this jurisdiction's IFTA data.
properties:
jurisdiction:
description: Jurisdiction code.
example: GA
type: string
taxPaidLiters:
description: Liters purchased for all qualified vehicles.
example: 25.5
format: double
type: number
taxableMeters:
description: Distance in meters traveled on public roads in an IFTA jurisdiction.
example: 2350
format: double
type: number
totalMeters:
description: Total meters driven in this jurisdiction, taxable and non-taxable.
example: 2350
format: double
type: number
required:
- jurisdiction
- taxableMeters
- totalMeters
type: object
IftaVehicleReportDataObjectResponseBody:
description: Dictionary containing summarized vehicle report data.
properties:
month:
description: The specified month duration for this IFTA report.
example: January
type: string
quarter:
description: The specified quarter duration for this IFTA report.
example: Q4
type: string
troubleshooting:
$ref: '#/components/schemas/IftaReportTroubleshootingObjectResponseBody'
vehicleReports:
description: List of summarized vehicle reports.
items:
$ref: '#/components/schemas/IftaVehicleReportObjectResponseBody'
type: array
year:
description: The specified year for this IFTA report.
example: 2021
format: int64
type: integer
required:
- vehicleReports
- year
type: object
IFTAGetIftaVehicleReportsGatewayTimeoutErrorResponseBody:
description: Gateway timeout
properties:
message:
description: Message of error
example: context deadline exceeded
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IFTAGetIftaVehicleReportsBadGatewayErrorResponseBody:
description: Bad Gateway
properties:
message:
description: Message of error
example: 'rpc error: code = Unknown desc = connection refused'
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IftaReportTroubleshootingObjectResponseBody:
description: IFTA report troubleshooting information.
properties:
noPurchasesFound:
description: Whether or not fuel purchases were found for this report.
example: false
type: boolean
unassignedFuelTypePurchases:
description: The number of fuel purchases without a fuel type assigned. Fuel purchases are used to calculate tax paid gallons.
example: 200
format: int64
type: integer
unassignedFuelTypeVehicles:
description: The number of vehicles without a fuel type assigned. Vehicles without an assigned fuel type may affect total mileage.
example: 2500
format: int64
type: integer
unassignedVehiclePurchases:
description: Purchases without an assigned fuel type may affect tax-paid gallons and fleet mpg.
example: 2500
format: int64
type: integer
required:
- noPurchasesFound
- unassignedFuelTypePurchases
- unassignedFuelTypeVehicles
- unassignedVehiclePurchases
type: object
IFTAGetIftaVehicleReportsTooManyRequestsErrorResponseBody:
description: Too many requests
properties:
message:
description: Message of error
example: Exceeded rate limit.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
GoaPaginationResponseResponseBody:
description: Pagination parameters.
properties:
endCursor:
description: Cursor identifier representing the last element in the response. This value should be used in conjunction with a subsequent request's 'after' query parameter. This may be an empty string if there are no more pages left to view.
example: MjkY
type: string
hasNextPage:
description: True if there are more pages of results immediately available after this endCursor.
example: true
type: boolean
required:
- endCursor
- hasNextPage
type: object
IFTAGetIftaVehicleReportsUnauthorizedErrorResponseBody:
description: Unauthorized
properties:
message:
description: Message of error
example: Invalid token.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IFTAGetIftaVehicleReportsBadRequestErrorResponseBody:
description: Bad Request parameters
properties:
message:
description: Message of error
example: Invalid value for parameter.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IFTAGetIftaVehicleReportsServiceUnavailableErrorResponseBody:
description: Service unavailable
properties:
message:
description: Message of error
example: context deadline exceeded
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IFTAGetIftaVehicleReportsMethodNotAllowedErrorResponseBody:
description: Method not allowed
properties:
message:
description: Message of error
example: DELETE not allowed on /endpoint.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IFTAGetIftaVehicleReportsNotFoundErrorResponseBody:
description: Resource not found
properties:
message:
description: Message of error
example: Object not found.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IFTAGetIftaVehicleReportsNotImplementedErrorResponseBody:
description: Requested endpoint is not yet implemented
properties:
message:
description: Message of error
example: Not implemented.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
IFTAGetIftaVehicleReportsResponseBody:
properties:
data:
$ref: '#/components/schemas/IftaVehicleReportDataObjectResponseBody'
pagination:
$ref: '#/components/schemas/GoaPaginationResponseResponseBody'
required:
- data
- pagination
type: object
GoaVehicleTinyResponseResponseBody:
description: A minified vehicle object. This object is only returned if the route is assigned to the vehicle.
properties:
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
id:
description: ID of the vehicle
example: '494123'
type: string
name:
description: Name of the vehicle
example: 'Fleet Truck #1'
type: string
type: object
IftaVehicleReportObjectResponseBody:
description: A summary of this vehicle's IFTA data.
properties:
jurisdictions:
description: List of jurisdiction summaries.
items:
$ref: '#/components/schemas/IftaJurisdictionSummaryObjectResponseBody'
type: array
vehicle:
$ref: '#/components/schemas/GoaVehicleTinyResponseResponseBody'
required:
- jurisdictions
- vehicle
type: object
securitySchemes:
AccessTokenHeader:
type: http
scheme: bearer
x-original-swagger-version: '2.0'
x-readme:
explorer-enabled: true
proxy-enabled: true