Overview of the RTA API
The RTA API is the gateway to data and intelligence in RTA Fleet Management software. You can use the RTA API to build apps for your organization and consumers that interact with the data in RTA Fleet Management software. With the RTA API, you can connect to a wealth of resources, relationships, and intelligence, all through a single endpoint: https://api.momentum-prd.rtafleet.com
.
Authentication: Get API Token
Tenant ID (Serial Number)
Example: Finding your tenantId in the app URL
https://app.rtafleet.com/.../?tenantId=RTACAN01&facilityId=2
The tenantId identifies your RTA tenant and is also known as your Serial Number. You can find it by signing in to the RTA web app and looking at the browser URL—it's the value of the tenantId query parameter (for example, RTACAN01 in the example above). Use this value in the API path placeholders like /{tenantId} and when calling the Get API Token endpoint.
Client ID and Secret
Example: Get an API token
GET https://api.momentum-prd.rtafleet.com/information-management/{tenantId}/integrations/get-api-token?clientId={clientId}&clientSecret={clientSecret}
{
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIs..."
}
Authorization header
Authorization: Bearer eyJhbGciOi...
To call the RTA API, your app must obtain an API token from the Momentum Get API Token endpoint. Tokens are JSON Web Tokens (JWT) used as a Bearer token in the Authorization header. This will require a Client ID and Secret, which you can obtain by registering your app in Fleet360.
Your app must be registered with RTA. Registering your app establishes a unique application ID and other values that your app uses to authenticate with Auth0 and get tokens. You register your app by creating an API Key on Fleet360. More info can also be found here.
Permissions
The RTA API exposes granular permissions over resources (for example, vehicles:view, parts:update). The permissions associated with your API key determine what your integration can access. If an operation requires a permission that your token does not grant, the API returns an HTTP 403 with an error message indicating the missing permission.
Use the RTA API
Example: Get an API token
GET https://api.momentum-prd.rtafleet.com/information-management/{tenantId}/integrations/get-api-token?clientId={clientId}&clientSecret={clientSecret}
{
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6..."
}
Call an endpoint with the token
POST https://api.momentum-prd.rtafleet.com/asset-management/{tenantId}/vehicles/search-vehicles-enhanced
Authorization: Bearer eyJhbGciOi...
Content-Type: application/json
{
"queryOptions": {
"pagination": { "offset": 0, "limit": 50 },
"filters": [
{ "name": "vehicleNumber", "operator": "eq", "values": ["1001"] }
],
"sorts": [
{ "sortBy": "vehicleNumber", "sortOrder": "ASC" }
]
}
}
The RTA API is a REST web API. After you register your app and obtain an API token, you can make HTTPS requests to RTA endpoints using a Bearer token in the Authorization header. Your tenant identifier is called tenantId (also known as your Serial Number); see Tenant ID (Serial Number) to find it.
Base URL - https://api.momentum-prd.rtafleet.com
Authentication
- Obtain a token using the Get API Token endpoint.
- Include the token as a Bearer token in the Authorization header on every request.
A successful response includes the requested data and pagination metadata. See Paging for details on pagination fields.
Working with IDs
Example: Find a vehicle ID, then get details
POST https://api.momentum-prd.rtafleet.com/asset-management/{tenantId}/vehicles/search-vehicles-enhanced
Authorization: Bearer eyJhbGciOi...
Content-Type: application/json
{
"queryOptions": {
"pagination": { "offset": 0, "limit": 1 },
"filters": [
{ "name": "vehicleNumber", "operator": "eq", "values": ["1001"] }
]
}
}
Sample search response (truncated)
{
"items": [
{
"id": "UUID",
"vehicleNumber": "1001"
}
],
"meta": { /* ... */ }
}
Use the ID with detail/update endpoints
# Get details
GET https://api.momentum-prd.rtafleet.com/asset-management/{tenantId}/vehicles/{id}
Authorization: Bearer eyJhbGciOi...
# Update (example)
PUT https://api.momentum-prd.rtafleet.com/asset-management/{tenantId}/vehicles/{id}
Authorization: Bearer eyJhbGciOi...
Content-Type: application/json
{ "make": "Ford" }
Many endpoints that act on a specific resource (for example: get details, update, delete) require that resource’s unique identifier (id). You typically obtain these IDs from the corresponding search endpoints. Each search response includes an items
array where each item contains an id
field.
Typical flow
- Use a search endpoint to find the record and read its id
from the response
- Call the detail/update/delete endpoint using that id
Notes - IDs are stable unique identifiers (generally UUIDs) and are required for actions on a single resource across domains (Vehicles, Work Orders, Parts, etc.). - For nested resources (e.g., work order lines, attachments, comments), you may need both the parent ID and the child item ID; obtain each via their respective search/list endpoints.
Searching (Vehicles example)
Example request
POST https://api.momentum-prd.rtafleet.com/asset-management/{tenantId}/vehicles/search-vehicles-enhanced
Authorization: Bearer eyJhbGciOi...
Content-Type: application/json
Request body
{
"queryOptions": {
"pagination": { "offset": 0, "limit": 25 },
"filters": [
{ "name": "vehicleNumber", "operator": "eq", "values": ["1001"] },
{ "name": "year", "operator": "gte", "values": [2020] }
],
"sorts": [
{ "sortBy": "vehicleNumber", "sortOrder": "ASC" }
]
}
}
Response
{
"items": [
{
"id": "UUID",
"vehicleNumber": "1001",
"serialNumber": "1FT...123",
"make": "Ford",
"model": "F-150",
"year": 2022
}
],
"meta": {
"page": 1,
"totalPages": 1,
"totalRecords": 1,
"offset": 0,
"limit": 25,
"sorts": [{ "sortBy": "vehicleNumber", "sortOrder": "asc" }],
"searchMeta": null
}
}
Use the Vehicles search-vehicles-enhanced endpoint to perform flexible searches with filters, sorts, and pagination.
Endpoint - POST /asset-management/{tenantId}/vehicles/search-vehicles-enhanced
Request body (queryOptions)
- pagination: Controls paging through results
- offset: Number of records to skip (zero-based; first record is 0)
- limit: Maximum number of records to return
- filters: Array of filter objects to narrow results
- name: The field name to filter on (for example, vehicleNumber, year, facility.number)
- operator: How to compare the field to the provided values. Supported operators include:
- eq, neq
- gt, gte, lt, lte
- contains, beginsWith, endsWith
- values: Array of one or more values to evaluate against the field (strings, numbers, booleans, or null)
- sorts: Array of sort objects to order results
- sortBy: The field name to sort on (for example, vehicleNumber, year)
- sortOrder: ASC or DESC
The sort and filter fields are defined in the API Documentation for each endpoint.
API Reference
The RTA API is REST-based and uses standard HTTP methods and JSON payloads. You can explore available endpoints and models via the OpenAPI documentation:
As a note, the swagger docs do not currently support testing endpoints. You will need to test using postman or some other tool.
Key points
- Authenticate using a Bearer token obtained from the Get API Token endpoint.
- Use collection endpoints’ request bodies to provide queryOptions (pagination, filters, sorts).
- Responses include items and meta pagination data.
For a practical example of searching, see the Vehicles “search-vehicles-enhanced” example in this guide.
Errors
Sample error response (permission)
{
"statusCode": 403,
"error": "Forbidden",
"message": "Missing required permission vehicles:view",
"requiredPermission": "vehicles:view"
}
The RTA API uses standard HTTP status codes to indicate success or failure. Error responses include a JSON body with information about the error.
Common error status codes
- 400 Bad Request: The request is malformed or invalid. Verify the date you are sending is correct.
- 401 Unauthorized: Missing or invalid Bearer token.
- 403 Forbidden: The token does not grant the required permission.
- 404 Not Found: The requested resource does not exist. Verify the resource you are trying to access exists, and that your url is correct.
- 409 Conflict: The request conflicts with current state.
- 429 Too Many Requests: Throttling/rate limiting.
- 500 Internal Server Error: An unexpected error occurred.
Sample error response (validation)
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid filter field: vehicleNumbr"
}
Paging
Paging is handled using the queryOptions.pagination
object in the request body for collection endpoints. Responses include a meta
object with pagination details.
Example: Vehicles search with pagination
POST https://api.momentum-prd.rtafleet.com/asset-management/{tenantId}/vehicles/search-vehicles-enhanced
Authorization: Bearer eyJhbGciOi...
Content-Type: application/json
Request body
{
"queryOptions": {
"pagination": { "offset": 0, "limit": 50 }
}
}
Response
{
"items": [
{ "id": "UUID", "vehicleNumber": "1001", "year": 2022 }
],
"meta": {
"page": 1,
"totalPages": 74,
"totalRecords": 3698,
"offset": 0,
"limit": 50,
"sort": { "sortBy": "vehicleNumber", "sortOrder": "asc" },
"searchMeta": null
}
}
Terms
Term | Meaning |
---|---|
offset |
Number of records to skip (zero-based; first record is 0). |
limit |
Maximum number of records to return. |
page |
The current page number derived from offset/limit. |
totalPages |
Total number of pages given the current limit . |
totalRecords |
Total number of records available. |
Extracting data from RTA
RTA has built a simple REST API for extracting useful data directly from the RTA database. This is useful for customers who need direct access to the raw, unformatted data for use in data warehousing and other utility projects.
The data returned represents the actual physical column names in the database.
The data extract API can be used by first obtaining an access token as descrbed in this documentation. The access token is then used as a bearer token in the authorization
header.
Required Permission
A special API permission has been created to allow use of the data extract API. We recommend tighly controlling and securing the client id and client secret when granted this permission because anyone with these credentials will have full read access to all of the data in your database.
Permission Name | Description |
---|---|
api:extractTable | gives full read access to all tables in the customer database |
URL format of the extract API
Use the following URL to access the data extract API.
URL: https://api.rtafleet.com/v0/extract/<tablename>?etag=<etag>&limit=<limit>
Field | Description |
---|---|
tablename |
The name of the actual table in the RTA database. To obtain the table names you may request the data dictionary by contacting support@rtafleet.com |
etag |
The first etag value to return |
limit |
limit is not required, has a max of 1000 and defaults to 1000. If you choose to get your data in increments of 100, you could set limit=100. |
Examples calling the API
See the example at the right for the format of the data returned from the API.
The resulting object is:
{
"count": 1000,
"value" : [the rows from the table sorted by etag],
"nextEtag" : "12344"
}
where nextEtag
would be the very next etag value to use. nextEtag is not returned if you have received all the rows in the table.
Retreive the first 1000 records
Example retrieving records from
vehfile
curl --request GET \
--url "https://api.rtafleet.com/v0/extract/vehfile?etag=0&limit=1000" \
--header "authorization: Bearer $AUTH_TOKEN"
Sample reponse from
vehfile
{
"count":"1000",
"value":[
{FIRST RECORD IN TABLE},
...,
{1000th RECORD IN TABLE}
],
"nextEtag":"12345"
}
See the example CURL request at the right to retrieve the first 1000 records from the vehilces table vehfile
.
Retrieve any rows modified since the etag 12345
Sample request with etag
curl --request GET \
--url "https://api.rtafleet.com/v0/extract/vehfile?etag=12345&limit=1000" \
--header "authorization: Bearer $AUTH_TOKEN"
Sample response without nextEtag
{
"count":"50",
"value":[
{1001th RECORD IN TABLE},
...,
{1051th RECORD IN TABLE}
]
}
See the example CURL request at the right to retrieve anything that has been created or modified since the etag of 12345 has been retrieved.
Because nextEtag was not returned, there are no more rows to retrieve.
Errors in the data extract API
If you supply an invalid tablename, you will receive a 404 error.