# Authentication Source: https://docs.withterminal.com/api-reference/authentication Learn how to authenticate with Terminal using API keys and connection tokens Terminal's authentication system uses a two-layer approach to secure access to data: * **API Keys** identify and authenticate your application with Terminal's platform. * **Tokens** authenticate your access to specific customer accounts. This layered security model ensures both proper application authentication and granular customer data access controls. ## API Keys API keys identify your application and authenticate your requests to Terminal's platform. Terminal provides two types of API keys for different use cases. Get your keys from the [Dashboard](https://dashboard.withterminal.com/api-keys). ### Publishable Key Your publishable key is used for client-side authentication from web browsers and mobile applications through the [consent flow](/guides/link). **Characteristics:** * Safe to expose in client-side code * Used for browser-based integrations * Can only create and re-connect connections **Usage:** ```jsx theme={null} import { useTerminalLink } from '@terminal-api/link-react'; const MyComponent = () => { const terminal = useTerminalLink({ publishableKey: 'pk_prod_...', // Your publishable key onSuccess: async ({ publicToken }) => { // Exchange public token for connection token await api.post('/api/terminal', { publicToken }); }, }); return ( ); }; ``` ### Secret Keys Secret keys are used for server-side authentication and provide full access to Terminal's backend APIs. > [!WARNING] > > Secret keys should never be exposed in client-side code or shared publicly as > they grant access to all of your data and your customers' information. **Characteristics:** * Must be kept secure on your servers * Provide full API access * Used for backend integrations and sensitive operations **Usage:** ```bash theme={null} # Include as Authorization header in API requests curl -H "Authorization: Bearer sk_prod_..." \ https://api.withterminal.com/tsp/v1/connections ``` ## Tokens Tokens represent your access to connected accounts, enabling you to retrieve data from specific customer telematics systems after they've granted consent through Terminal. ### Connection Tokens Connection tokens identify which specific customer connection you're making requests on behalf of. These tokens are generated during the [consent flow](/guides/link). > [!NOTE] > > **Note:** Connection tokens do not expire unless rotation is explicitly > requested. When a connection is disconnected and reconnected, the same token > is retained. **Characteristics:** * Specify which customer's data to access * Provide connection-specific authorization **Usage:** ```bash theme={null} # Server-side API call for specific connection curl -H "Authorization: Bearer sk_prod_..." \ -H "Connection-Token: con_tkn_..." \ https://api.withterminal.com/tsp/v1/vehicles ``` ### Public Tokens Public tokens function like authorization codes in an OAuth flow - they're temporary tokens received from the consent process that you exchange for connection tokens. **Characteristics:** * Safe to transmit but intended for immediate exchange * Must be combined with a secret key to generate connection tokens * Cannot access data on their own **Usage:** ```bash theme={null} # Exchange a public token for a connection token curl -X POST \ -H "Authorization: Bearer sk_prod_..." \ -H "Content-Type: application/json" \ -d '{"publicToken": "pt_..."}' \ https://api.withterminal.com/tsp/v1/public-token/exchange ``` ## Environment-Specific Keys Terminal provides separate keys and API endpoints for different [environments](./environments): * **Production**: Use production keys (prefixed with `pk_prod_` and `sk_prod_`) for production applications * API Base URL: `https://api.withterminal.com/tsp/v1` * **Sandbox**: Use sandbox keys (prefixed with `pk_sandbox_` and `sk_sandbox_`) for development and testing * API Base URL: `https://api.sandbox.withterminal.com/tsp/v1` # Public Token Exchange Source: https://docs.withterminal.com/api-reference/authentication/public-token-exchange POST /public-token/exchange Exchange the `publicToken` returned by our hosted authentication flow for a long lived connection token that will be used when requesting data from a customer's TSP. # CLI Source: https://docs.withterminal.com/api-reference/cli Configuration, global options, and commands for the Terminal CLI. > [!WARNING] > > The Terminal CLI is in **beta**. Commands, flags, and arguments may change > before a 1.0 release. Please share feedback via our shared Slack channel or > [support@withterminal.com](mailto:support@withterminal.com). The [Terminal CLI](https://github.com/terminal-api/terminal-cli) is an open-source command line for the Terminal API, published as [`@terminal-api/cli`](https://www.npmjs.com/package/@terminal-api/cli). Its commands are generated from the Terminal OpenAPI spec. For setup steps, see the [Agents guide](/guides/agents#cli). ```bash theme={null} npm install -g @terminal-api/cli ``` ## Configuration The CLI authenticates with a secret key and, for connection-scoped commands, a connection token. See [Authentication](/api-reference/authentication). ```bash theme={null} terminal config set api-key sk_prod_xxx terminal config set connection-token con_tkn_xxx ``` | Config key | Environment variable | Description | | - | - | - | | `api-key` | `TERMINAL_API_KEY` | Secret key from the [Dashboard](https://dashboard.withterminal.com/api-keys) | | `connection-token` | `TERMINAL_CONNECTION_TOKEN` | Connection token sent as the `Connection-Token` header | | `environment` | `TERMINAL_ENVIRONMENT` | `prod` or `sandbox`. Selects the [environment](/api-reference/environments) | | `base-url` | `TERMINAL_BASE_URL` | Overrides the API base URL. Defaults to `https://api.withterminal.com/tsp/v1` | Environment variables take precedence over the config file. The config file lives at `~/.terminal/config.json`; `terminal config show` prints the active values and `terminal config path` prints the file location. ### Profiles Profiles keep separate credentials, for example sandbox and production. The CLI ships with `prod` (default) and `sandbox` profiles. ```bash theme={null} terminal config set api-key sk_sandbox_xxx --profile sandbox terminal list-vehicles --profile sandbox terminal profile create staging terminal profile use sandbox terminal profile list ``` Set `TERMINAL_PROFILE` to choose a profile without passing `--profile`. ## Usage ```bash theme={null} terminal [options] ``` Run `terminal` with no arguments to open an interactive TUI for browsing and running commands. ### Global options | Option | Description | | - | - | | `--format ` | Output format: `json` (default), `pretty`, or `table` | | `--api-key ` | Overrides the configured secret key | | `--connection-token ` | Overrides the configured connection token | | `--profile ` | Uses a specific config profile | | `--all` | Follows `next` cursors and returns every page of results | | `--help`, `-h` | Shows help | | `--version`, `-v` | Shows the CLI version | ## Commands Each Terminal API operation is a command named after the operation in kebab-case. For example, [List Vehicles](/api-reference/vehicles/list-vehicles) is `terminal list-vehicles`. Unlike the [MCP server](/api-reference/mcp), the CLI includes write operations such as [passthrough](/api-reference/data-management/passthrough) and [request sync](/api-reference/data-management/request-sync). Path, query, and body parameters are flags with the same names as the API parameters: ```bash theme={null} terminal get-vehicle --id vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC terminal list-historical-vehicle-locations \ --vehicleId vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC \ --startAt 2026-01-01T00:00:00Z \ --endAt 2026-01-02T00:00:00Z terminal list-drivers --limit 10 --all ``` Commands are grouped the same way as the API reference: `authentication`, `connections`, `data-management`, `devices`, `drivers`, `fault-codes`, `groups`, `hours-of-service`, `ifta`, `issues`, `link`, `providers`, `safety`, `trailers`, `trips`, `vehicle-utilization`, and `vehicles`. Run `terminal --help` for the full list, or `terminal --help` for a command's flags. ### Response schemas Append `schema` to any command to print its response schema without calling the API: ```bash theme={null} terminal list-vehicles schema ``` ### Shell completions ```bash theme={null} eval "$(terminal completions bash)" # ~/.bashrc eval "$(terminal completions zsh)" # ~/.zshrc terminal completions fish > ~/.config/fish/completions/terminal.fish ``` ## Agent skills The CLI repo ships [skills and commands](https://github.com/terminal-api/terminal-cli/tree/main/ai) for Cursor, Claude Code, and OpenCode. Copy them into your project so the agent knows how to call the CLI. ## Rate limits CLI commands are ordinary Terminal API requests and count toward the same [rate limits](/api-reference/rate-limits). `--all` fetches pages one at a time. # Delete Current Connection Source: https://docs.withterminal.com/api-reference/connections/delete-current-connection DELETE /connections/current Request permanent deletion of the current connection and its synced data. This endpoint updates the connection's status to `pending_deletion` and returns `202 Accepted`. Deletion will begin asynchronously after a grace period. # Get Current Connection Source: https://docs.withterminal.com/api-reference/connections/get-current-connection GET /connections/current Get the details of the current active connection. The current connection is derived from the provided connection token. # List All Connections Source: https://docs.withterminal.com/api-reference/connections/list-connections GET /connections List all of the connections you have for your application. Connections represent the authenticated access you have to your customer's TSP data. # Update Current Connection Source: https://docs.withterminal.com/api-reference/connections/update-current-connection PATCH /connections/current Update the details of the current active connection. The current connection is derived from the provided connection token. Across all lists, the maximum is about 8,000 IDs. A larger update is rejected with 422 and is not saved. If one list contains most vehicles or drivers, use the opposite list: excludeIds for the ones to skip, or includeIds for the ones to keep. # Cancel Sync Source: https://docs.withterminal.com/api-reference/data-management/cancel-sync POST /syncs/{id}/cancel Cancel a sync job mid-way through. This is useful for cancelling syncs that are no longer needed. Cancelled syncs will be marked as failed and can be retried. # Get Sync Job Status Source: https://docs.withterminal.com/api-reference/data-management/get-sync-job-status GET /syncs/{id} Get the status of a sync job by ID. # List Sync History Source: https://docs.withterminal.com/api-reference/data-management/list-sync-history GET /syncs List a log of all batch sync jobs for the current connection. # Passthrough Source: https://docs.withterminal.com/api-reference/data-management/passthrough POST /passthrough Make an authenticated request to the underlying telematics provider. This endpoint helps ensure that you are never limited by Terminal. You can use passthrough requests to access capabilities that may be limited to a specific TSP or not yet in the normalized model. Our team is here and ready to support custom use cases that may need `/passthrough`. # Raw Passthrough Source: https://docs.withterminal.com/api-reference/data-management/passthrough-raw POST /passthrough/raw Make an authenticated request to the underlying telematics provider and forward successful provider response bodies directly. Use Raw Passthrough for provider endpoints that download inspection photos, documents, videos, or other non-JSON files. Response rules: * **Provider success (2xx):** the provider body is returned as raw bytes with the provider's `Content-Type` and status. * **Provider error (non-2xx):** the response is HTTP `200` with a `PassthroughOutput` JSON envelope (`statusCode`, `headers`, `response`), matching `/passthrough`. Unsuccessful provider responses are therefore not surfaced as Terminal API errors; check the envelope's `statusCode` for the provider status. * **Terminal error:** requests that fail before or around the provider call return a standard Terminal error status and JSON body. For normal JSON API calls where you want Terminal to parse and wrap successful provider responses too, use `/passthrough` instead. # Request Sync Source: https://docs.withterminal.com/api-reference/data-management/request-sync POST /syncs Manually request to sync the current connections data. By default, Terminal will sync all connections where `syncMode = automatic` on a regular cadence. For customers that may not need a fleet's data to be kept up to date and want to reduce their active tracked trucks, you can set `syncMode = manual` and invoke this endpoint when you want to sync data. If you're wondering if this is relevent to your use case then feel free to reach out and we'd be happy to assist. # Retry Sync Source: https://docs.withterminal.com/api-reference/data-management/retry-sync POST /syncs/{id}/retry Retry a failed sync job with the same parameters. This is useful for retrying syncs that failed due to temporary issues. # List Devices Source: https://docs.withterminal.com/api-reference/devices/list-devices GET /devices List all devices in the connected account. # Get Driver Source: https://docs.withterminal.com/api-reference/drivers/get-driver GET /drivers/{id} Get the details of a specific driver # List Drivers Source: https://docs.withterminal.com/api-reference/drivers/list-drivers GET /drivers List all of the drivers in the connected account # Environments Source: https://docs.withterminal.com/api-reference/environments Terminal provides a sandbox and production environment for you to test and launch your integration with our Unified APIs. The [sandbox environment](/guides/sandbox-environment) is built to resemble our production environment as much as possible while being limited to mock data. ## Base URLs ### Link URL | Environment | URL | | - | - | | `prod` | `https://link.withterminal.com/?key={PUBLISHABLE_KEY}` | | `sandbox` | `https://link.sandbox.withterminal.com/?key={PUBLISHABLE_KEY}` | ### API Base URL | Environment | URL | | - | - | | `prod` | `https://api.withterminal.com/tsp/v1` | | `sandbox` | `https://api.sandbox.withterminal.com/tsp/v1` | ## OpenAPI Specification You can access the latest Terminal OpenAPI specification from `https://api.withterminal.com/tsp/openapi`. # List Fault Code Events Source: https://docs.withterminal.com/api-reference/fault-codes/list-fault-code-events GET /fault-codes/events List all fault code events detected by the provider. # List Groups Source: https://docs.withterminal.com/api-reference/groups/list-groups GET /groups # Available Time for Drivers Source: https://docs.withterminal.com/api-reference/hours-of-service/list-hosavailable-time GET /hos/available-time List available time for the driver. This endpoint provides live access to the driver's available time. Different than most endpoints, this endpoint calls the provider's API in real time to get the latest available time for the driver. This endpoint is useful for building real time applications that need to know the driver's available time. # List HOS Daily Logs Source: https://docs.withterminal.com/api-reference/hours-of-service/list-hosdaily-logs GET /hos/daily-logs List daily summary of hours of service. Each daily log represents the time a driver spent in each duty status for a given day. # List HOS Logs Source: https://docs.withterminal.com/api-reference/hours-of-service/list-hoslogs GET /hos/logs List all hours of service logs. HOS logs are tracked as the distinct changes in duty status. # Get IFTA Summary Source: https://docs.withterminal.com/api-reference/ifta/get-iftasummary GET /ifta/summary Get distance driven per IFTA jurisdiction for the requested months. *Note:* data may change for a few days after the month. We will continue to update those reports to ensure you get accurate results. # List Issues Source: https://docs.withterminal.com/api-reference/issues/list-issues GET /issues List all issues that have been observed by Terminal. Issues are generated when we observe something that may impact the completeness or accuracy of the data we provide but do not justify a full error. For example, if we lack permissions for a specific resource or need to skip an item due to invalid data. # Resolve Issue Source: https://docs.withterminal.com/api-reference/issues/resolve-issue POST /issues/{issueId}/resolve Mark an issue's status as `resolved` until the issue is observed again. # Create Short Link URL Source: https://docs.withterminal.com/api-reference/link/create-short-link POST /link/short Create a short URL for the Link onboarding flow as an alternative to the full Link URL with all its query parameters. The response contains a durable `id`, an 8-character `code`, and the full `url` to share with your user. Short links are valid for 1 year from creation. Store the `id` if you may need to delete the short link later. The public `code` / `url` alone cannot be used to revoke a link. Identical request bodies are de-duplicated automatically. Calling this endpoint a second time with the same parameters returns the original short link (including its `id`) with an `Idempotent-Replayed: true` response header. # Delete Short Link Source: https://docs.withterminal.com/api-reference/link/delete-short-link DELETE /link/short/{id} Permanently delete a short link by its durable `id` from the create response (`slk_…`). This endpoint does not accept the 8-character `code` from the shared URL. After deletion, the short URL stops resolving immediately and the code may be reused by a future mint. # MCP Source: https://docs.withterminal.com/api-reference/mcp Endpoint, authentication, arguments, and tools for the Terminal MCP server. > [!WARNING] > > The Terminal MCP server is in **beta**. Tool names and arguments may change. > Please share feedback via our shared Slack channel or > [support@withterminal.com](mailto:support@withterminal.com). The MCP server exposes Terminal API read operations as [Model Context Protocol](https://modelcontextprotocol.io) tools. For setup steps, see the [Agents guide](/guides/agents#mcp-server). ## Endpoint ``` https://mcp.withterminal.com/mcp ``` | Property | Value | | - | - | | Transport | [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http), stateless (`POST` only) | | Auth | OAuth 2.1 with dynamic client registration | | API | Production. Tool calls are proxied to the Terminal production API | ## Authentication Clients authenticate with OAuth. When you add the server, your client opens a browser to sign in with your Terminal Dashboard account. You do not put a secret key (`sk_…`) in the client config. The server requests the `openid`, `profile`, `email`, `user:org:read`, and `public_metadata` scopes. The resulting token acts as your Dashboard user: every tool call is authorized against the applications in your active organization and the data that user can read. ## Arguments Each tool's input schema is generated from the matching API operation. Query and path parameters become tool arguments with the same names. The server also accepts the following arguments, which it maps onto the request: | Argument | Sent as | Description | | - | - | - | | `applicationId` | `X-Application-Id` header | Required on application-scoped tools. Resolve it with `listApplications`. | | `connectionToken` | `Connection-Token` header | Required on connection-scoped tools. Resolve it with `listConnections` and use the connection's `token`. See [Authentication](/api-reference/authentication). | | `intent` | Not sent | Optional. A short English summary of why the agent chose the tool. Used for analytics only; do not include IDs, PII, or secrets. | The server's instructions tell the agent to resolve `applicationId` and `connectionToken` before calling scoped tools, so you rarely need to provide them yourself. ## Tools Every tool is a `GET` against the Terminal API and is annotated `readOnlyHint`. The MCP server cannot create, update, or delete data. Tools map one-to-one to API operations, named by operation ID: for example, `listVehicles` is [List Vehicles](/api-reference/vehicles/list-vehicles) and `listHOSLogs` is [List HOS Logs](/api-reference/hours-of-service/list-hoslogs). Tools cover applications, connections, providers, vehicles and locations, drivers and HOS, trips, safety events, fault codes, devices, groups, trailers, IFTA, syncs, and issues. Ask your agent to list its tools for the current set. Tools return the API response body as JSON text. Paginated tools accept `cursor` and `limit` like the API; see [Pagination](/api-reference/pagination). ## Errors A tool call that fails returns an MCP result with `isError: true` and a text message: * **Invalid arguments.** The arguments do not match the tool's input schema. The message lists each failing field. * **API errors.** The Terminal API returned a non-2xx status. The message is `Terminal API : `. ## Rate limits Tool calls are ordinary Terminal API requests and count toward the same [rate limits](/api-reference/rate-limits). A `429` is returned to the agent as an API error. # Pagination Source: https://docs.withterminal.com/api-reference/pagination Pagination is available on endpoints returning object lists. Defaults and maximum page sizes are endpoint-dependent, but can return up to 40,000 rows with `gzip` compression enabled. ## Parameters * `limit`: Sets the maximum object count to return; varies per endpoint. * `cursor`: Retrieves the next page; found in the `next` field. Cursors may expire after a number of days, leading to an error response. > [!NOTE] > > **Important note:** There are some scenarios where you may receive more or > less than the requested `limit`. This is partially due to limitations of > telematics providers. Please ensure you rely on the presence of `next` rather > than the item count to know when you've reached the last page. This is > something we plan to improve in the future. ## Response A `next` field is present if more objects are available, containing the cursor for the next page. If no more objects exist, next will not be defined in the response. ### Example ```json theme={null} { "next": "sdfjsdlfkKLDJDFSjil23rjsdlkfj209jdsfoisndlsfn0ij09df", "results": [ { "id": "vcl_1234567890", "name": "Kenworth T680", "status": "active" // ... } ] } ``` # List Providers Source: https://docs.withterminal.com/api-reference/providers/list-providers GET /providers Retrieve a list of the providers Terminal supports. This endpoint will grow to include additional details about the supported capabilities of each provider. # Rate Limits Source: https://docs.withterminal.com/api-reference/rate-limits Terminal enforces API Rate Limits to protect against traffic spikes impacting our system and other Terminal customers. ## Global Rate Limits Every endpoint enforces the following rate limits: * **Per Connection** * Each connection token may make **100 API requests per second** * **Per Application** * Each application may make **400 API requests per second** * **Per Public IP** (for unauthenticated requests) * Each IP address may make **20 API requests per second** This means that if you have multiple connections, you may make up to 100 requests per second per connection with a maximum of 400 requests per second across all connections. ## Dense Time Series Data Query Rate Limits For dense time-series data endpoints (vehicle locations and vehicle stats), additional rate limits apply when querying historical data from previous months: * **Historical Query Requests** * **5 requests per second** per connection per model per month range * Only applies to data from **previous months** (current month data is not rate limited) ## Handling Rate Limit Errors When you exceed the rate limit, you will receive a `429 Too Many Requests` error. The response body will contain a `Retry-After` header with the number of seconds you should wait before retrying the request. ### Example ```http theme={null} HTTP/1.1 429 Too Many Requests Retry-After: 0.62 Content-Type: application/json Body: { "message": "Too Many Requests", "detail": "API rate limit exceeded - please try again in 0.62 s" } ``` # Resource Expansion Source: https://docs.withterminal.com/api-reference/resource-expansion Some of Terminal's endpoints feature an `expand` parameter that allows you to expand nested resources. This helps you get straight to the data you're looking for in less requests. ## Example As an example, if you are calling an expandable endpoint that includes the following relationship: ```json theme={null} { "vehicle": "vcl_01GSKTHKXVVS2EKE6MP0N20YPE" } ``` By providing `expand=vehicle` in the request you can expand the field to include all details: ```json theme={null} { "vehicle": { "id": "vcl_01GSKTHKXVVS2EKE6MP0N20YPE", "vin": "12345" // ... other vehicle properties } } ``` ## One-level expansion `expand` is one level deep. Nested relationship fields on an expanded entity stay IDs. For example, `expand=vehicle` returns the vehicle object, but `vehicle.devices` and `vehicle.groups` remain IDs. Request those resources separately (or with their own `expand`) if you need the nested objects. # Get Event Camera Media Source: https://docs.withterminal.com/api-reference/safety/get-event-camera-media GET /safety/events/{id}/camera-media Get camera media for a given safety event. # Get Safety Event Source: https://docs.withterminal.com/api-reference/safety/get-safety-event GET /safety/events/{id} Get a safety event by id. # List Safety Events Source: https://docs.withterminal.com/api-reference/safety/list-safety-events GET /safety/events List all safety events detected by the provider. # Serialization Source: https://docs.withterminal.com/api-reference/serialization ## Key Inflection All responses use `camelCase` for member names by default. However, you can override how member names are formatted by providing an additional `Key-Inflection: ` header to the request. The Terminal API currently accepts the following inflections: | Inflection | Example | Default | | - | - | - | | `camel` | `camelCase` | ✅ | | `kebab` | `kebab-case` | | | `pascal` | `PascalCase` | | | `snake` | `snake_case` | | ## Example ```bash theme={null} curl --request get \ --url https://api.withterminal.com/tsp/v1/connections \ --header 'Authorization: Bearer ' \ --header 'Key-Inflection: snake' ``` ```json theme={null} { "results": [ { "id": "id_pfx_01D8ZQFGHVJ858NBF2Q7DV9MNC", "company": { "name": "Frank's Trucking", "dot_numbers": ["1234567"] }, "status": "connected", "provider": { "code": "geotab", "name": "Geotab" }, "external_id": "1234", "sync_mode": "automatic", "token": "T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB", "created_at": "string", "updated_at": "string" } ], "next": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" } ``` # Latest Trailer Locations Source: https://docs.withterminal.com/api-reference/trailers/list-latest-trailer-locations GET /trailers/locations # List Trailers Source: https://docs.withterminal.com/api-reference/trailers/list-trailers GET /trailers # List Historical Trips Source: https://docs.withterminal.com/api-reference/trips/list-trips GET /trips List all historical trips in the connected account. Trips define a period of time where a vehicle is in motion. # Get Vehicle Utilization Source: https://docs.withterminal.com/api-reference/vehicle-utilization/get-vehicle-utilization GET /vehicles/utilization Get vehicle utilization days containing information about fuel consumption, distance traveled, and operational time metrics. # Get Vehicle Source: https://docs.withterminal.com/api-reference/vehicles/get-vehicle GET /vehicles/{id} Get the details of a specific vehicle # Historical Vehicle Locations Source: https://docs.withterminal.com/api-reference/vehicles/list-historical-vehicle-locations GET /vehicles/{vehicleId}/locations List the historical breadcrumb locations for a vehicle. *Note:* Given the large volume of location data available, we encourage customers to accept compressed (`gzip`) responses in order to maximize throughput. This is supported with many popular HTTP clients. Result limits vary depending on if results are compressed or not. # Historical Vehicle Stats Source: https://docs.withterminal.com/api-reference/vehicles/list-historical-vehicle-stats GET /vehicles/{vehicleId}/stats/historical List historical stats and logs about the vehicle. # Latest Vehicle Locations Source: https://docs.withterminal.com/api-reference/vehicles/list-latest-vehicle-locations GET /vehicles/locations List the latest location of the vehicles in the connected account. This endpoint will call the provider's API in real time to get the latest location of the vehicle. *Please note: this endpoint will exclude vehicles that have no last known location.* # List Vehicles Source: https://docs.withterminal.com/api-reference/vehicles/list-vehicles GET /vehicles List all of the vehicles in the connected account # connection.completed Source: https://docs.withterminal.com/api-reference/webhook-events/connection-completed This event is emitted when a user successfully completes the authentication process. This can occur either by creating a new connection or by merging with an existing connection to avoid duplicates. Subscribing to this event allows you to receive details of any successful authentication along with the resulting connection information. # connection.created Source: https://docs.withterminal.com/api-reference/webhook-events/connection-created Emitted when a connection is succesfully created with a provider account. # connection.deleted Source: https://docs.withterminal.com/api-reference/webhook-events/connection-deleted Emitted when a connection's data has been deleted. # connection.disconnected Source: https://docs.withterminal.com/api-reference/webhook-events/connection-disconnected Emitted when a connection is disconnected. This typically happens if credentials are deemed invalid and the user must re-authenticate. # connection.first_sync_completed Source: https://docs.withterminal.com/api-reference/webhook-events/connection-first-sync-completed Emitted when a connection's first successful sync completes. For S3/data delivery destinations, use delivery.completed to know when files have finished delivering. # connection.pending_deletion Source: https://docs.withterminal.com/api-reference/webhook-events/connection-pending-deletion Emitted when a connection has been marked for deletion. # connection.reconnected Source: https://docs.withterminal.com/api-reference/webhook-events/connection-reconnected Emitted when a connection is succesfully reconnected. This should happen when a customer re-authenticates after being disconnected. # connection.updated Source: https://docs.withterminal.com/api-reference/webhook-events/connection-updated Emitted when a connection's details are updated. # delivery.completed Source: https://docs.withterminal.com/api-reference/webhook-events/delivery-completed Emitted when a delivery completes successfully. # delivery.failed Source: https://docs.withterminal.com/api-reference/webhook-events/delivery-failed Emitted when a delivery fails. # delivery.requested Source: https://docs.withterminal.com/api-reference/webhook-events/delivery-requested Emitted when a delivery is requested. # delivery.started Source: https://docs.withterminal.com/api-reference/webhook-events/delivery-started Emitted when a delivery starts processing. # driver.added Source: https://docs.withterminal.com/api-reference/webhook-events/driver-added # driver.modified Source: https://docs.withterminal.com/api-reference/webhook-events/driver-modified # driver.removed Source: https://docs.withterminal.com/api-reference/webhook-events/driver-removed # issue.reported Source: https://docs.withterminal.com/api-reference/webhook-events/issue-reported Emitted when an issue with a connection has been reported. # issue.resolved Source: https://docs.withterminal.com/api-reference/webhook-events/issue-resolved Emitted when an ongoing issue is resolved, either automatically or through the Resolve Issue endpoint. # link.analytics_event_emitted Source: https://docs.withterminal.com/api-reference/webhook-events/link-analytics-event-emitted Emitted when a user performs a tracked action in the Link flow. # Event Types Source: https://docs.withterminal.com/api-reference/webhook-events/overview Terminal sends webhook events to your server to notify you of events that happen in your Terminal account. * [connection.created](/api-reference/webhook-events/connection-created) * [connection.disconnected](/api-reference/webhook-events/connection-disconnected) * [connection.reconnected](/api-reference/webhook-events/connection-reconnected) * [connection.completed](/api-reference/webhook-events/connection-completed) * [connection.updated](/api-reference/webhook-events/connection-updated) * [connection.pending_deletion](/api-reference/webhook-events/connection-pending-deletion) * [connection.deleted](/api-reference/webhook-events/connection-deleted) * [sync.requested](/api-reference/webhook-events/sync-requested) * [sync.started](/api-reference/webhook-events/sync-started) * [sync.completed](/api-reference/webhook-events/sync-completed) * [sync.failed](/api-reference/webhook-events/sync-failed) * [connection.first_sync_completed](/api-reference/webhook-events/connection-first-sync-completed) * [delivery.requested](/api-reference/webhook-events/delivery-requested) * [delivery.started](/api-reference/webhook-events/delivery-started) * [delivery.failed](/api-reference/webhook-events/delivery-failed) * [delivery.completed](/api-reference/webhook-events/delivery-completed) * [issue.reported](/api-reference/webhook-events/issue-reported) * [issue.resolved](/api-reference/webhook-events/issue-resolved) * [provider.availability_updated](/api-reference/webhook-events/provider-availability-updated) * [unsupported_provider.requested](/api-reference/webhook-events/unsupported-provider-requested) * [link.analytics_event_emitted](/api-reference/webhook-events/link-analytics-event-emitted) * [vehicle.added](/api-reference/webhook-events/vehicle-added) * [vehicle.modified](/api-reference/webhook-events/vehicle-modified) * [vehicle.removed](/api-reference/webhook-events/vehicle-removed) * [driver.added](/api-reference/webhook-events/driver-added) * [driver.modified](/api-reference/webhook-events/driver-modified) * [driver.removed](/api-reference/webhook-events/driver-removed) * [trailer.added](/api-reference/webhook-events/trailer-added) * [trailer.modified](/api-reference/webhook-events/trailer-modified) * [trailer.removed](/api-reference/webhook-events/trailer-removed) * [safety_event.added](/api-reference/webhook-events/safety-event-added) * [safety_event.modified](/api-reference/webhook-events/safety-event-modified) # provider.availability_updated Source: https://docs.withterminal.com/api-reference/webhook-events/provider-availability-updated Emitted when a provider's availability changes, such as during a provider outage and again once it recovers, and when the models an ongoing outage impacts change. This event is not tied to a connection: every application subscribed to it receives it for every provider. # safety_event.added Source: https://docs.withterminal.com/api-reference/webhook-events/safety-event-added # safety_event.modified Source: https://docs.withterminal.com/api-reference/webhook-events/safety-event-modified # sync.completed Source: https://docs.withterminal.com/api-reference/webhook-events/sync-completed Emitted when a connection sync completes successfully. For S3/data delivery destinations, use delivery.completed to know when files have finished delivering. # sync.failed Source: https://docs.withterminal.com/api-reference/webhook-events/sync-failed Emitted when a connection sync has failed to complete successfully. # sync.requested Source: https://docs.withterminal.com/api-reference/webhook-events/sync-requested Emitted when a connection sync has been requested and is queued to run. # sync.started Source: https://docs.withterminal.com/api-reference/webhook-events/sync-started Emitted when a connection sync has started running. # trailer.added Source: https://docs.withterminal.com/api-reference/webhook-events/trailer-added # trailer.modified Source: https://docs.withterminal.com/api-reference/webhook-events/trailer-modified # trailer.removed Source: https://docs.withterminal.com/api-reference/webhook-events/trailer-removed # unsupported_provider.requested Source: https://docs.withterminal.com/api-reference/webhook-events/unsupported-provider-requested Emitted when a customer requests an unsupported provider using our Link component. Please note, requesting unsupported providers is an optional feature we use to help inform which integrations your customers are asking for next. # vehicle.added Source: https://docs.withterminal.com/api-reference/webhook-events/vehicle-added # vehicle.modified Source: https://docs.withterminal.com/api-reference/webhook-events/vehicle-modified # vehicle.removed Source: https://docs.withterminal.com/api-reference/webhook-events/vehicle-removed # Changelog Source: https://docs.withterminal.com/changelog **2026-11-13** ### New Integrations * [Select ELD](/providers/tsp/select-eld) ### Integration Updates * [New ELD World](/providers/tsp/new-eld-world) now supports historical [Vehicle Locations](/models/vehicle-location) and additional [Vehicle Stat Logs](/models/vehicle-stat-log) from up to 6 months of history * [Teletrac Navman Director](/providers/tsp/teletrac-navman-director) now includes driver references on [Latest Vehicle Locations](/models/latest-vehicle-location) and [Historical Vehicle Locations](/models/vehicle-location) * [TT ELD](/providers/tsp/tt-eld) now supports [HOS Logs](/models/hos-log) * [ISAAC](/providers/tsp/isaac) now supports [Fault Code Events](/models/fault-code-event) * [PeopleNet](/providers/tsp/people-net) now links video-based [Safety Events](/models/safety-event) to matching drivers when available * [GPS Trackit](/providers/tsp/gps-trackit) now supports `license.number`, `license.state`, and `username` on [Drivers](/models/driver) * [GPS Insight](/providers/tsp/gps-insight) now maps [Trips](/models/trip) timestamps using each account's configured timezone * [ELD88](/providers/tsp/eld88) now supports [IFTA Vehicle Month](/models/ifta-summary) ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now includes provider detail pages with model coverage, availability history, and provider-specific connection views * The [Terminal Dashboard](https://dashboard.withterminal.com) now shows an API Access section on API Keys with enabled models, stat types, and endpoint access * Developers can now view and update Provider Configuration settings in the [Terminal Dashboard](https://dashboard.withterminal.com) * Link template editing in the [Terminal Dashboard](https://dashboard.withterminal.com) now includes a theme color picker, border-radius slider, and live preview ### Consent Flow Updates * Link now exposes provider setup guides for headless onboarding flows through guide-list and provider-guide endpoints ### API Updates * [List Sync History](/api-reference/data-management/list-sync-jobs) now supports `order=asc|desc` **2026-10-30** ### New Integrations * [Radius Telematics](/providers/tsp/radius-telematics) ### Integration Updates * [AirIQ](/providers/tsp/airiq) now supports [Devices](/models/device) * [Linxup](/providers/tsp/linxup) now supports `phone` on [Drivers](/models/driver) ### API Updates * Added a `provider.availability_updated` webhook event for provider outage and recovery updates, including impacted models * [Update Current Connection](/api-reference/connections/update-current-connection) now returns `422` for oversized vehicle and driver filter lists, with guidance to use the opposite include or exclude filter **2026-10-23** ### Integration Updates * [Verizon Reveal](/providers/tsp/verizon-reveal) now supports EU-region accounts * [Teletrac Navman 360](/providers/tsp/teletrac-navman-360) now supports vehicle make and model values in [Vehicles](/models/vehicle) ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now includes read-only Data Delivery settings with destination details and delivery history ### Consent Flow Updates * Link now shows an unavailable-provider message when a requested provider cannot be connected ### API Updates * 504 responses now return a documented `provider_timeout` code when the upstream provider times out **2026-10-16** ### Integration Updates * [Linxup](/providers/tsp/linxup) now supports [Vehicle Utilization](/models/vehicle-utilization-day) * [Omnitracs ES](/providers/tsp/omnitracs-es) now marks vehicles without an installed device as inactive * [Fleet Complete Hub](/providers/tsp/fleet-complete-hub) now fills missing safety-event location, speed, and heading from a nearby GPS snapshot when available * [Samsara](/providers/tsp/samsara) now avoids incorrectly classifying diesel vehicles as electric ### API Updates * Sync progress endpoints now return `404` when the underlying execution has expired instead of returning a server error **2026-10-09** ### New Integrations * [AWA ELD](/providers/tsp/awa-eld) ### API Updates * Added `deleted` filtering and `metadata.deletedAt` support to [HOS Logs](/models/hos-log), [Trips](/models/trip), and [Safety Events](/models/safety-event) list endpoints * Added `trailer.added`, `trailer.modified`, and `trailer.removed` webhook events **2026-10-02** ### New Integrations * [Onroad ELD](/providers/tsp/onroad-eld) ### Integration Updates * [One Step GPS](/providers/tsp/one-step-gps) now supports [Safety Events](/models/safety-event) and [Camera Media](/models/camera-media) * [Route One GO](/providers/tsp/route-one-eld) now appears with updated branding and provider naming ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now supports global connection search with Cmd+K (Ctrl+K on Windows/Linux) * Connection search in the [Terminal Dashboard](https://dashboard.withterminal.com) now treats spaces, hyphens, and underscores as equivalent so matching is more forgiving * Safety event detail pages in the [Terminal Dashboard](https://dashboard.withterminal.com) now provide a redesigned layout with richer event context and media viewing * The [Terminal Dashboard](https://dashboard.withterminal.com) now supports customer-managed logo libraries for Link branding, including upload, replacement, defaults, and template-level selection ### Consent Flow Updates * [Netradyne](/providers/tsp/netradyne) onboarding in Link now includes an install-confirmation step before credential entry ### Documentation Updates * Updated [Planning Your Implementation](/guides/planning-your-implementation) with numbered rollout steps and a new "Get access" step * Updated [Terminal Link](/guides/terminal-link) and [Consent Templates](/guides/consent-templates) guides with self-serve logo management workflows **2026-09-25** ### New Integrations * [Nuuk AI Cam](/providers/tsp/nuuk) * [Road Ready Solutions](/providers/tsp/roadready-solutions) ### Integration Updates * [Teletrac Navman Director](/providers/tsp/teletrac-navman-director) now supports UK-region authentication for UK accounts * [Rand Platform](/providers/tsp/rand-platform) now supports [Trailers](/models/trailer) * [Linxup](/providers/tsp/linxup) now resolves assigned drivers more accurately across trips, vehicle locations, and speeding [Safety Events](/models/safety-event) * [ProLogs](/providers/tsp/prologs), [AI ELD](/providers/tsp/ai-eld), and [Synergy ELD](/providers/tsp/synergy-eld) now support heading values in [Latest Vehicle Locations](/models/latest-vehicle-location) and [Historical Vehicle Locations](/models/vehicle-location) ### API Updates * OpenAPI schemas for expandable fields now preserve `Id | Expanded*` unions in generated types for `expand` responses ### Documentation Updates * Updated [Kinexa documentation](/providers/tsp/kinexa) with vehicle data characteristics for sample rate and available history **2026-09-18** ### New Integrations * [3MD ELD](/providers/tsp/3md) * [Hapn](/providers/tsp/hapn) * [Monster ELD](/providers/tsp/monster-eld) * [Zenduit](/providers/tsp/zenduit) ### Integration Updates * [SUN ELD](/providers/tsp/sun-eld) now supports assigned drivers and `fuel_level` in [Latest Vehicle Locations](/models/latest-vehicle-location) ### Documentation Updates * Updated [Quartix documentation](/providers/tsp/quartix) with both US and UK login pages * Updated [Production Readiness](/guides/production-readiness) with late-arriving data guidance and clarified when `externalId` and `tags` are optional **2026-09-11** ### New Integrations * [SUN ELD](/providers/tsp/sun-eld) * [RTE Logs](/providers/tsp/rte-logs) ### Integration Updates * [Rand Platform](/providers/tsp/rand-platform) now supports `fuel_level`, `engine_runtime`, and `engine_state` in [Vehicle Stat Logs](/models/vehicle-stat-log) * [ELD Mandate HOS](/providers/tsp/eld-mandate-hos) now supports [Camera Media](/models/camera-media) * [Zenduit](/providers/tsp/zenduit) now supports [Devices](/models/device), [Latest Vehicle Locations](/models/latest-vehicle-location), [Safety Events](/models/safety-event), and [Camera Media](/models/camera-media) ### Dashboard Updates * Requesting deletion from a connection detail page in the [Terminal Dashboard](https://dashboard.withterminal.com) now keeps you on the same page so you can review and cancel pending deletion ### Consent Flow Updates * Some integrations now support company selection for multi-company accounts during onboarding ### Feature Updates * S3 data deliveries now support byte limits up to 5 GB ### API Updates * Connection-scoped telematics endpoints now return `410 Gone` for connections in deletion states, and `Get Current Connection` / cancel-deletion flows remain available * Time-series cursors now include vehicle scoping safeguards to prevent cross-vehicle cursor reuse ### Documentation Updates * Common model pages now include a **Supported providers** section with linked provider coverage * Added a Link SDK note about COOP headers required for OAuth popup compatibility * Updated [Track Your Truck documentation](/providers/tsp/track-your-truck) with history and sample-rate data characteristics **2026-09-04** ### New Integrations * [Quartix](/providers/tsp/quartix) * [T-Mobile SyncUP](/providers/tsp/t-mobile-sync-up) * [SUNRISER ELD](/providers/tsp/sunriser-eld) * [SAFER ELD](/providers/tsp/safer-eld) * [Eld995](/providers/tsp/eld995) * [Masana ELD](/providers/tsp/masana-eld) * [Rand Platform](/providers/tsp/rand-platform) ### Common Model Updates * [Apollo ELD](/providers/tsp/apollo-eld) now supports [HOS Available Time](/models/hos-available-time) ### Integration Updates * [TXT ELD](/providers/tsp/txt-eld) now supports [Safety Events](/models/safety-event) and [Camera Media](/models/camera-media) * [ELD Mandate HOS](/providers/tsp/eld-mandate-hos) now supports [Safety Events](/models/safety-event) and [Devices](/models/device) * [Rand Platform](/providers/tsp/rand-platform) now supports [Trips](/models/trip), [Groups](/models/group), and [Latest Vehicle Locations](/models/vehicle-location) * [TruckX](/providers/tsp/truckx) now supports [Latest Trailer Locations](/models/latest-trailer-location) ### Consent Flow Updates * [Terminal Link](/guides/terminal-link) now supports Blue Ink account selection across multiple carriers during onboarding ### Documentation Updates * Rewrote the [Quickstart guide](/guides/quickstart) with a clearer implementation path **2026-08-21** ### New Integrations * [EzToTrack](/providers/tsp/eztotrack) * [Good Deal GPS](/providers/tsp/good-deal-gps) ### Common Model Updates * [HOS Daily Log](/models/hosdaily-log) now includes `vehicles` references when available ### Integration Updates * [TXT ELD](/providers/tsp/txt-eld) now supports [HOS Logs](/models/hos-log) and [HOS Daily Log](/models/hosdaily-log) * [TXT ELD](/providers/tsp/txt-eld) now supports [IFTA Vehicle Month](/models/ifta-summary) * [Lucid ELD](/providers/tsp/lucid-eld) now maps fuel level in [Latest Vehicle Locations](/models/vehicle-location) ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now uses a collapsible sidebar layout for improved navigation ### Documentation Updates * Provider documentation pages now appear in docs search results * Reorganized docs navigation around a clearer customer lifecycle journey * Updated the [Backfill Duration guide](/guides/backfill-duration) with factors that influence sync time **2026-08-14** ### Common Model Updates * [Devices](/models/device) now support `phone` as a device type ### Integration Updates * [Omnitracs OT1](/providers/tsp/omnitracs-ot1) now maps mobile devices as `phone` entries in [Devices](/models/device) ### Consent Flow Updates * Consent Templates now support Provider Access Control overrides so each template can offer a different provider set during onboarding ### API Updates * Added [DELETE /link/short/](/api-reference/link/delete-short-link) so you can remove Link short links * API requests against deleted connections now return `410 Gone` (`connection_deleted`) so deleted and disconnected states are handled differently ### Documentation Updates * Reworked the [Production Readiness guide](/guides/production-readiness) into a step-by-step checklist for launch planning **2026-08-07** ### Feature Updates * Provider Access Control now applies to onboarding flows while existing connections can still reconnect, run actions, and sync historical data **2026-07-31** ### New Integrations * [Counting Trucks](/providers/tsp/counting-trucks) * [Trackmile](/providers/tsp/trackmile) * [Transit Tracking ELD](/providers/tsp/transit-tracking-eld) * [TXT DashCam](/providers/tsp/txt-dashcam) ### Integration Updates * [DriverBook](/providers/tsp/driverbook) now supports [HOS Available Time](/models/hos-available-time) * [ISAAC](/providers/tsp/isaac) now maps additional normalized [Driver](/models/driver) metadata and location address context on [Historical Vehicle Locations](/models/vehicle-location) ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now adds provider search in Provider Access Control settings * Canceling pending connection deletion in the [Terminal Dashboard](https://dashboard.withterminal.com) now returns the connection to `archived` status * Sync history in the [Terminal Dashboard](https://dashboard.withterminal.com) now shows backfill as readable durations ### Documentation Updates * Added [Kafka destination documentation](/guides/kafka-destination) * Added a new guide for [Provider Access Control](/guides/provider-access-control) **2026-07-24** ### New Integrations * [Dashboard ELD](/providers/tsp/dashboard-eld) * [Omnitracs OT1](/providers/tsp/omnitracs-ot1) ### Integration Updates * [Raven Connected](/providers/tsp/raven-connected) now supports [Historical Vehicle Locations](/models/vehicle-location) and expanded [Vehicle Stat Logs](/models/vehicle-stat-log) telemetry coverage * [Verizon Reveal](/providers/tsp/verizon-reveal) now improves vehicle ID normalization so vehicles and related records join more reliably ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now includes driver and trailer detail pages with richer fleet entity context and trailer live-location visibility ### Documentation Updates * Updated [S3 destination configuration documentation](/guides/aws-s3-destination) with a copy/paste setup template and clearer defaults * Updated [Spireon FleetLocate documentation](/providers/tsp/spireon-fleet-locate) with published sample-rate and available-history data characteristics **2026-07-17** ### New Integrations * [CoGo ELD](/providers/tsp/cogo-eld) * [EquipmentShare](/providers/tsp/equipmentshare) * [Spireon FleetLocate Transportation](/providers/tsp/spireon-fleet-locate-transportation) * [Level ELD](/providers/tsp/level-eld) ### Integration Updates * [Track Your Truck](/providers/tsp/track-your-truck) now supports [Trips](/models/trip), [HOS Logs](/models/hos-log), and [Vehicle Utilization](/models/vehicle-utilization-day) * [Track Your Truck](/providers/tsp/track-your-truck) now supports `engine_oil_temperature` in [Vehicle Stat Logs](/models/vehicle-stat-log) * [Geotab](/providers/tsp/geotab) now improves [Vehicle Utilization](/models/vehicle-utilization-day) fuel reporting accuracy * [Geotab](/providers/tsp/geotab) now improves [Camera Media](/models/camera-media) retrieval coverage for supported safety events * [PeopleNet](/providers/tsp/people-net) now supports passthrough API requests ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now shows elapsed durations in connection sync history * The [Terminal Dashboard](https://dashboard.withterminal.com) now supports Motive OAuth scope sync and mismatch visibility in provider settings ### Documentation Updates * Updated [Samsara configuration documentation](/guides/samsara-oauth-configuration) with marketplace publishing and certification guidance **2026-07-10** ### New Integrations * [Track Your Truck](/providers/tsp/track-your-truck) * [AFS World ELD](/providers/tsp/afs-world-eld) ### Common Model Updates * [Camera Media](/models/camera-media) now supports an optional `imageUrl` so image-only events are represented when video is unavailable ### Integration Updates * [PeopleNet](/providers/tsp/people-net) now supports [HOS Logs](/models/hos-log) * [Lytx One](/providers/tsp/lytx-one) now supports [Safety Events](/models/safety-event), [Trips](/models/trip), and event camera media retrieval * [Geotab](/providers/tsp/geotab) now uses the native camera-services API for safety-event media across supported camera partners ### Feature Updates * User notifications now support connection-completed email alerts * Crash report notifications now attach camera images when video clips are unavailable ### API Updates * Added [Raw Passthrough](/api-reference/data-management/passthrough-raw) for binary provider responses (for example, camera images) **2026-07-03** ### New Integrations * Added new integrations: [Lytx One](/providers/tsp/lytx-one), [Rand McNally ELD](/providers/tsp/rand-mcnally-eld), [Enterprise ELD](/providers/tsp/enterprise-eld), [Luna ELD](/providers/tsp/luna-eld), [MDM ELD](/providers/tsp/mdm-eld), [One System ELD](/providers/tsp/one-system-eld), [Delta Solutions ELD](/providers/tsp/delta-solutions-eld), and [Inspire ELD](/providers/tsp/inspire-eld) ### Common Model Updates * [HOS Available Time](/models/hos-available-time) now includes current status start timestamps across supported providers ### Integration Updates * [Geotab](/providers/tsp/geotab) now supports GPS harsh-driving exception rules for [Safety Events](/models/safety-event) ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now includes Geotab safety-event enrichment controls in provider configuration settings **2026-06-26** ### New Integrations * Added new ELD integrations: [24HOS ELD](/providers/tsp/24hos-eld), [BST ELD](/providers/tsp/bst-eld), [DIALOG ELD](/providers/tsp/dialog-eld), [Ensi Log](/providers/tsp/ensi-eld), [Five ELD](/providers/tsp/five-eld), [FleetVision](/providers/tsp/fleetvision), [Fortune ELD](/providers/tsp/fortune-eld), [Hive ELD](/providers/tsp/hive-eld), [Horizon ELD](/providers/tsp/horizon-eld), [Hunter ELD](/providers/tsp/hunter-eld), [Interstate Freeway](/providers/tsp/interstate-eld), [Logfleet](/providers/tsp/logfleet), [NEO ELD](/providers/tsp/neo-eld), [Night Watch ELD](/providers/tsp/night-watch-eld), [Orion ELD](/providers/tsp/orion-eld), [Phantom ELD](/providers/tsp/phantom-eld), [Remax ELD](/providers/tsp/remax-eld), [Shelby ELD](/providers/tsp/shelby-eld), [Smart eLog](/providers/tsp/smart-elog), [Sprint ELD](/providers/tsp/sprint-eld), [Trendy ELD](/providers/tsp/trendy-eld), [Trip ELD](/providers/tsp/trip-eld), [Vector ELD](/providers/tsp/vector-eld), and [Wheels eLog](/providers/tsp/wheels-elog) ### Common Model Updates * [Verizon Reveal](/providers/tsp/verizon-reveal) now maps registration numbers to [Vehicle](/models/vehicle) `licensePlate.number` * [Apollo ELD](/providers/tsp/apollo-eld) now maps `PU` status to `personal_conveyance` in [HOS Logs](/models/hos-log) * [Apollo Compass](/providers/tsp/apollo-compass) now includes latitude and longitude values in [HOS Logs](/models/hos-log) when available ### Integration Updates * [Geotab](/providers/tsp/geotab) now applies g-force enrichment only to relevant harsh-driving and collision safety events ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now includes a PeopleNet provider setting to skip latest vehicle location enrichment for large fleets to improve performance * The [Terminal Dashboard](https://dashboard.withterminal.com) has refreshed branding ### Documentation Updates * Added a [Link Analytics Events guide](/guides/link-analytics-events) with event usage and implementation guidance * Updated the [Duplicate Connections guide](/guides/duplicate-connections) to clarify how the Dashboard's Dedupe Connections setting affects connection creation **2026-06-19** ### New Integrations * [DriverBook](/providers/tsp/driverbook) ### Integration Updates * [Verizon Reveal](/providers/tsp/verizon-reveal) now supports video-derived [Safety Events](/models/safety-event), including camera and AI detections, with direct camera media retrieval * [JJ Keller](/providers/tsp/jj-keller) now includes expanded vehicle and trailer type coverage in synced data ### Consent Flow Updates * Link now supports `provider_hints` so you can prioritize suggested providers while keeping the provider picker visible **2026-06-12** ### Common Model Updates * [Samsara](/providers/tsp/samsara) now sets [Vehicle](/models/vehicle) `fuelType` to `electric` when EV telemetry is available * [AI ELD](/providers/tsp/ai-eld), [ProLogs](/providers/tsp/prologs), and [Synergy ELD](/providers/tsp/synergy-eld) now include normalized [Driver](/models/driver) `phone` and `license` fields when available ### Integration Updates * [Teletrac Navman 360](/providers/tsp/teletrac-navman-360) now supports UK-region accounts * [Dreyev](/providers/tsp/dreyev) now supports [IFTA Vehicle Month](/models/ifta-summary) and [Camera Media](/models/camera-media) * [Dreyev](/providers/tsp/dreyev) now maps additional safety signals, including support for `stop_sign_violation` and refined `near_crash` classification * [JJ Keller](/providers/tsp/jj-keller) now includes `truck` and `pickup` units in synced [Vehicles](/models/vehicle) ### API Updates * Added the `link.analytics_event_emitted` webhook so you can receive Link funnel analytics events, including connection completion signals **2026-06-05** ### New Integrations * [VRH ELD](/providers/tsp/vrh-eld) ### Common Model Updates * Expanded normalized [Vehicle](/models/vehicle) `fuelType` coverage across many providers including: HOS247, TT ELD, TrackEnsure, Motive, GPS Insight, Webfleet, Route One ELD, TruckX, Motion ELD, Verizon Reveal and more. ### Integration Updates * [Loop ELD](/providers/tsp/loop-eld) now supports [HOS Logs](/models/hos-log) * [Loop ELD](/providers/tsp/loop-eld) now supports additional [Vehicle Stat Logs](/models/vehicle-stat-log), including `odometer` and `engine_state` * [Pedigree OneView](/providers/tsp/pedigree-oneview) now supports additional [Vehicle Stat Logs](/models/vehicle-stat-log), including `fuel_level`, `engine_state`, `coolant_percentage`, `engine_coolant_temperature`, `engine_oil_pressure`, `engine_oil_temperature`, and `engine_rpm`, and now exposes optional `fuel`, `engine_state`, and `engine_runtime` on [Latest Vehicle Locations](/models/latest-vehicle-location) ### Documentation Updates * Updated API and common model examples so enum fields like `visibility`, `status`, and `fuelType` render in generated example payloads * Updated [Motive configuration documentation](/guides/motive-oauth-configuration) and [Samsara configuration documentation](/guides/samsara-oauth-configuration) with current OAuth scope labels **2026-05-29** ### Integration Updates * [Lytx](/providers/tsp/lytx) now supports [Trips](/models/trip) * [Motion ELD](/providers/tsp/motion-eld-v2) now delivers richer [Historical Vehicle Locations](/models/vehicle-location) with expanded tracking coverage and additional telemetry fields ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now shows a pending deletion callout on connection pages, and admins can cancel pending deletions during the grace period ### API Updates * Canceling a connection in `pending_deletion` now requires an admin role ### Consent Flow Updates * [Netradyne](/providers/tsp/netradyne) Link setup now includes a built-in onboarding guide and validates Fleet Unique Identifier format during connection setup ### Documentation Updates * Updated [Samsara configuration documentation](/guides/samsara-oauth-configuration) to clarify that the user completing OAuth must have Full Admin or Standard Admin permissions **2026-05-22** ### New Integrations * [Motion ELD](/providers/tsp/motion-eld-v2) ### Integration Updates * [Green Light ELD](/providers/tsp/green-light-eld) and [Quantum ELD](/providers/tsp/quantum-eld) now support [Historical Vehicle Locations](/models/vehicle-location) * [Loop ELD](/providers/tsp/loop-eld) now supports [IFTA Vehicle Month](/models/ifta-summary) * [Zonar](/providers/tsp/zonar) now supports additional [Safety Events](/models/safety-event), including expanded crash and distraction event coverage * [PeopleNet](/providers/tsp/people-net) now supports `total_fuel_consumption` and `engine_runtime` in [Vehicle Stat Logs](/models/vehicle-stat-log) ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now shows the Delete Connection action for eligible admin users and adds an organization switcher on the welcome page when a selected org has no application ### Consent Flow Updates * Link now supports short links end-to-end: you can mint short links and send users to `term.new/{code}`, where Link resolves the stored onboarding parameters ### API Updates * Added short link endpoints for minting and resolving Link short codes, including [POST /tsp/v1/link/short](/api-reference/link/create-short-link) * [DELETE /connections/current](/api-reference/connections/delete-current-connection) is now publicly documented and available in generated API specs ### Documentation Updates * Updated the [deleting connections guide](/guides/deleting-connections) to reflect the fully released asynchronous deletion flow **2026-05-15** ### Integration Updates * [Omnitracs XRS](/providers/tsp/omnitracs-xrs) now supports [Trips](/models/trip), `engine_runtime` in [Vehicle Stat Logs](/models/vehicle-stat-log), and [Trailers](/models/trailer) * [GPS Trackit](/providers/tsp/gps-trackit) now maps provider driver IDs onto [Vehicle Locations](/models/vehicle-location) when available ### Dashboard Updates * The [Terminal Dashboard](https://dashboard.withterminal.com) now shows a dedicated "Connection not found" page for invalid or deleted connection IDs ### Consent Flow Updates * Link templates now support regex validation for required `external_id` values, with validation enforced in both Link and `/link/complete` ### Feature Updates * Added a read-only Viewer role with tighter role-based access controls across dashboard and API surfaces ### API Updates * Added a public usage endpoint: [GET /usage](/api-reference/usage/list-usage) * Added `connection.pending_deletion` and `connection.deleted` webhook lifecycle events, plus deleted-connection responses that preserve useful audit context ### Documentation Updates * Documented the hosted Link `template` query parameter and default-template behavior * Updated provider metadata and docs for GPS Insight sample rate ranges and Transit ELD login URL guidance **2026-05-08** ### Common Model Updates * Expanded [Vehicle](/models/vehicle) `fuelType` values so additional alternative fuel and plug-in hybrid types are now preserved end-to-end ### New Integrations * [New ELD World](/providers/tsp/new-eld-world) * [Gorilla Safety](/providers/tsp/gorilla-safety) * [Fleet Track](/providers/tsp/fleet-track) * [HCSS eLogs](/providers/tsp/hcss) * [Stellar ELD](/providers/tsp/stellar-eld) ### Integration Updates * [Loop ELD](/providers/tsp/loop-eld) now supports [Devices](/models/device) * [Rigbot](/providers/tsp/rigbot) now supports [Historical Vehicle Locations](/models/vehicle-location) * [IntelliShift](/providers/tsp/intelli-shift) now supports [Fault Code Events](/models/fault-code-event) and improved active driver status syncing * [Motive](/providers/tsp/motive) now supports additional [Vehicle Stat Logs](/models/vehicle-stat-log), including `battery_voltage`, `fuel_level`, and `engine_runtime` * [Omnitracs ES](/providers/tsp/omnitracs-es) now supports `engine_state` in [Vehicle Stat Logs](/models/vehicle-stat-log) * [Zonar](/providers/tsp/zonar) now supports `engine_runtime` in [Vehicle Stat Logs](/models/vehicle-stat-log) * [Geotab](/providers/tsp/geotab) now supports trip backfills older than 13 months ### Documentation Updates * Added a new guide for [deleting connections](/guides/deleting-connections) * Updated [Loop ELD documentation](/providers/tsp/loop-eld) with vehicle location sample rate and retention details **2026-05-01** ### New Integrations * [Force Fleet](/providers/tsp/force-fleet) ### Integration Updates * [Webfleet](/providers/tsp/webfleet) now supports [Fault Code Events](/models/fault-code-event) * [Spireon FleetLocate](/providers/tsp/spireon-fleet-locate) now supports additional [Vehicle Stat Logs](/models/vehicle-stat-log), including `odometer`, `engine_runtime`, and `engine_state` * [Verizon Reveal](/providers/tsp/verizon-reveal) now supports camera media retrieval for [Safety Events](/models/safety-event) via [Get Event Camera Media](/api-reference/safety/get-event-camera-media) * [Loop ELD](/providers/tsp/loop-eld) now supports additional [Safety Events](/models/safety-event) with expanded event-type coverage ### Dashboard Updates * Fixed sparse CSV exports in the [Terminal Dashboard](https://dashboard.withterminal.com) so vehicle, driver, and trailer exports include all schema columns even when early rows have missing values ### Feature Updates * S3 data destinations now support customer-managed IAM role ARNs for cross-account bucket access **2026-04-24** ### New Integrations * [Clutch ELD](/providers/tsp/clutch-eld) * [Split ELD](/providers/tsp/split-eld) ### Integration Updates * [JJ Keller](/providers/tsp/jj-keller) now supports [Historical Vehicle Locations](/models/vehicle-location) * [Fleet Complete Hub](/providers/tsp/fleet-complete-hub) now supports additional [Vehicle Stat Logs](/models/vehicle-stat-log) and expanded [Safety Events](/models/safety-event) coverage, including `rolling_stop` * [One Step GPS](/providers/tsp/one-step-gps) now supports [Fault Code Events](/models/fault-code-event) * [Samsara](/providers/tsp/samsara) now supports `total_fuel_consumption` in [Vehicle Stat Logs](/models/vehicle-stat-log) ### API Updates * Added optional event selection for replaying onboarding webhooks so developers can resend only specific connection lifecycle events ### Dashboard Updates * Provider Access Control settings are now available in the sandbox in the [Terminal Dashboard](https://dashboard.withterminal.com) ### Documentation Updates * Added manifest file documentation to [S3 destination configuration](/guides/data-destinations) **2026-04-17** ### New Integrations * [Pedigree OneView](/providers/tsp/pedigree-oneview) * [Ring ELD](/providers/tsp/ring-eld) * [PremierRide Logs](/providers/tsp/premierride-logs) ### Integration Updates * [GPS Trackit](/providers/tsp/gps-trackit) and [Zonar Ignition](/providers/tsp/zonar-ignition) now support [Historical Vehicle Locations](/models/vehicle-location) and additional [Vehicle Stat Logs](/models/vehicle-stat-log) * [Omnitracs ES](/providers/tsp/omnitracs-es) now supports [Fault Code Events](/models/fault-code-event) * [Verizon Connect Reveal](/providers/tsp/verizon-reveal) now supports additional [Safety Events](/models/safety-event), including expanded crash reporting coverage * [ISAAC](/providers/tsp/isaac) now supports `engine_state` in [Latest Vehicle Locations](/models/latest-vehicle-location) and [Vehicle Stat Logs](/models/vehicle-stat-log) * [Samsara](/providers/tsp/samsara) now supports additional [Safety Events](/models/safety-event), including `rolling_stop` and `unsafe_lane_change` * [Samsara](/providers/tsp/samsara) trailers now populate normalized VIN values from provider external IDs ### Documentation Updates * Added a new guide for [Consent Templates](/guides/consent-templates), including setup, branding, redirect, and Link launch behavior details **2026-04-10** ### New Integrations * [GPS Trackit](/providers/tsp/gps-trackit) * [Zonar Ignition](/providers/tsp/zonar-ignition) ### Integration Updates * [Geotab](/providers/tsp/geotab) now supports additional [Safety Events](/models/safety-event): `camera_obstruction`, `cell_phone`, `distracted`, `drowsiness`, `eating_and_drinking`, `near_crash`, `rolling_stop`, `smoking`, and `tailgating` * [Loop ELD](/providers/tsp/loop-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [HOS Available Time](/api-reference/hours-of-service/list-hosavailable-time) * [Omnitracs ES](/providers/tsp/omnitracs-es) now supports [Vehicle Utilization](/models/vehicle-utilization-day) ### Dashboard Updates * Improved similar connection suggestions in the [Terminal Dashboard](https://dashboard.withterminal.com) to make duplicate connection detection clearer ### Consent Flow Updates * Added stricter validation for required external IDs in Link to prevent invalid connection requests earlier in onboarding ### Documentation Updates * Clarified sandbox access in [Getting Started](/how-terminal-works) * Expanded provider model support status guidance in provider documentation **2026-04-03** ### New Integrations * [AirIQ](/providers/tsp/airiq) * [Tenna](/providers/tsp/tenna) * [JJ Keller](/providers/tsp/jj-keller) ### Integration Updates * [Loop ELD](/providers/tsp/loop-eld) now supports [Safety Events](/models/safety-event) ### Documentation Updates * Clarified Slack and Microsoft Teams support in [user notifications docs](/guides/user-notifications) and [webhooks docs](/guides/webhooks) * Updated HOS247 family provider docs to clarify that historical data requires a Tracking Plan * Updated [TXT ELD](/providers/tsp/txt-eld) documentation with the correct login page **2026-03-27** ### New Integrations * [NexTraq](/providers/tsp/nextraq) * [Quantum ELD](/providers/tsp/quantum-eld) * [TXT ELD](/providers/tsp/txt-eld) * [VRD Logs](/providers/tsp/vrd-logs) * [ELD88](/providers/tsp/eld88) ### Integration Updates * [Zonar Ground Traffic Control](/providers/tsp/zonar) now supports [Trips](/models/trip) * [Lucid ELD](/providers/tsp/lucid-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) ### Documentation Updates * Added a new [Security](/security) page covering Terminal security practices and compliance details * Updated [Samsara configuration documentation](/guides/samsara-oauth-configuration) with EU-region OAuth setup guidance **2026-03-20** ### Integration Updates * [Spireon FleetLocate](/providers/tsp/spireon-fleet-locate) now supports [Groups](/models/group) references on vehicles and trailers * [Samsara](/providers/tsp/samsara) now supports EU-region OAuth configuration for European accounts ### Dashboard Updates * Updated settings forms in the [Terminal Dashboard](https://dashboard.withterminal.com) with a floating action footer so save and cancel actions stay visible while editing ### Consent Flow Updates * Added region-aware OAuth client selection in Link for providers with multiple OAuth regions, including Samsara EU **2026-03-13** ### Integration Updates * [Zonar](/providers/tsp/zonar) now supports [Trailers](/models/trailer) * [Spireon FleetLocate](/providers/tsp/spireon-fleet-locate) now supports [Groups](/models/group) * [Optima ELD](/providers/tsp/optima-eld) now supports [Fault Code Events](/models/fault-code-event) * [Apex ELD](/providers/tsp/apex-eld) now supports [Fault Code Events](/models/fault-code-event) * [ELD Rider](/providers/tsp/eld-rider) now supports [Fault Code Events](/models/fault-code-event) * [Pro Ride ELD](/providers/tsp/pro-ride-eld) now supports [Fault Code Events](/models/fault-code-event) * [XELD](/providers/tsp/xeld) now supports [Fault Code Events](/models/fault-code-event) * [Xplore ELD](/providers/tsp/xplore-eld) now supports [Fault Code Events](/models/fault-code-event) * [Sparkle ELD](/providers/tsp/sparkle-eld) now supports [Fault Code Events](/models/fault-code-event) * [PTI ELD](/providers/tsp/pti-eld) now supports [Fault Code Events](/models/fault-code-event) * [Fort Knox ELD](/providers/tsp/fort-knox) now supports [Fault Code Events](/models/fault-code-event) * [TX ELD](/providers/tsp/tx-eld) now supports [Fault Code Events](/models/fault-code-event) * [EVA ELD](/providers/tsp/eva-eld) now supports [Fault Code Events](/models/fault-code-event) * [Rock ELD](/providers/tsp/rock-eld) now supports [Fault Code Events](/models/fault-code-event) * [PoP ELD](/providers/tsp/pop-eld) now supports [Fault Code Events](/models/fault-code-event) * [Peak ELD](/providers/tsp/peak-eld) now supports [Fault Code Events](/models/fault-code-event) * [Maestral ELD](/providers/tsp/maestral-eld) now supports [Fault Code Events](/models/fault-code-event) * [Next Fleet ELD](/providers/tsp/next-fleet-eld) now supports [Fault Code Events](/models/fault-code-event) ### Dashboard Updates * Added clearer live location error guidance in the [Terminal Dashboard](https://dashboard.withterminal.com) for insufficient permissions and unsupported provider states * Updated Motive scope suggestions in the [Terminal Dashboard](https://dashboard.withterminal.com) to align with supported Fault Code Events and Vehicle Utilization permissions ### Consent Flow Updates * Improved authentication error handling in Link with clearer recovery guidance and provider help links * Improved provider search relevance in Link so the best matches appear first while searching ### Documentation Updates * Updated [Motive configuration documentation](/guides/motive-oauth-configuration) to include Fault Code Events and Vehicle Utilization scopes **2026-03-06** ### New Integrations * [Intime ELD](/providers/tsp/intime-eld) * [Safe Lane ELD](/providers/tsp/safe-lane-eld) * [Zero ELD](/providers/tsp/zero-eld) ### Integration Updates * [Spireon FleetLocate](/providers/tsp/spireon-fleet-locate) now supports [Safety Events](/models/safety-event) * [Fleet Complete Hub](/providers/tsp/fleet-complete-hub) now supports [Trips](/models/trip) ### Dashboard Updates * Added an overflow dialog for connections with many DOT numbers in the [Terminal Dashboard](https://dashboard.withterminal.com) ### Feature Updates * Added optional manifest file output and delivery tracking metadata for Data Delivery destinations ### API Updates * Added `deleting` and `deleted` lifecycle statuses to connection status handling ### Documentation Updates * Released a new guide for [fuel card implementations](/guides/fuel-cards) **2026-02-27** ### New Integrations * [ELD88](/providers/tsp/eld88) * [Avanguard ELD](/providers/tsp/avanguard-eld) * [Next Fleet ELD](/providers/tsp/next-fleet-eld) ### Integration Updates * [EROAD](/providers/tsp/eroad) now supports [Vehicle Utilization](/models/vehicle-utilization-day) and [Trips](/models/trip) * [OneStep GPS](/providers/tsp/one-step-gps) now supports `engineState` in [Latest Vehicle Locations](/models/latest-vehicle-location) * [Raven Connected](/providers/tsp/raven-connected) now supports `engineState` and normalized fuel values in [Latest Vehicle Locations](/models/latest-vehicle-location) ### Dashboard Updates * Added role-based developer actions to resend onboarding webhooks in the [Terminal Dashboard](https://dashboard.withterminal.com) ### Documentation Updates * Released a new guide for [Connection Health Monitoring](/guides/connection-health-monitoring) **2026-02-20** ### New Integrations * [MICHELIN Connected Fleet](/providers/tsp/michelin-connected-fleet) * [Rigbot](/providers/tsp/rigbot) ### Integration Updates * [Motive](/providers/tsp/motive) now supports [Vehicle Utilization](/models/vehicle-utilization-day) * [Omnitracs XRS](/providers/tsp/omnitracs-xrs) now supports [Fault Code Events](/models/fault-code-event) * [ISAAC](/providers/tsp/isaac) now supports fuel level and engine runtime in [Vehicle Stat Logs](/models/vehicle-stat-log) ### Documentation Updates * Released a new filterable provider explorer for easier provider discovery and comparison **2026-02-13** ### New Integrations * [FleetPulse](/providers/tsp/fleet-pulse) ### API Updates * Added sync progress tracking to the [GET /syncs/](/api-reference/data-management/get-sync-job-status) endpoint for real-time visibility into sync execution ### Documentation Updates * Released a new guide for [insurance implementations](/guides/insurance) **2026-02-06** ### New Integrations * [Wizefleet ELD](/providers/tsp/wizefleet-eld) * [AUTOGRI ELD](/providers/tsp/autogri-eld) * [FLEX ELD](/providers/tsp/flex-eld) * [ELDTREX](/providers/tsp/eldtrex) * [PDSINC ELD](/providers/tsp/pdsinc-eld) * [MAP eLOG Corp](/providers/tsp/map-elog-corp) * [Truckford ELD](/providers/tsp/truckford-eld) * [Highest ELD](/providers/tsp/highest-eld) ### Integration Updates * [TT ELD](/providers/tsp/tt-eld) now supports [HOS Available Time](/models/hos-available-time) * [Spireon FleetLocate](/providers/tsp/spireon-fleet-locate) now supports [Drivers](/models/driver) * [Zonar](/providers/tsp/zonar) now supports [Fault Code Events](/models/fault-code-event) ### Dashboard Updates * Added multi-application support for the [Terminal Dashboard](https://dashboard.withterminal.com) ### Documentation Updates * Improved search indexing by simplifying type accordions in provider documentation * Released a new guide for [preparing for production](/guides/production-readiness) **2026-01-30** ### New Integrations * [Loop ELD](/providers/tsp/loop-eld) ### Integration Updates * [ISAAC](/providers/tsp/isaac) now supports [Fault Code Events](/models/fault-code-event) * [Teletrac Navman 360](/providers/tsp/teletrac-navman-360) now supports [Drivers](/models/driver) and [HOS Available Time](/models/hos-available-time) ### Dashboard Updates * Added confirmation dialog before archiving a connection for the [Terminal Dashboard](https://dashboard.withterminal.com) ### Documentation Updates * Added comprehensive guide for [Entity Status & Visibility](/guides/entity-status-visibility) **2026-01-23** ### New Integrations * [ELDRoad](/providers/tsp/eldroad) * [Trackease](/providers/tsp/trackease) * [ELD99](/providers/tsp/eld99) ### Integration Updates * [TruckX](/providers/tsp/truckx) now supports [Fault Code Events](/models/fault-code-event) * [Fleet Complete Hub](/providers/tsp/fleet-complete-hub) now supports [Fault Code Events](/models/fault-code-event) ### Dashboard Updates * Added View Raw feature to the Live Location tab for the [Terminal Dashboard](https://dashboard.withterminal.com) **2026-01-16** ### New Integrations * [Dragon ELD](/providers/tsp/dragon-eld) ### Integration Updates * [TT ELD](/providers/tsp/tt-eld) now supports [IFTA](/models/ifta-summary) ### Dashboard Updates * Enhanced vehicle detail page with new tabs for vehicle info, live location, and historical activity for the [Terminal Dashboard](https://dashboard.withterminal.com) ### Feature Updates * Added S3 delivery status webhooks for data delivery notifications **2026-01-09** ### New Integrations * [Omega ELD](/providers/tsp/omega-eld) ### Integration Updates * [Motive](/providers/tsp/motive) now supports [Fault Code Events](/models/fault-code-event) * [Ezlogz](/providers/tsp/ez-logz) now supports `driver` on [Latest Vehicle Locations](/models/latest-vehicle-location) **2025-12-19** ### New Integrations * [Spireon FleetLocate](/providers/tsp/spireon-fleet-locate) * [Route One ELD](/providers/tsp/route-one-eld) ### Integration Updates * [Ezlogz](/providers/tsp/ez-logz) now supports engine state in [Latest Vehicle Locations](/models/latest-vehicle-location) ### Dashboard Updates * Support for editing tags in the [Terminal Dashboard](https://dashboard.withterminal.com) **2025-12-13** ### New Integrations * [Teletrac Navman 360](/providers/tsp/teletrac-navman-360) ### Integration Updates * [SmartDrive](/providers/tsp/smartdrive) now supports [Latest Vehicle Locations](/models/latest-vehicle-location) ### Documentation Updates * Provider documentation pages now show the percentage of records that have data populated for each field **2025-12-05** ### New Integrations * [Konexial](/providers/tsp/konexial) ### Dashboard Updates * Support for deep-linking to filters and search in tables on the [Terminal Dashboard](https://dashboard.withterminal.com) **2025-11-28** ### New Integrations * [ProLogs](/providers/tsp/prologs) * [AI ELD](/providers/tsp/ai-eld) * [Synergy ELD](/providers/tsp/synergy-eld) ### Integration Updates * [Zonar](/providers/tsp/zonar) now supports driver phone numbers in [Drivers](/models/driver) * [Zonar](/providers/tsp/zonar) now supports ECU VIN for improved vehicle identification accuracy * [Teletrac Navman Director](/providers/tsp/teletrac-navman-director) now supports [Safety Events](/models/safety-event) ### Dashboard Updates * Improved fleet table rendering based on application permissions for the [Terminal Dashboard](https://dashboard.withterminal.com) **2025-11-21** ### Integration Updates * [Fleethunt](/providers/tsp/fleethunt) now supports [Safety Events](/models/safety-event) ### Consent Flow Updates * Added show/hide toggle for secret fields in Link ### Documentation Updates * Added Integration Roadmap link to Supported Providers section * Improved documentation for [Apollo ELD](/providers/tsp/apollo-eld) with API key instructions and login pages **2025-11-14** ### New Integrations * [Wex Telematics](/providers/tsp/wex-telematics) ### Integration Updates * [PeopleNet](/providers/tsp/people-net) now supports [Drivers](/models/driver) for connections without ELD module * [Teletrac Navman Director](/providers/tsp/teletrac-navman-director) now supports [Vehicle Stat Logs](/models/vehicle-stat-log) ### Documentation Updates * Improved documentation for [Fleethunt](/providers/tsp/fleethunt) **2025-11-07** ### New Integrations * [RedFox ELD](/providers/tsp/redfox-eld) * [SmartDrive](/providers/tsp/smartdrive) ### API Updates * [Samsara](/providers/tsp/samsara) now supports `unsafe_parking` [Safety Events](/models/safety-event) * [Motive](/providers/tsp/motive) now supports `unsafe_parking` [Safety Events](/models/safety-event) ### Documentation Updates * Improved documentation for [S3 delivery destinations](/guides/data-destinations) * Added Sandbox environment call-out to S3 delivery configuration **2025-10-31** ### New Integrations * [Fleethunt](/providers/tsp/fleethunt) ### Integration Updates * [Fleethunt](/providers/tsp/fleethunt) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Latest Vehicle Locations](/models/latest-vehicle-location) * [Teletrac Navman Director](/providers/tsp/teletrac-navman-director) now supports [IFTA](/models/ifta-summary) and [Groups](/models/group) * [Switchboard](/providers/tsp/switchboard) now supports [HOS Logs](/models/hos-log) ### Dashboard Updates * Added billing portal link for admins in the [Terminal Dashboard](https://dashboard.withterminal.com) * Display more stats in Live Vehicle Locations modal for the [Terminal Dashboard](https://dashboard.withterminal.com) ### Feature Updates * Added optional timezone support for data delivery schedule triggers **2025-10-24** ### Dashboard Updates * Added configuration support for [TruckX](/providers/tsp/truckx) in the [Terminal Dashboard](https://dashboard.withterminal.com) **2025-10-17** ### New Integrations * [Teletrac Navman Director](/providers/tsp/teletrac-navman-director) * [DSG Elogs](/providers/tsp/dsg-elogs) * [Factor ELD](/providers/tsp/factor-lucid-eld) * [Secure Path ELD](/providers/tsp/secure-path-eld) * [Blue Star ELD](/providers/tsp/blue-star-eld) * [Transit ELD](/providers/tsp/transit-eld) * [Zeromax ELD](/providers/tsp/zeromax-eld) * [USfast ELD](/providers/tsp/usfast-eld) * [Egreen ELD](/providers/tsp/egreen-lucid-eld) * [Startrucks ELD](/providers/tsp/startrucks-eld) * [UzbPrime ELD](/providers/tsp/uzbprime-eld) * [Vitality ELD](/providers/tsp/vitality-eld) * [ILog ELD](/providers/tsp/ilog-lucid-eld) * [Daily ELD Plus](/providers/tsp/daily-eld-plus) * [Prestige ELD](/providers/tsp/prestige-eld) * [Leader ELD](/providers/tsp/leader-eld) * [Panda ELD](/providers/tsp/panda-eld) * [DY+ ELD](/providers/tsp/dyplus-eld) ### Integration Updates * [TrackEnsure](/providers/tsp/track-ensure) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [Alfa ELD](/providers/tsp/alfa-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [Sharp ELD](/providers/tsp/sharp-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [ADA ELD](/providers/tsp/ada-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [ELD Pro Solution](/providers/tsp/eld-pro-solution) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [Swift ELD](/providers/tsp/swift-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [Club ELD](/providers/tsp/club-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [ProTracking ELD](/providers/tsp/protracking-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [Vista ELD](/providers/tsp/vista-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [Zenith ELD](/providers/tsp/zenith-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) * [Amber ELD](/providers/tsp/amber-eld) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Odometer Stat Logs](/models/vehicle-stat-log) **2025-10-10** ### Integration Updates * Added support for `harsh_turn` and `camera_obstruction` [Safety Events](/models/safety-event) for [People-Net](/providers/tsp/people-net) ### Dashboard Updates * Improved the settings page for the [Terminal Dashboard](https://dashboard.withterminal.com) ### Documentation Updates * Released a new guide for [migrating to Terminal](/guides/migrating-to-terminal) **2025-10-03** ### New Common Model * [Fault Code Events](/models/fault-code-event) ### New Integrations * [Platinum ELD](/providers/tsp/platinum-eld) * [ELD Desired](/providers/tsp/eld-desired) ### Integration Updates * [Samsara](/providers/tsp/samsara), [Azuga](/providers/tsp/azuga), [Geotab](/providers/tsp/geotab), and [Verizon Reveal](/providers/tsp/verizon-reveal) now support [Fault Code Events](/models/fault-code-event) * [People-Net](/providers/tsp/people-net) now supports [Vehicle Utilization](/models/vehicle-utilization-day) **2025-09-26** ### Integration Updates * [PeopleNet](/providers/tsp/people-net) now supports [Devices](/models/device) ### Documentation Updates * Added login page reference links for most providers in documentation **2025-09-19** ### New Integrations * [Platinum ELD](/providers/tsp/platinum-eld) * [ELD Desired](/providers/tsp/eld-desired) ### Dashboard Updates * Improved connection table layout in the [Terminal Dashboard](https://dashboard.withterminal.com) ### Feature Updates * Added support for `includeIds` filtering option for vehicles and drivers, allowing explicit inclusion of specific records with highest priority **2025-09-01** ### Common Model Updates * Added three new stat types to [Vehicle Stat Logs](/models/vehicle-stat-log): Coolant Percentage, Engine RPM, and Battery Voltage ### Integration Updates * [Ezlogz](/providers/tsp/ez-logz) now supports [Historical Vehicle Locations](/models/vehicle-location) and [Vehicle Stat Logs](/models/vehicle-stat-log) * [Zonar](/providers/tsp/zonar) now supports historical fuel consumption data and real-time fuel percentage in [Vehicle Locations](/models/vehicle-location) * [Samsara](/providers/tsp/samsara) now supports [Vehicle Utilization](/models/vehicle-utilization-day) * [Geotab](/providers/tsp/geotab) now supports [Vehicle Utilization](/models/vehicle-utilization-day) **2025-08-01** ### Common Model Updates * Added `username` field to [Driver](/models/driver) model ### Integration Updates * [Switchboard](/providers/tsp/switchboard) now supports [Latest Vehicle Locations](/models/latest-vehicle-location) * [Samsara](/providers/tsp/samsara) and [Geotab](/providers/tsp/geotab) now expose engine state in [Latest Vehicle Locations](/models/latest-vehicle-location) ### Documentation Updates * Enhanced documentation for syncing event data **2025-07-01** ### New Integrations * [Matrack](/providers/tsp/matrack) ### Integration Updates * [OneStepGPS](/providers/tsp/one-step-gps) now supports historical fuel level data in [Vehicle Stat Logs](/models/vehicle-stat-log) * [Samsara](/providers/tsp/samsara) now supports historical fuel level data in [Vehicle Stat Logs](/models/vehicle-stat-log) **2025-06-01** ### Integration Updates * [ELD One](/providers/tsp/eldone) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [RoadStar](/providers/tsp/roadstar) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [GPSTab](/providers/tsp/gpstab) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [MasterELD](/providers/tsp/master-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [Real ELD](/providers/tsp/real-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [TFM ELD](/providers/tsp/tfm-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [Mountain ELD](/providers/tsp/mountain-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [KSK](/providers/tsp/ksk) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [FM ELD](/providers/tsp/fm-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [Conti-Go](/providers/tsp/conti-go) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [ID ELD](/providers/tsp/id-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [MAX ELD](/providers/tsp/max-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) * [Light & Travel ELD](/providers/tsp/light-and-travel-eld) now supports fuel level data in [Latest Vehicle Locations](/models/latest-vehicle-location) ### Dashboard Updates * Added Providers page to the [Terminal Dashboard](https://dashboard.withterminal.com) for easier provider discovery and management ### Consent Flow Updates * Launched consent templates feature for customizable Link experiences ### Feature Updates * Added connection reconnected notifications to alert when connections are successfully re-established ### API Updates * Connection company DOT numbers can now be updated via PATCH endpoint # Agents Source: https://docs.withterminal.com/guides/agents Give coding agents access to Terminal fleet data through MCP or the Terminal CLI. Both are in beta. > [!WARNING] > > Terminal's agent tools — the MCP server and the CLI — are in **beta**. Tool > names, commands, and arguments may change. This is early, and we want your > [feedback](#feedback) on how Terminal can better support your agents. You can give an agent the same Terminal data you already query from the [Terminal API](/api-reference): connections, vehicles, drivers, locations, HOS, safety events, and more. Anything you can read from the API, an agent can read through these tools. There are two beta interfaces. Use whichever fits how the agent already works. | | [MCP server](#mcp-server) | [CLI](#cli) | | - | - | - | | Best for | Cursor, Claude, and other MCP clients | Shells, scripts, and agents that run commands | | Auth | Sign in with your Terminal Dashboard account | A Terminal secret key (`sk_…`) | | Install | Add the MCP URL to the client | `npm install -g @terminal-api/cli` | Neither replaces the Terminal API. Use that when you are building a product integration. ## MCP server The MCP server exposes Terminal API operations as MCP tools. Add the URL to your client and sign in with your Terminal Dashboard account when the browser opens. You do not put a secret key in the client config. ``` https://mcp.withterminal.com/mcp ``` The server uses [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) and OAuth. The client must support both. ### Connect a client Every MCP client adds remote servers a little differently. In general: 1. Find the MCP or connectors settings in your client (for example, **Cursor Settings → MCP**, or **Settings → Connectors** in Claude). 2. Add a remote server with the URL `https://mcp.withterminal.com/mcp`. Some clients take a JSON config instead: ```json theme={null} { "mcpServers": { "terminal": { "url": "https://mcp.withterminal.com/mcp" } } } ``` 3. When prompted, sign in with the Terminal Dashboard account that should access your applications. 4. Confirm Terminal tools such as `listApplications` and `listVehicles` appear. Check your client's documentation for the exact steps. ### Scope What the agent can see matches your Dashboard user: applications in your active organization, and the connections and data that user can read. Tools take an application ID and, where relevant, a connection token as arguments; the tool descriptions tell the agent how to resolve them, so you rarely need to supply them yourself. Secret endpoints such as application keys are not exposed. See the [MCP reference](/api-reference/mcp) for arguments, tools, and error handling. ## CLI The [Terminal CLI](https://github.com/terminal-api/terminal-cli) is an open-source command line for the same API, published as [`@terminal-api/cli`](https://www.npmjs.com/package/@terminal-api/cli). Agents can run `terminal` commands, or you can use it yourself in a shell. ### Install ```bash theme={null} npm install -g @terminal-api/cli ``` `pnpm add -g @terminal-api/cli` and `bun install -g @terminal-api/cli` also work. ### Configure ```bash theme={null} terminal config set api-key sk_prod_xxx terminal config set connection-token con_tkn_xxx ``` You can also use environment variables (`TERMINAL_API_KEY`, `TERMINAL_CONNECTION_TOKEN`) or [profiles](https://github.com/terminal-api/terminal-cli#profiles) for sandbox vs production. Get a secret key from the [Dashboard](https://dashboard.withterminal.com/api-keys). Connection tokens come from [list connections](/api-reference/connections/list-connections) or the consent flow. ### Use ```bash theme={null} terminal list-connections --format table terminal list-vehicles --format table ``` Commands map to Terminal API operations in kebab-case. Run `terminal --help` for the full list, or `terminal` with no arguments for an interactive TUI. The repo also ships [agent skills and commands](https://github.com/terminal-api/terminal-cli/tree/main/ai) you can copy into your agent so it knows how to call the CLI. See the [CLI reference](/api-reference/cli) for configuration, profiles, global options, and command flags. ## What agents can query MCP tools cover the read side of the Terminal API: applications and connections, vehicles and locations, drivers and HOS, trips, safety events, and the rest. The CLI covers the same reads plus write operations such as passthrough and sync requests. A few examples: * `listVehicles` / `terminal list-vehicles` * `listLatestVehicleLocations` / `terminal list-latest-vehicle-locations` * `listHOSLogs` / `terminal list-hoslogs` Ask the agent what tools it has, or run `terminal --help`, for the current list. For request and response fields, use the matching [API reference](/api-reference/authentication) page. ## Feedback Please share feedback on how Terminal can better support your agents via our shared Slack channel or [support@withterminal.com](mailto:support@withterminal.com) # AWS S3 Destination Source: https://docs.withterminal.com/guides/aws-s3-destination Automated data replication to Amazon S3 > [!NOTE] > > Choosing how to get data out of Terminal? See [Data > Replication](/guides/data-replication) for sync vs replication and how S3 > compares to the [API](/guides/syncing-via-the-api) and > [Kafka](/guides/kafka-destination). ## Overview In addition to our unified API, Terminal can automatically replicate normalized data to an Amazon S3 bucket in your AWS account. This enables: * Building downstream data pipelines using your existing S3-based infrastructure and tools * Complete data archival to your AWS account to ensure data ownership and backup * High-volume processing where hourly / daily deliveries are sufficient for your use case ## How it Works Terminal is ingesting data from TSPs on an ongoing basis and normalizing it into our Common Models. Once this data is ingested, we will then make it available in our APIs and push it to your S3 bucket based on configured triggers. ```mermaid theme={null} %%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#e5e7eb', 'primaryTextColor':'#111827', 'primaryBorderColor':'#9ca3af', 'lineColor':'#6b7280', 'secondaryColor':'#f3f4f6', 'tertiaryColor':'#f9fafb'}}}%% flowchart TB subgraph Terminal["Terminal AWS"] TI["Ingestion Service
(Normalizes TSP data)"] TWD["Data Warehouse"] SD["S3 Delivery Service"] T1["🔄 Initial sync / backfill"] T2["⏰ Scheduled incremental"] T3["⚡ Manual request"] end subgraph Consumer["Consumer AWS"] Bucket["Destination S3 Bucket"] ETL["ETL Tools
(Airbyte, Dagster, etc.)"] DW["Data Warehouse
(Snowflake, Redshift, etc.)"] end TI -->|writes| TWD TWD -->|reads| SD T1 -.->|triggers| SD T2 -.->|triggers| SD T3 -.->|triggers| SD SD -->|writes data via IAM role| Bucket Bucket -->|optional| ETL Bucket -->|optional| DW ``` Terminal uses AWS IAM roles to authorize access to your S3 bucket. Our S3 Delivery Service assumes an IAM role that you grant permissions to through your bucket policy, ensuring secure and controlled access to your data. ### Delivery Triggers #### Initial sync / backfill (single connection) We automatically trigger a backfill to your S3 bucket in two scenarios: 1. when a new connection completes its first sync 2. when you manually request a sync to backfill additional data **Example:** after a new connection's first backfill completes, we will trigger a backfill to your S3 bucket for that connection for the requested time window. #### Scheduled incremental (multiple connections) In addition to the initial sync / backfill, we will also schedule an incremental delivery to your S3 bucket on your configured schedule (rate/cron) and include all connections that have new or updated data since the last run. **Example:** if configured to run daily at 12:00 AM, we will trigger an incremental delivery to your S3 bucket for all rows that have been added or updated since the last run across all connected connections. #### Manual (on-demand) You can request manual deliveries for specific connections and time ranges by reaching out to our team. In the future, you'll be able to trigger these deliveries yourself through the Terminal dashboard. This is useful for scenarios like requesting a backfill of all connections that were ingested prior to destination configuration. ### Object format #### Data models Terminal delivers normalized datasets using our standard [Common Models](/models), which provide consistent schemas across all telematics providers. Each object contains rows that match the canonical fields and data types defined in the model reference. In addition to the fields documented in the Common Models, each row includes a `connectionId` field that identifies the source connection. > [accordion] View supported models > > | Model | Reference | JSON Schema | > | - | - | - | > | Connection | [View model](/models/connection) | [Download](/schemas/destinations/connection.json) | > | Vehicle | [View model](/models/vehicle) | [Download](/schemas/destinations/vehicle.json) | > | Driver | [View model](/models/driver) | [Download](/schemas/destinations/driver.json) | > | Device | [View model](/models/device) | [Download](/schemas/destinations/device.json) | > | Group | [View model](/models/group) | [Download](/schemas/destinations/group.json) | > | Trailer | [View model](/models/trailer) | [Download](/schemas/destinations/trailer.json) | > | VehicleLocation | [View model](/models/vehicle-location) | [Download](/schemas/destinations/vehicle-location.json) | > | VehicleStatLog | [View model](/models/vehicle-stat-log) | [Download](/schemas/destinations/vehicle-stat-log.json) | > | SafetyEvent | [View model](/models/safety-event) | [Download](/schemas/destinations/safety-event.json) | > | FaultCodeEvent | [View model](/models/fault-code-event) | [Download](/schemas/destinations/fault-code-event.json) | > | Trip | [View model](/models/trip) | [Download](/schemas/destinations/trip.json) | > | HOSDailyLog | [View model](/models/hosdaily-log) | [Download](/schemas/destinations/hos-daily-log.json) | > | HOSLog | [View model](/models/hoslog) | [Download](/schemas/destinations/hos-log.json) | > | IFTAVehicleMonth | [View model](/models/iftavehicle-month) | [Download](/schemas/destinations/ifta-vehicle-month.json) | > | VehicleUtilizationDay | [View model](/models/vehicle-utilization-day) | [Download](/schemas/destinations/vehicle-utilization-day.json) | > [!TIP] > > The JSON Schema files include the `connectionId` field and can be used for > validation, code generation, or building typed data pipelines. A [schema > index](/schemas/destinations/index.json) listing all models is also available. #### File format Files are delivered in JSON Lines format (one JSON object per line, UTF-8 encoded). gzip compression is optional and can be enabled during configuration. File extensions indicate the format: * `.jsonl` for uncompressed files * `.jsonl.gz` for gzip-compressed files Each file contains rows from a single model type. Large or unbounded sources may be split into multiple part objects to ensure reliable writes and predictable downstream consumption. #### Key formats We deliver data incrementally in an append-only manner. All IDs in S3 object keys (`delivery_id`, `connection_id`, and `part_id`) are [ULIDs](https://github.com/ulid/spec), which are time-sortable identifiers. This means parts can be ordered chronologically by ID generation. Terminal supports several key format options to organize your data. The examples below show common patterns, but if you have a specific objective in mind, we encourage you to reach out to discuss options. Common key format patterns: > [accordion] \{model}/\{connection_id}/\{delivery_id}/\{part_id} > > ```text theme={null} > s3://your-company-terminal-data/{optional_prefix}/ > VehicleLocation/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FAV/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FBV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FCV.jsonl.gz > part_01ARZ3NDEKTSV4RRFFQ69G5FDV.jsonl.gz > conn_01ARZ3NDEKTSV4RRFFQ69G5FEV/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FFV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FGV.jsonl.gz > Vehicle/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FAV/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FHV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FIV.jsonl.gz > Trip/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FEV/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FJV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FKV.jsonl.gz > ``` > > This format groups files by model first, then connection ID, making it easy to locate all data for a specific model and connection. > [accordion] \{model}/\{delivery_id}/\{connection_id}/\{part_id} > > ```text theme={null} > s3://your-company-terminal-data/{optional_prefix}/ > VehicleLocation/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FBV/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FAV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FCV.jsonl.gz > part_01ARZ3NDEKTSV4RRFFQ69G5FDV.jsonl.gz > dlv_01ARZ3NDEKTSV4RRFFQ69G5FFV/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FEV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FGV.jsonl.gz > Vehicle/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FHV/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FAV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FIV.jsonl.gz > Trip/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FJV/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FEV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FKV.jsonl.gz > ``` > > This format organizes files by model first, then delivery ID, making it easy to track individual deliveries. > [accordion] \{connection_id}/\{model}/\{delivery_id}/\{part_id} > > ```text theme={null} > s3://your-company-terminal-data/{optional_prefix}/ > conn_01ARZ3NDEKTSV4RRFFQ69G5FAV/ > VehicleLocation/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FBV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FCV.jsonl.gz > part_01ARZ3NDEKTSV4RRFFQ69G5FDV.jsonl.gz > Vehicle/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FHV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FIV.jsonl.gz > conn_01ARZ3NDEKTSV4RRFFQ69G5FEV/ > VehicleLocation/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FFV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FGV.jsonl.gz > Trip/ > dlv_01ARZ3NDEKTSV4RRFFQ69G5FJV/ > part_01ARZ3NDEKTSV4RRFFQ69G5FKV.jsonl.gz > ``` > > This format groups files by connection ID first, making it easy to locate all data for a specific connection across all models. ### Manifest files Manifest files are an **optional** feature that can be enabled during configuration. When enabled, Terminal writes a single JSON manifest object to your bucket after a delivery finishes uploading all of its data files. The manifest lists every file produced by that delivery, and can be used to: * Signal that a delivery is complete and ready to consume downstream * Drive manifest-based ETL tools (for example, Snowflake `COPY` with a `FILES` list, or Redshift `COPY` with a manifest) * Audit which files belong to a given delivery without having to list the bucket Manifest files are not written unless you explicitly opt in during configuration. If you don't configure manifests, Terminal will only write data files. Each manifest is a JSON object with the delivery ID and an entry for every file in the delivery: ```json theme={null} { "deliveryId": "dlv_01ARZ3NDEKTSV4RRFFQ69G5FBV", "files": [ { "key": "VehicleLocation/conn_01ARZ3NDEKTSV4RRFFQ69G5FAV/dlv_01ARZ3NDEKTSV4RRFFQ69G5FBV/part_01ARZ3NDEKTSV4RRFFQ69G5FCV.jsonl.gz", "model": "VehicleLocation", "count": 12450 }, { "key": "Vehicle/conn_01ARZ3NDEKTSV4RRFFQ69G5FAV/dlv_01ARZ3NDEKTSV4RRFFQ69G5FBV/part_01ARZ3NDEKTSV4RRFFQ69G5FIV.jsonl.gz", "model": "Vehicle", "count": 312 } ] } ``` Each entry contains: * `key` — the S3 object key of the data file (relative to your bucket, including any configured key prefix) * `model` — the Common Model the file belongs to * `count` — the number of rows written to the file Manifests are written with the key `{deliveryId}.json`. A manifest is written for every delivery — both successful and failed — so downstream consumers can use its presence as a reliable "delivery finished" signal regardless of outcome. On a failed delivery, the manifest reflects whatever files were successfully uploaded before the failure. In the rare case a delivery is re-driven, we write to the same key, which updates the manifest in place with the final set of files for that delivery. Because this is a flat naming scheme, **you should tell us what prefix you'd like manifests delivered under** when you enable the feature — for example, `manifests/` — so they land in a predictable location inside your bucket: ```text theme={null} s3://your-company-terminal-data/{your_manifest_prefix}/ dlv_01ARZ3NDEKTSV4RRFFQ69G5FBV.json dlv_01ARZ3NDEKTSV4RRFFQ69G5FFV.json dlv_01ARZ3NDEKTSV4RRFFQ69G5FJV.json ``` The manifest prefix is configured independently from the data file `Key prefix`, so manifests can live under their own prefix (for example, `manifests/`) while data files live elsewhere in the same bucket. ### Sandbox environment Sandbox destinations are configured the same as production destinations but deliver to a separate S3 bucket from your [sandbox environment](/guides/sandbox-environment). This enables you to test your pipelines against anonymized mock data before deploying to production. > [!NOTE] > > Production environments connected to real providers include more data > variability and edge cases not present in sandbox data. *** ## Setup and configuration ### Create your S3 bucket 1. Log in to the [AWS Management Console](https://console.aws.amazon.com/) 2. Navigate to S3 under Storage services 3. Create a new bucket: * Click **"Create bucket"** * Enter a unique bucket name (e.g., `your-company-terminal-data`) * Choose your region * Keep default security settings to block public access * Enable default encryption * Click **"Create bucket"** 4. (Optional) Enable S3 versioning to protect against accidental deletions or overwrites: * Go to bucket Properties * Find and enable Versioning to protect against accidental changes ### Grant Terminal access Terminal supports two authentication methods for accessing your S3 bucket: 1. **Bucket Policy**: Grant permissions to Terminal's IAM role through your bucket policy 2. **Customer IAM Role**: Create an IAM role in your AWS account that Terminal assumes > [tab] Bucket Policy > > Grant Terminal's IAM role direct access to your S3 bucket through a bucket policy. > > 1. Go to your bucket's Permissions tab > > 2. Add the bucket policy: > > * Click **"Edit"** under Bucket Policy > * Paste the relevant policy provided below depending on your environment > * Save changes > > **Production:** > > ```json theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Sid": "AllowTerminalObjectAccess", > "Effect": "Allow", > "Principal": { > "AWS": "arn:aws:iam::616545015708:role/prod-terminal-s3-delivery" > }, > "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"], > "Resource": "arn:aws:s3:::your-company-terminal-data/*" > }, > { > "Sid": "AllowTerminalBucketList", > "Effect": "Allow", > "Principal": { > "AWS": "arn:aws:iam::616545015708:role/prod-terminal-s3-delivery" > }, > "Action": "s3:ListBucket", > "Resource": "arn:aws:s3:::your-company-terminal-data" > } > ] > } > ``` > > **Sandbox:** > > ```json theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Sid": "AllowTerminalObjectAccess", > "Effect": "Allow", > "Principal": { > "AWS": "arn:aws:iam::115722544334:role/sandbox-terminal-s3-delivery" > }, > "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"], > "Resource": "arn:aws:s3:::your-company-terminal-data/*" > }, > { > "Sid": "AllowTerminalBucketList", > "Effect": "Allow", > "Principal": { > "AWS": "arn:aws:iam::115722544334:role/sandbox-terminal-s3-delivery" > }, > "Action": "s3:ListBucket", > "Resource": "arn:aws:s3:::your-company-terminal-data" > } > ] > } > ``` > [tab] Customer IAM Role > > Create and manage your own IAM role for S3 access, providing greater control over permissions and security policies. > > #### Benefits > > * Full control over IAM policies and permissions > * Ability to use AWS Organizations SCPs and permission boundaries > * Audit trail through your own CloudTrail logs > * Support for custom KMS encryption keys with your key policies > > #### Setup Steps > > 1. **Create an IAM role in your AWS account** > > In the [AWS IAM Console](https://console.aws.amazon.com/iam/), create a new role: > > * **Trusted entity type**: AWS account > * **Account ID**: Enter Terminal's AWS account ID for your environment: > * Production: `616545015708` > * Sandbox: `115722544334` > * **Require external ID**: If Terminal configures an external ID for your destination, enable this and use the value Terminal provides. > * **Role name**: Choose a descriptive name (e.g., `TerminalS3DeliveryRole`) > > 2. **Attach the S3 permissions policy** > > Create and attach an inline policy to the role with the following permissions: > > ```json theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Sid": "S3ObjectAccess", > "Effect": "Allow", > "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"], > "Resource": "arn:aws:s3:::your-company-terminal-data/*" > }, > { > "Sid": "S3BucketAccess", > "Effect": "Allow", > "Action": ["s3:ListBucket", "s3:GetBucketLocation"], > "Resource": "arn:aws:s3:::your-company-terminal-data" > } > ] > } > ``` > > > [!NOTE] > > > > If using KMS encryption, add `kms:Decrypt`, `kms:Encrypt`, and > > `kms:GenerateDataKey` permissions for your KMS key ARN. > > 3. **Verify the trust policy** > > Terminal recommends trusting our S3 delivery role directly. For additional security, Terminal can configure a per-destination external ID and include it on every `sts:AssumeRole` call. If we enable an external ID for your destination, include the same value in your trust policy. > > **Production:** > > ```json theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Effect": "Allow", > "Principal": { > "AWS": "arn:aws:iam::616545015708:role/prod-terminal-s3-delivery" > }, > "Action": "sts:AssumeRole", > "Condition": { > "StringEquals": { > "sts:ExternalId": "your-terminal-external-id" > } > } > } > ] > } > ``` > > **Sandbox:** > > ```json theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Effect": "Allow", > "Principal": { > "AWS": "arn:aws:iam::115722544334:role/sandbox-terminal-s3-delivery" > }, > "Action": "sts:AssumeRole", > "Condition": { > "StringEquals": { > "sts:ExternalId": "your-terminal-external-id" > } > } > } > ] > } > ``` > > > [!NOTE] > > > > Terminal treats these S3 delivery role ARNs as stable trust targets. If we > > ever need to change one, we will coordinate with you before making the > > change. > > 4. **Copy the role ARN** > > After creating the role, copy its ARN from the role summary page. It will look like: > > ``` > arn:aws:iam::YOUR-ACCOUNT-ID:role/TerminalS3DeliveryRole > ``` > > You'll provide this ARN to Terminal when configuring your destination. ### Share your configuration options After configuring your bucket and access permissions, you'll need to set up your S3 destination with Terminal. Contact our team with the following information and any questions: ```text theme={null} AWS region: Bucket name: Environment (production or sandbox): Key format: # Add optional fields that differ from defaults: # Option name: ``` | Name | Default | Description | | - | - | - | | AWS region | | Required. AWS region for your S3 bucket. | | Bucket name | | Required. Name of your S3 bucket. | | Environment | | Required. Terminal environment this destination belongs to (`production` or `sandbox`). | | Key format | | Required. Format pattern for S3 object keys. See [Key formats](#key-formats) above for available options. | | Compression | Enabled | Optional. Enable gzip compression for objects. | | Data Sources | Mirrors Terminal app permissions | Optional. Models and data sources to deliver to your S3 bucket. | | Key prefix | | Optional. Prefix for object keys (for example, `terminal-data/`). If omitted, objects are written at the bucket root. | | Manifest Files | Disabled | Optional. Enable per-delivery [manifest files](#manifest-files). If omitted, no manifests are written. | | Manifest key prefix | None | Optional. Prefix under which manifests are delivered (for example, `manifests/`). Independent from the data `Key prefix`. | | Raw Included | Disabled | Optional. Include [raw data](/guides/raw-data) with common models. Note: this increases data volume by 2-4x or more. | | Role ARN | | Optional. ARN of a customer-managed IAM role to assume for S3 access. When provided, Terminal will assume this role instead of using the default delivery role. See [Customer IAM Role setup](#grant-terminal-access) for details. | | Role External ID | None | Optional. Terminal can configure an external ID for the Customer IAM Role authentication method and pass it when assuming your role. | | Schedule | Daily when enabled | Optional. Schedule for incremental deliveries to your S3 bucket (rate or cron expression). Defaults to `rate(1 day)` when enabled. | | Size limit | 100 MB (maximum 5 GB) | Optional. Advanced. Maximum uncompressed bytes per uploaded object for unbounded sources and streaming splits. Most use cases can omit this. | # Backfill Duration Source: https://docs.withterminal.com/guides/backfill-duration What affects how long a backfill takes, and how to watch progress. A **backfill** is any sync that pulls a large historical window from the telematics provider — for example when a new connection is created with a backfill window, when additional history is needed later, or when a connection has gone a long time without syncing. Backfill duration is not fixed. It depends on the provider, which models are enabled, the size of the fleet, and how much of the requested window actually contains data. ## What affects duration ### Telematics provider Every Terminal integration calls the provider's API. Providers differ in ways that change how quickly a backfill can finish: * **Rate limits** — how often the provider allows Terminal to make requests * **Page / response limits** — how many records the provider returns in a single response * **Access patterns** — which endpoints Terminal must call, and in what sequence, to populate [common models](/models) * **Sample rates** — how frequently the provider reports data points per vehicle, which affects data density * **Request latency** — how quickly the provider responds to each request Use the [Provider Explorer](/providers/explorer) to compare available history and sample rates. Some providers apply a **shared rate limit** across every integration on a fleet's account. Other products or services accessing data from that same account can consume the same pool and slow your backfill. ### Enabled models Which models are enabled for your application and the fleet's provider affect how much work a backfill does. Models generally differ in density (records per vehicle per day) and may have different performance characteristics among providers. ### Fleet size Larger fleets produce more data. For a given provider, volume generally scales with the number of vehicles in the fleet. ### Backfill length A longer requested window means more requests to the provider and usually more records to ingest. Configure this per Link with `backfill_days` or `backfill.startFrom`, or as an application default in the [Terminal Dashboard](https://dashboard.withterminal.com). How much of that window actually contains data matters as much as the window itself. A fleet that has been active with a provider for two days typically finishes faster than an equivalent fleet that has been active for two years, even if both request the same backfill length: empty time ranges still have to be checked, but they do not require paging through large result sets. ## Watching progress You can inspect in-progress backfills in two places: * The [Terminal Dashboard](https://dashboard.withterminal.com) shows an approximate progress percentage for in-progress syncs * [`GET /syncs/{id}`](/api-reference/data-management/get-sync-job-status) returns sync status, including progress, for programmatic monitoring Wait for `sync.completed` (or `connection.first_sync_completed` on a new connection) before treating the backfill as available through Terminal APIs. If you use data destinations, wait for the corresponding `delivery.completed` event before treating the delivery as complete. See [Syncing via the API](/guides/syncing-via-the-api). # Connection Health Monitoring Source: https://docs.withterminal.com/guides/connection-health-monitoring Understand the different categories of connection health events, how to monitor them, and what actions to take. This guide covers what can affect the health and data completeness of a connection, how Terminal surfaces these events, and what you can do to monitor and manage them. It complements [Data Replication](/guides/data-replication) and the [API sync guide](/guides/syncing-via-the-api), which cover the happy path for getting data out of Terminal. ## Overview A connection's health can be affected by several categories of events, ranging from full disconnects that require fleet action to subtle ingestion-level issues that may only impact specific data types. Terminal provides tools across the API, webhooks, and dashboard to help you monitor and respond to each. | Category | Data Impact | Action Required | How It Surfaces | | - | - | - | - | | **Disconnects** | All data ingestion stops | Fleet must reconnect | Connection status, webhooks, email notifications | | **Sync failures** | Data temporarily stale | Handled by Terminal | Sync status, webhooks | | **Ingestion issues** | Specific data may be incomplete | Varies | Issues API, webhooks, dashboard | ## Connection Disconnects A disconnect occurs when a connection's authentication is no longer valid. This is the most impactful health event because **all data ingestion stops** until the connection is restored. ### Common Causes * Changed login credentials on the provider account * Provider account expired or deactivated * Revoked OAuth access (for OAuth-based providers) ### How to Detect **Connection status**: The connection's `status` field changes to `disconnected`. You can check this via the API: ```bash theme={null} curl "https://api.withterminal.com/tsp/v1/connections/current" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" ``` **Webhooks**: Subscribe to the [`connection.disconnected`](/api-reference/webhook-events/connection-disconnected) event for real-time notification. The webhook payload includes a reconnection link you can surface to the fleet. **Dashboard**: Disconnected connections are visible on the connections page with their current status. ### How to Resolve We recommend building workflows based on our supported webhooks to notify the fleet and invite them to reconnect. * Build an in-app or email based reconnection flow using the `connection.disconnected` webhook * Monitor for the [`connection.reconnected`](/api-reference/webhook-events/connection-reconnected) event to confirm restoration For manual workflows the reconnection link is also accessible in the Terminal Dashboard. For more detail, see the [Disconnected Connections](/guides/disconnected-connections) guide. ## Sync Failures A sync failure occurs when Terminal encounters an error while attempting to fetch data from a provider. Unlike disconnects, the connection itself remains valid, but data may become temporarily stale. ### Common Causes * Transient provider API errors or rate limiting * Temporary provider outages or degradation * Unexpected data format changes from the provider ### How to Detect **Sync status**: Monitor sync jobs via the API or the [`sync.failed`](/api-reference/webhook-events/sync-failed) webhook event. ```bash theme={null} # Check sync history for a connection curl "https://api.withterminal.com/tsp/v1/syncs" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" ``` **Webhooks**: Subscribe to [`sync.failed`](/api-reference/webhook-events/sync-failed) to detect failures in real-time. ### How to Resolve Most sync failures are transient and resolve automatically on the next sync cycle. Terminal's ingestion pipeline includes built-in retry logic for common provider errors. If a failure persists across multiple sync cycles, Terminal's engineering team will triage the issue to resolve. If you are seeing sync failures persist for multiple days, [contact Terminal support](mailto:support@withterminal.com) for investigation. > [!NOTE] > > Sync failures are triaged and addressed by the Terminal team. You do not typically need to take action beyond monitoring. > > You can always reach out to [Terminal support](mailto:support@withterminal.com) for clarification or questions about ongoing sync failures ## Issues [Issues](/models/issue) are the most granular category of connection health. They represent problems encountered during data ingestion that **don't fully block the sync** but may cause specific data to be incomplete or unavailable. Unlike disconnects and sync failures, issues affect only a subset of the data for a connection. For example, a connection may successfully sync vehicles, drivers, and trips but report an issue indicating that HOS logs are inaccessible due to missing permissions. ### Issue Lifecycle Each issue has a **status** that tracks its current state: | Status | Description | | - | - | | `ongoing` | The issue was observed during a recent sync and continues to affect data | | `resolved` | The issue has not been observed recently and is considered resolved | Issues are automatically deduplicated. If the same issue is observed across multiple syncs, the existing issue is updated rather than creating duplicates. The `firstReportedAt` and `lastReportedAt` timestamps track the issue's history. Issues automatically resolve when they are no longer observed during syncs. ### Issue Codes Each Issue's `error.code` is its stable semantic identifier. Codes describe a shared diagnosis and remediation workflow rather than the provider or ingestion mechanism that discovered the condition. Provider-, capability-, and record-specific details remain in `error.message`. For example, `oauth_scope_missing` identifies the OAuth application update and fleet reauthentication workflow, while `permission_missing` identifies an ordinary provider permission change. The Issue also includes a `resolutionType` describing whether action is required, Terminal will retry automatically, Terminal owns the work, the condition is a known limitation, or investigation is required. When available, `documentationUrl` links to the dedicated resolution guide for that code. ### Monitoring Issues #### API Use the [List Issues](/api-reference/issues/list-issues) endpoint to query issues for a connection. You can filter by status, Issue code, and date range. ```bash theme={null} # List all ongoing issues for a connection curl "https://api.withterminal.com/tsp/v1/issues?connectionId=conn_xxx&status=ongoing" \ -H "Authorization: Bearer your_secret_key" # List issues with a specific code curl "https://api.withterminal.com/tsp/v1/issues?connectionId=conn_xxx&errorCode=permission_missing" \ -H "Authorization: Bearer your_secret_key" ``` #### Webhooks Subscribe to issue webhook events for real-time monitoring: * [`issue.reported`](/api-reference/webhook-events/issue-reported) - Fired when a new issue is observed or a previously resolved issue recurs * [`issue.resolved`](/api-reference/webhook-events/issue-resolved) - Fired when an ongoing issue is resolved #### Dashboard The Terminal dashboard provides a dedicated issues view for each connection on the Issues tab, showing Issue code, status, message, resolution guide, and reporting timestamps. #### Resolving Issues Manually You can manually mark an issue as resolved using the [Resolve Issue](/api-reference/issues/resolve-issue) endpoint. If the underlying problem still exists, the issue will be re-reported on the next sync. ```bash theme={null} curl --request POST \ --url "https://api.withterminal.com/tsp/v1/issues/iss_xxx/resolve" \ -H "Authorization: Bearer your_secret_key" ``` ## Recommended Monitoring Strategy For production integrations, we recommend the following approach to connection health monitoring: 1. **Subscribe to key webhooks**: At minimum, subscribe to `connection.disconnected`, `sync.failed`, and `issue.reported` events to be notified of health changes in real-time. 2. **Surface disconnects to fleets**: Use the `connection.disconnected` webhook to trigger notifications to fleets with the reconnection link, either through your own product's UI or by sending emails to fleets. 3. **Monitor ongoing issues**: Periodically query the Issues API for `ongoing` issues across your connections to identify persistent data quality problems that may need attention. 4. **Track sync health**: Use `sync.completed` and `sync.failed` webhooks to monitor the overall health of your data pipeline and detect providers experiencing degradation. ## Related Resources * [Data Replication](/guides/data-replication) - Sync vs replication and egress options * [Syncing via the API](/guides/syncing-via-the-api) - Pull patterns and `modifiedAfter` * [Disconnected Connections](/guides/disconnected-connections) - Handling disconnected connections * [Issue Model](/models/issue) - Full issue schema reference * [Webhooks](/guides/webhooks) - Setting up and managing webhooks * [List Issues API](/api-reference/issues/list-issues) - Query issues via the API # Consent Templates Source: https://docs.withterminal.com/guides/consent-templates Learn how to create reusable Link configurations for branding, redirects, and ingestion defaults. ## What are Consent Templates? Consent Templates let you create reusable configurations for Terminal Link. They are useful when you want different onboarding flows for different products, customer segments, or partner experiences without rebuilding the Link integration each time. Each template can control: * The display name and logo shown in Link * Theme settings such as primary color and border radius * Default connection settings such as sync mode, backfill days, and tags * Whether `external_id` is required * Redirect URLs for successful, unsupported-provider, or blocked-provider flows * Localized content for English, French, and Spanish > [!NOTE] > > Every application includes a default template. If you do not pass a template > when launching Link, Terminal uses `default`. ## Managing templates in the dashboard You can create and manage templates from **Add Connections** -> **Consent Templates** in the Terminal dashboard. From the templates page you can: * Create a new template * Open a template-specific Link * Copy a Link URL that already includes the template ID * Edit an existing template * Archive and unarchive custom templates ![](https://mintcdn.com/terminal-docs/rvjre7m6VLwVA_v_/images/consent-templates/consent-templates-list.png?fit=max\&auto=format\&n=rvjre7m6VLwVA_v_\&q=85\&s=1cea8f33b29c4beefecb8b3f5ddf6ea8) > [!TIP] > > Archiving a custom template does not break links that already use it. Existing > links continue to work. ## Creating a template When you create a template, Terminal lets you configure basic connection defaults up front. ### Basic information The **Basic Information** section controls the internal and connection-level defaults for the template. * **Template Name** is only shown in the dashboard * **Require External ID** forces Link launches to include an `external_id` * **Default Tags** are automatically applied to new connections created with that template ![](https://mintcdn.com/terminal-docs/rvjre7m6VLwVA_v_/images/consent-templates/consent-template-basic-information.png?fit=max\&auto=format\&n=rvjre7m6VLwVA_v_\&q=85\&s=427fcdbc58c6fcbcd3a8f3e5d90b261b) ## Branding and theme Templates can change how Link looks to the end user. * **Display Name** changes the name shown in the consent flow * **Logo** can use your default logo or any logo in your library, and you can upload a new one without leaving the editor * **Theme** lets you set a primary color and border radius Terminal supports localized branding for: * English * French * Spanish If a French or Spanish display name or logo is not set, Link falls back to the English value. If the English value is also empty, Link falls back to your application branding. If your application has uploaded custom end user agreements, you can also configure those per locale in the template editor. ![](https://mintcdn.com/terminal-docs/rvjre7m6VLwVA_v_/images/consent-templates/consent-template-branding-theme.png?fit=max\&auto=format\&n=rvjre7m6VLwVA_v_\&q=85\&s=c0645e84ef07b33ef4ee3a9861917610) ## Redirects and ingestion defaults Templates can also set default behavior for new connections created through Link. Available defaults include: * **Success Redirect URL** * **Unsupported Provider Redirect URL** * **Blocked Provider Redirect URL** * **Backfill Days** * **Sync Mode** `syncMode` supports: * `automatic`: Terminal keeps the connection up to date automatically * `manual`: data is only synced when requested ![](https://mintcdn.com/terminal-docs/rvjre7m6VLwVA_v_/images/consent-templates/consent-template-ingestion.png?fit=max\&auto=format\&n=rvjre7m6VLwVA_v_\&q=85\&s=45adc1401fcdfd5f95a5770622c9ad77) ## Provider access control By default, every template follows the [Provider Access Control](/guides/provider-access-control) setting on your application. A template can instead define its own, which is useful when one segment of your customers should see a different set of providers. In the template editor, open **Provider Access Control** and choose a **Provider Access Mode**: * **Use application setting**: the template follows your application configuration. This is the default. * **Allow All Providers**, **Allow Only Selected**, or **Block Selected**: the template defines its own list. A template's mode replaces your application setting for consent flows that use that template — it does not narrow it further. A template set to **Allow Only Selected** can therefore make a provider available that your application blocks, and a template set to **Block Selected** can block a provider your application allows. > [!NOTE] > > Switch the mode back to **Use application setting** to remove the override. > Fleets then see whatever your application configuration allows, including any > providers Terminal adds later. ## Using a template with Link The easiest way to use a template is to copy the Link directly from the dashboard. Terminal generates a Link URL with both your publishable key and the template ID. If you want to construct the Link yourself, pass the template ID in the `template` parameter. ### Hosted Link ```text theme={null} https://link.withterminal.com/?key={PUBLISHABLE_KEY}&template=ltp_01... ``` If you omit `template`, Terminal uses the default template: ```text theme={null} https://link.withterminal.com/?key={PUBLISHABLE_KEY} ``` ### SDK example ```tsx theme={null} import { useTerminalLink } from '@terminal-api/link-react'; const terminal = useTerminalLink({ publishableKey: process.env.REACT_APP_TERMINAL_PUBLISHABLE_KEY, params: { template: 'ltp_01...', }, }); ``` ## How template defaults are applied Templates define defaults, but you can still override some values at launch time. * `redirect_url` overrides the template's success redirect URL for that launch * `sync_mode` overrides the template's sync mode for that launch * `backfill_days` overrides the template's backfill setting for that launch * `tags` passed at launch are combined with the template's default tags This makes templates a good fit for reusable baseline configuration, while still allowing per-customer or per-session customization. ## Things to know * You must be an administrator in the Terminal dashboard to manage Consent Templates * Default templates cannot be archived * Custom templates use IDs like `ltp_...` * Every logo in your library appears in the template editor. Upload new ones from the editor or from [Settings > Branding](/guides/terminal-link#adding-your-logo). Custom end user agreements still need to be uploaded by Terminal support; to request one, contact [support@withterminal.com](mailto:support@withterminal.com). * The `template` parameter works with hosted Link and the Link SDKs ## Related docs * [Terminal Link](/guides/terminal-link) * [Custom Identifiers](/guides/custom-identifiers) # Crash Reports Source: https://docs.withterminal.com/guides/crash-reports Receive detailed reports when crash events are detected across connections ## Overview **Crash Reports** generate and send detailed notifications when a crash is detected during safety event ingestion. These reports include: * Event details (time, location, address) * Vehicle information * Driver details (if available) * Camera footage (front and rear-facing, if available) * Map view of the incident location The information is sent as an email notification to subscribed recipients, providing a complete overview of the incident. ## How It Works When ingesting safety events, we monitor for `crash` events. When a crash event is detected, the crash notification workflow is triggered. If configured to do so, it retrieves and downloads any available camera media related to the incident. Following this, a comprehensive report is sent via email to configured recipients. Here's an example: ![](https://mintcdn.com/terminal-docs/CsBNyIr4mg-Im42C/images/crash-report-email.png?fit=max\&auto=format\&n=CsBNyIr4mg-Im42C\&q=85\&s=f192080aed291ea01dac41090e0b4acc) ## How to Configure [https://www.loom.com/embed/c8c830ef8c1f41f1ae22afe7f25b4136?sid=fd7e2d41-7e4a-4166-9a17-ad8bdc4d2868](https://www.loom.com/embed/c8c830ef8c1f41f1ae22afe7f25b4136?sid=fd7e2d41-7e4a-4166-9a17-ad8bdc4d2868) 1. Navigate to [**Settings > Application Settings**](https://dashboard.withterminal.com/settings) section of the dashboard. 2. Locate the **Crash Reporting** option. 3. Choose your desired global setting (**Enabled**, **Disabled**, or **Enabled Per Connection**). 4. If you select **Enabled Per Connection**: * Click **Edit Connections** to open a popup showing all connections. * Toggle the switch for each connection to enable or disable crash notifications. 5. Set your preference for whether media files should be attached to email notifications. > [!NOTE] > > **Note:** Users will only receive crash report notifications when they have > opted to receive crash report notifications in their [personal > settings](/guides/user-notifications). ## Configuration Options **Global Setting** * Crash reporting can be **Enabled**, **Disabled**, or **Enabled Per Connection** **Per-Connection Setting** When the global setting is set to **Enabled Per Connection**: * Crash reports will only be sent for selected connections * Use the **Edit Connections** popup to toggle crash reporting on/off for each connection **Attach Media to Notifications** * When **Enabled**, emails will include videos from the event when camera media is available * When **Only when media is available**, emails will only be sent when camera media is available, and will include the videos * When **Only when media is available, without attachments**, emails will only be sent when camera media is available, but will not include the videos * When **Disabled**, emails will be sent without any media attachments ## Supported Providers To see which providers support crash reports, use the [Provider Explorer](/providers/explorer) and filter for **Crash Report**. # Custom Identifiers Source: https://docs.withterminal.com/guides/custom-identifiers ## Overview Terminal provides customers multiple options to associate custom identifiers. This makes it easy to search for data in Terminal using these identifiers. You can assign the following custom identifiers to your connections: **External ID**\ A unique identifier that you can assign to connections, typically mapping to your internal system identifiers. Common uses include: * Internal classification (submissionId, policyId, quoteId, etc.) * Fleet ID (ID in source system) **Tags**\ Flexible labels that help categorize and identify connections. You can use tags to track: * Customer Account Type (pre-bind, post-bind) * Business context (prospect, customer, enterprise) * Internal classifications (DOT, submissionId=1234) ## Usage ### Assigning Custom Identifiers When you create a connection with Terminal's [Link](/guides/terminal-link), you can assign custom identifiers by including the `external_id` or `tags` parameters. > [!NOTE] > > If your application is configured to de-duplicate connections, tags will be > added to an existing connection if one exists. Otherwise, a new connection > with these tags will be created. **Hosted Flow** ``` https://link.withterminal.com/?external_id=my-external-id&tags=customer,prospect&key={PUBLISHABLE_KEY} ``` **React SDK** ```tsx theme={null} const terminal = useTerminalLink({ // production or sandbox publishable key from the Terminal dashboard publishableKey: process.env.REACT_APP_TERMINAL_PUBLISHABLE_KEY, onSuccess: exchangeToken, params: { externalId: 'my-external-id', tags: ['customer', 'prospect', 'submissionId=1234'], }, }); ``` **JavaScript SDK** ```ts theme={null} TerminalLink.initialize({ // production or sandbox publishable key from the Terminal dashboard publishableKey: process.env.TERMINAL_PUBLISHABLE_KEY, onSuccess: (result) => exchangePublicToken(result.publicToken), params: { externalId: 'my-external-id', tags: ['customer', 'prospect', 'submissionId=1234'], }, }).open(); ``` ### Updating Custom Identifiers You can also assign custom identifiers to an existing connection by calling the [Update Current Connection API](/api-reference/connections/update-current-connection) and including the appropriate parameters. ```bash theme={null} curl --request PATCH \ --url https://api.withterminal.com/tsp/v1/connections/current \ --header 'Authorization: ' \ --header 'Connection-Token: ' \ --header 'Content-Type: application/json' \ --data '{ "externalId": "new-external-id", "tags": ["customer", "prospect", "submissionId=1234"] }' ``` ### Searching by Custom Identifiers You can search for connections using custom identifiers with the [List Connections API](/api-reference/connections/list-connections). You can search using all or any of the identifier types. For example: ```bash theme={null} curl --request GET \ --url 'https://api.withterminal.com/tsp/v1/connections?externalId=new-external-id&tags=customer' \ --header 'Authorization: ' ``` This example searches for connections with the external ID `new-external-id` and tags `customer`. You can adjust the query parameters to search by any combination of external IDs and tags that suit your needs. # Data Replication Source: https://docs.withterminal.com/guides/data-replication How Terminal syncs provider data and the options for getting it into your systems. Terminal keeps each connection's telematics data up to date by syncing from the provider. Once that data is in Terminal, you choose how to get it into your systems. ## Sync vs replication **Sync** is Terminal pulling and normalizing data from a telematics provider (TSP). Most connections use automatic background sync; you can also [request a sync](/api-reference/data-management/request-sync) when you need a backfill or precise timing. **Replication** is how *you* consume that data after Terminal has it: | Method | Best for | How data moves | | - | - | - | | [API](/guides/syncing-via-the-api) | Application logic, selective queries, custom pipelines | You pull with `modifiedAfter` / record-time filters | | [Amazon S3](/guides/aws-s3-destination) | Warehouses, batch ETL, archival | Terminal delivers files to your bucket on a schedule or request | | [Kafka](/guides/kafka-destination) | Event-driven systems, low-latency streaming | Terminal produces records to your cluster as data is ingested or updated | You can use more than one method (for example API for product features and S3 for analytics). ## Sync modes **Automatic sync mode** (default): Terminal automatically keeps your connection's data up to date by running syncs in the background. Most connections use this mode, which is typically configured during connection setup. **Manual sync mode**: You control when syncs happen by requesting them through the API. Use this mode when you need precise control over sync timing or costs. ```bash theme={null} # Request a manual sync curl --request POST \ --url 'https://api.withterminal.com/tsp/v1/syncs' \ --header 'Authorization: Bearer your_secret_key' \ --header 'Connection-Token: con_tkn_your_token' \ --header 'Content-Type: application/json' \ --data '{"days": 90}' ``` ## Shared lifecycle 1. **Sync** — Terminal ingests and normalizes data for the connection. Syncs are either scheduled automatically or requested manually. 2. **Data available** — Records are ready in Terminal. Listen for [`sync.completed`](/guides/webhooks) (or poll sync status) when you need to know a sync finished. 3. **Replicate** — Pull via the API into your system, or wait for destination delivery. For S3 Data Delivery, wait for [`delivery.completed`](/guides/webhooks) before treating files as complete — sync completion alone is not enough. > [!NOTE] > > Current-state reads (for example latest vehicle location) are covered in > [Real-Time Data](/guides/real-time-data), not this replication flow. ## Choose a path * **Building product features or a custom syncer** → [Syncing via the API](/guides/syncing-via-the-api) (includes the `modifiedAfter` convention and lookback guidance). * **Loading a warehouse or lake on a schedule** → [AWS S3 Destination](/guides/aws-s3-destination). * **Streaming into existing Kafka consumers** → [Kafka Destination](/guides/kafka-destination). * **Triggering work when data changes** → [Webhooks](/guides/webhooks) (often used with the API path). # Deleting Connections Source: https://docs.withterminal.com/guides/deleting-connections Permanently delete a connection and all of its associated data from Terminal. Deleting a connection permanently removes all data Terminal has synced for it. This action cannot be undone, and is the right choice when you need the data itself to be gone — for example, when a customer requests data deletion, or when you're cleaning up test and duplicate connections whose history you don't want to keep. ## What gets deleted Terminal removes all data which was synced for the connection: entities, historical data, and time-series data. Terminal also removes sensitive and operational data: provider credentials, sync and issue history, and any filters configured on the connection. Terminal retains the connection record so you can confirm the deletion via [List Connections](/api-reference/connections/list-connections) and reconcile references on your side. Deleted connection records include `deletedAt`, the time deletion completed. ## Deletion lifecycle Once deletion is requested, the connection moves through three statuses: | Status | Meaning | | - | - | | `pending_deletion` | Deletion has been requested. Data flow has stopped. The request can still be cancelled. | | `deleting` | Terminal is actively removing data. This step is irreversible. | | `deleted` | All data has been removed. | A **24-hour grace period** applies before deletion starts. As soon as deletion is requested, the connection moves to the `pending_deletion` status and Terminal stops syncing it, excludes it from data delivery, and stops emitting data webhooks for it — ensuring that no further data is ingested or delivered during the grace period. The connection token also cannot be used to read stored data (for example List Vehicles or historical locations). Get, update, and delete current connection remain available so you can inspect status or cancel during the grace period. The request can still be cancelled at any point before the grace period ends. After that, the connection transitions to the `deleting` status, data removal begins, and the process can no longer be stopped. Deletion is expected to complete within 48 hours of the original request. ## Delete via the dashboard From the [Terminal Dashboard](https://dashboard.withterminal.com), open the connection, click the triple-dot menu in the header, and choose **Delete Connection**. > [!NOTE] > > The **Delete Connection** action is restricted to Dashboard members with the > **admin** role. Members with other roles will not see it in the menu. ![](https://mintcdn.com/terminal-docs/BQzz2b_RXL4y0Dal/images/data-deletion/delete-menu.png?fit=max\&auto=format\&n=BQzz2b_RXL4y0Dal\&q=85\&s=5babdd2a9123f7aee501d968335fce06) A confirmation modal explains the consequences. Because deletion is an irreversible action, it requires explicit confirmation. ![](https://mintcdn.com/terminal-docs/BQzz2b_RXL4y0Dal/images/data-deletion/delete-confirm-modal.png?fit=max\&auto=format\&n=BQzz2b_RXL4y0Dal\&q=85\&s=436e00aa6579c8f7afa82827497fbc67) Once confirmed, the connection moves to **Pending Deletion** for the 24-hour grace period. ![](https://mintcdn.com/terminal-docs/BQzz2b_RXL4y0Dal/images/data-deletion/connection-detail-pending-deletion.png?fit=max\&auto=format\&n=BQzz2b_RXL4y0Dal\&q=85\&s=df005e9a4f1f4e34fed37dc6ce5b68a9) Connections in `deleting` or `deleted` status will no longer be visible in the dashboard. ## Delete via the API To delete a connection programmatically, call [Delete Current Connection](/api-reference/connections/delete-current-connection) with your Terminal secret key and the connection token for the connection you want to delete. ```bash theme={null} curl -X DELETE https://api.withterminal.com/tsp/v1/connections/current \ -H "Authorization: Bearer $TERMINAL_SECRET_KEY" \ -H "Connection-Token: $CONNECTION_TOKEN" ``` > [!NOTE] > > Any API key can request deletion of a connection. The endpoint returns `202 Accepted` and updates the connection status to `pending_deletion`. Terminal emits a [`connection.pending_deletion`](/api-reference/webhook-events/connection-pending-deletion) webhook when deletion is requested and a [`connection.deleted`](/api-reference/webhook-events/connection-deleted) webhook after deletion completes. ## Cancelling a pending deletion While a connection is in the `pending_deletion` status, set it back to `connected` or `archived` via [Update Current Connection](/api-reference/connections/update-current-connection) to cancel the deletion. Once the connection transitions to the `deleting` status, cancellation is no longer possible. ## Archive vs delete Archiving and deleting are both ways to wind down a connection, but they solve different problems: | Action | What happens to data | Reversible? | Use when | | - | - | - | - | | **Archive** | Kept | Yes, at any time | You want to stop syncing a connection but keep its history available. | | **Delete** | Permanently removed | Only during the grace period | You need the data gone — for example, a customer data deletion request. | If you're not sure, archive first. You can always delete later. # Disconnected Connections Source: https://docs.withterminal.com/guides/disconnected-connections Learn how Terminal handles disconnected connections and the workflows available for quick reconnection. ## What are disconnected connections? Connections can become disconnected for various reasons, including changed login credentials, provider account expiry, and revoked OAuth access. When this happens, Terminal provides notifications and tools to help fleets quickly reconnect. Terminal automatically detects when connections become disconnected and provides multiple pathways for reconnection, reducing downtime and friction for fleets. ## Notifications When a connection becomes disconnected, Terminal automatically notifies customers by email with: * An explanation of the disconnection * A direct reconnection link that can be shared with the fleet ![](https://mintcdn.com/terminal-docs/CsBNyIr4mg-Im42C/images/disconnected-notification.png?fit=max\&auto=format\&n=CsBNyIr4mg-Im42C\&q=85\&s=7891824f6d0036fd19fcda0428db0de2) ### Dashboard management Customers can also monitor and manage disconnected connections through the Terminal dashboard to: * View the status of all connections in real-time * Access reconnection links directly from the connections page ![](https://mintcdn.com/terminal-docs/CsBNyIr4mg-Im42C/images/reconnect.png?fit=max\&auto=format\&n=CsBNyIr4mg-Im42C\&q=85\&s=6016a667b684a86141beca187e2b130b) ## Reconnecting with webhooks Terminal also provides the [`connection.disconnected`](/api-reference/webhook-events/connection-disconnected) webhook for automated workflows. This webhook can be used to: * Power automated fleet notifications * Build in-app reconnection prompts * Create custom UI flows within your application When triggered, this webhook provides: * Notification that a connection has been disconnected * The reconnection link for that specific connection * Connection metadata for context # Duplicate Connections Source: https://docs.withterminal.com/guides/duplicate-connections Learn what duplicate connections are and best practices for handling them. ## What are duplicate connections? Each connection in Terminal is a link to an underlying telematics provider account. When an end user goes through the [Link Flow](/guides/terminal-link), it's possible to create more than one connection to the same provider account. Whether Terminal reuses an existing connection or creates a new one depends on your application's **Dedupe Connections** setting. ## Dedupe Connections setting Configure this in the [Terminal Dashboard](https://dashboard.withterminal.com/settings) under **Settings > General > Dedupe Connections**. Enabled is the default for production applications. ### Enabled When deduplication is enabled, Terminal checks for an existing connection to the same provider account before creating a new one. A match requires: * The same provider account (`sourceId`) * The same [External ID](/guides/custom-identifiers), or no External ID on either the existing or incoming connection If a match is found, Terminal **updates the existing connection** instead of creating a new one. Credentials, tags, and other metadata from the Link Flow are merged into that connection. If no match is found — for example, because a different External ID was passed — Terminal creates a new connection to the same provider account. ### Disabled When deduplication is disabled, Terminal **always creates a new connection** when a user completes the Link Flow, even if that provider account is already connected. Use this when you intentionally want multiple connections to the same provider account — for example, to represent different business contexts, customers, or internal identifiers as separate connections. External IDs do not prevent duplicate connections when deduplication is disabled. ## How External IDs impact duplicate connections External IDs are one of the ways to associate [Custom Identifiers](/guides/custom-identifiers) with a connection. External IDs are intended to be **your system's** unique identifier for the connection. When **Dedupe Connections** is enabled, passing a different External ID into the [Link Flow](/guides/terminal-link) than the one on an existing connection causes Terminal to create a second connection to the same provider account. For this reason, we recommend using a consistent External ID from your system when initiating the [Link Flow](/guides/terminal-link). This lets you intentionally create duplicate connections when you need multiple connections to the same provider account while deduplication is otherwise enabled. # Entity Status & Visibility Source: https://docs.withterminal.com/guides/entity-status-visibility This guide explains two important fields found on all Terminal entities: `status` and `metadata.visibility`. Understanding the difference is essential for correctly interpreting data and configuring [filtering](/guides/vehicle-driver-filtering). ## What is an Entity? In Terminal, an **entity** is a core data model that represents a real-world object tracked by telematics providers. The three main entities are: | Entity | Description | ID Prefix | | - | - | - | | [Vehicle](/models/vehicle) | Trucks, vans, cars, and other motorized assets | `vcl_` | | [Driver](/models/driver) | Individuals who operate vehicles | `drv_` | | [Trailer](/models/trailer) | Non-motorized assets that attach to vehicles | `trl_` | All entities share the same `status` and `metadata.visibility` fields described below. ## Entity Status The `status` field reflects whether an entity is currently active in the fleet's telematics provider account. | Value | Description | | - | - | | `active` | The entity is currently operational and tracked in the provider's system | | `inactive` | The entity has been offboarded, archived, deactivated, or soft-deleted from the provider's system | ### How Status is Determined The `status` value comes directly from provider data during sync. Terminal normalizes each provider's representation into the standard `active`/`inactive` enum. **Vehicle status examples:** | Provider | Active When | | - | - | | Geotab | `activeTo` date has not passed | | Samsara | A gateway device is currently associated | | Motive | Provider's `status` field equals `"active"` | **Driver status examples:** | Provider | Active When | | - | - | | Geotab | `activeTo` date has not passed | | Motive | Provider's `status` field equals `"active"` | | Most providers | Direct mapping from the provider's status field | > [!NOTE] > > Terminal does not modify or compute this value beyond normalizing the > provider's representation. The status reflects the entity's state in the > provider system at the time of the last sync. ## Entity Visibility The `metadata.visibility` field is a Terminal-specific concept that indicates whether an entity's data is being ingested and returned by the API. This is computed at query time based on your connection's [filtering configuration](/guides/vehicle-driver-filtering). | Value | Description | | - | - | | `visible` | Default state. Entity data is actively ingested and returned by the API | | `hidden_by_include_list` | An `includeIds` filter is configured but this entity is not in the list | | `hidden_by_exclude_list` | This entity is in the `excludeIds` filter list | | `hidden_by_status` | A `status` filter is configured and this entity's status doesn't match | | `deleted` | The entity was previously synced but has been hard-deleted from the provider's system | > [!NOTE] > > When `includeIds` is present and non-empty, it takes highest priority. All > other filter criteria (`status` and `excludeIds`) are ignored. ### Filtering by Entity Type Filters are configured separately for vehicles and drivers on each connection: ```json theme={null} { "filters": { "vehicles": { "status": "active", "excludeIds": ["vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC"] }, "drivers": { "status": "active", "excludeIds": ["drv_01D8ZQFGHVJ858NBF2Q7DV9MNC"] } } } ``` See the [Filtering Guide](/guides/vehicle-driver-filtering) for complete configuration details. ## Common Scenarios ### Scenario 1: Offboarded Entity A driver is deactivated in the provider's system: ```json theme={null} { "id": "drv_01D8ZQFGHVJ858NBF2Q7DV9MNC", "status": "inactive", "firstName": "John", "lastName": "Smith", "metadata": { "visibility": "visible" } } ``` The driver is still visible (returned by the API) but marked as inactive. ### Scenario 2: Filtered by Status A connection is configured to only sync active vehicles, but an inactive vehicle exists: ```json theme={null} { "id": "vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC", "status": "inactive", "name": "Truck 42", "metadata": { "visibility": "hidden_by_status" } } ``` > [!NOTE] > > By default, hidden entities are not returned by the API. Use the `hidden=true` > query parameter to include them. ### Scenario 3: Hard-Deleted Entity A vehicle was previously synced but has been permanently removed from the provider: ```json theme={null} { "id": "vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC", "status": "active", "name": "Truck 42", "metadata": { "visibility": "deleted", "deletedAt": "2024-01-15T10:30:00Z" } } ``` Terminal retains the record for historical reference. The `status` reflects the last known state before deletion. > [!NOTE] > > By default, deleted entities are not returned by the API. Use the > `deleted=true` query parameter to include them. ## Related Resources * [Vehicle & Driver Filtering](/guides/vehicle-driver-filtering) - Configure which entities are ingested * [Common Models Overview](/models/overview) - Introduction to Terminal's data models * [Vehicle Model](/models/vehicle) - Full vehicle schema reference * [Driver Model](/models/driver) - Full driver schema reference * [Trailer Model](/models/trailer) - Full trailer schema reference # Fuel Cards Source: https://docs.withterminal.com/guides/fuel-cards Best practices for implementing Terminal in fuel card workflows, from fleet onboarding through fraud prevention and transaction verification. ## Overview This guide covers best practices for integrating Terminal into fuel card workflows. It's organized into key implementation areas that map to the fuel card lifecycle: ### What This Guide Covers This guide walks through the complete fuel card workflow with Terminal. Depending on your use case, some sections may be optional: | Section | Description | When to Use | | - | - | - | | **[Connecting Fleets](#connecting-fleets-with-terminal-link)** | Onboarding fleets and accessing telematics data | All implementations—required for telematics access | | **[Connection Lifecycle](#connection-lifecycle)** | Handling connection events, disconnections, and monitoring | All implementations—critical for maintaining data access | | **[API Usage](#api-usage)** | Entity sync, transaction verification, and polling strategies | All implementations—core integration pattern | | **[IFTA & Reconciliation](#ifta--reconciliation)** | Automating compliance reporting and transaction enrichment | If you handle IFTA reporting or expense reconciliation | | **[Offboarding](#offboarding)** | Archiving connections when accounts close | All implementations—for clean lifecycle management | ### Recommended Implementation Phases We recommend a phased rollout to de-risk your integration and validate data quality before enabling transaction declines: | Phase | Scope | What You're Validating | | - | - | - | | **V0: Logging Only** | Log GPS distance at authorization, no declines | Data quality, coverage gaps, false positive rates | | **V1: Location Verification** | Enable transaction declines based on location | Threshold tuning, operational workflows | | **V2: Fuel Verification** | Add fuel level and tank-capacity checks | Fueling to data presence delay, noise from sloshing | | **V3: Full Feature Set** | Routing, IFTA, analytics | End-to-end value delivery | > [!TIP] > > **Start with V0**: Run in logging-only mode for 2-4 weeks to establish > baseline metrics before enabling declines. This lets you tune distance > thresholds and identify edge cases (e.g., card-not-present transactions, > multi-vehicle fleets) without impacting cardholders. *** ## Connecting Fleets with Terminal Link The first step is obtaining **consent** from the fleet to access their telematics data. Terminal's [Link component](/guides/terminal-link) handles the [consent flow](/guides/link) and authorization with the telematics provider. ### Configuring Terminal Link Use [Terminal Link](/guides/terminal-link) to guide fleets through connecting their telematics provider. For fuel cards, use **Automatic sync mode** from the start—you need continuous data access for fraud prevention. > [accordion] View integration options > > > [tab] Hosted Flow > > > > The hosted flow is a URL you can send directly to fleets via email, SMS, or any messaging channel: > > > > ``` > > https://link.withterminal.com/?sync_mode=automatic&tags=account-1234,program-premium&key={PUBLISHABLE_KEY} > > ``` > > > [tab] React SDK > > > > The React SDK can be embedded in your product or digital onboarding flow: > > > > ```tsx theme={null} > > const terminal = useTerminalLink({ > > publishableKey: process.env.REACT_APP_TERMINAL_PUBLISHABLE_KEY, > > onSuccess: exchangeToken, > > params: { > > syncMode: 'automatic', > > tags: ['account-1234', 'program-premium'], // Your internal identifiers > > }, > > }); > > ``` > > > [tab] JavaScript SDK > > > > The JS SDK can be embedded in your product or digital onboarding flow: > > > > ```ts theme={null} > > TerminalLink.initialize({ > > publishableKey: process.env.TERMINAL_PUBLISHABLE_KEY, > > onSuccess: (result) => exchangePublicToken(result.publicToken), > > params: { > > syncMode: 'automatic', > > tags: ['account-1234', 'program-premium'], // Your internal identifiers > > }, > > }).open(); > > ``` > [!TIP] > > Use `tags` to associate connections with your internal identifiers like > account numbers (`account-1234`), fleet IDs (`fleet-5678`), or program tiers > (`program-premium`). *** ## Connection Lifecycle Managing connection events is critical for fuel card workflows. A disconnected connection means degraded fraud protection—use [webhooks](/guides/webhooks) to automate responses to connection state changes. ### Handling Connection Completion When a fleet successfully connects their telematics provider, Terminal sends a [`connection.completed`](/api-reference/webhook-events/connection-completed) webhook. Use this to: * Enable telematics-backed features for that fleet (Location Verification, routing, etc.) * Update your internal systems with the connection details * Send a confirmation to the fleet > [accordion] View code > > ```ts theme={null} > // Webhook handler for connection.completed > app.post('/webhooks/terminal', async (req, res) => { > const event = req.body; > > if (event.type === 'connection.completed') { > const { connection } = event.detail; > > // Find account number from tags (e.g., 'account-1234') > const accountTag = connection.tags?.find((t) => t.startsWith('account-')); > const accountNumber = accountTag?.replace('account-', ''); > > // Record that fleet has connected telematics > await recordTelematicsConnected({ > accountNumber, > connectionId: connection.id, > provider: connection.provider.name, > connectedAt: event.timestamp, > }); > > // Enable telematics features for this account > await enableTelematicsFeatures({ > accountNumber, > features: ['location_verification', 'fuel_verification'], > }); > > // Notify the fleet > await sendFleetConfirmation({ > email: getFleetEmail(accountNumber), > subject: 'Telematics Connected Successfully', > message: > 'Your telematics data is now connected. Location Verification fraud protection is active.', > }); > } > > res.status(200).send('OK'); > }); > ``` ### Handling Disconnections When a connection becomes disconnected (credentials expire, provider access revoked, etc.), Terminal sends a [`connection.disconnected`](/api-reference/webhook-events/connection-disconnected) webhook. This can result in a **fraud protection gap**—notify the fleet promptly and degrade gracefully. > [accordion] View code > > ```ts theme={null} > if (event.type === 'connection.disconnected') { > const { connection } = event.detail; > > // Find account number from tags > const accountTag = connection.tags?.find((t) => t.startsWith('account-')); > const accountNumber = accountTag?.replace('account-', ''); > > // Flag the account for reduced protection > await updateAccountStatus({ > accountNumber, > telematicsStatus: 'disconnected', > fraudProtectionLevel: 'reduced', // Fall back to static auth rules > }); > > // Send urgent notification to fleet with reconnection link > await notifyFleet({ > email: getFleetEmail(accountNumber), > subject: 'Action Required: Reconnect Your Telematics', > body: 'Your telematics connection has been disconnected. Location Verification fraud protection is temporarily reduced. Please reconnect to restore full protection.', > reconnectUrl: connection.linkUrl, > priority: 'high', > }); > > // Alert your operations team > await alertOpsTeam({ > accountNumber, > reason: 'telematics_disconnected', > impact: 'Fraud protection degraded to static rules', > }); > } > ``` ### Handling Reconnections When a previously disconnected connection is restored, Terminal sends a [`connection.reconnected`](/api-reference/webhook-events/connection-reconnected) webhook. Resume full telematics-backed controls. > [accordion] View code > > ```ts theme={null} > if (event.type === 'connection.reconnected') { > const { connection } = event.detail; > > // Find account number from tags > const accountTag = connection.tags?.find((t) => t.startsWith('account-')); > const accountNumber = accountTag?.replace('account-', ''); > > // Restore full protection > await updateAccountStatus({ > accountNumber, > telematicsStatus: 'connected', > fraudProtectionLevel: 'full', > }); > > // Confirm to the fleet > await notifyFleet({ > email: getFleetEmail(accountNumber), > subject: 'Telematics Reconnected', > body: 'Your telematics connection has been restored. Location Verification fraud protection is fully active.', > }); > } > ``` ### Key Webhook Events for Fuel Cards | Event | Trigger | Recommended Action | | - | - | - | | `connection.completed` | Fleet completes telematics connection | Enable Location Verification and verification features | | `connection.disconnected` | Connection credentials become invalid | Degrade to static auth, notify fleet | | `connection.reconnected` | Previously disconnected connection restored | Restore full telematics features | See the [Webhooks Guide](/guides/webhooks) for setup instructions and the [Webhook Events Reference](/api-reference/webhook-events/overview) for detailed payload schemas. *** ## API Usage For fuel card implementations, you'll use [Terminal's API](/api-reference) for two key workflows: **syncing fleet entities** (vehicles, drivers, trailers) and **real-time location verification** for fraud prevention. ### Entity Sync: Vehicles, Drivers, Trailers When a fleet connects their telematics, sync their roster to auto-populate your card management system. This eliminates manual data entry and keeps your system in sync with the fleet's actual assets. Start with [`GET /vehicles`](/api-reference/vehicles/list-vehicles), [`GET /drivers`](/api-reference/drivers/list-drivers), and [`GET /trailers`](/api-reference/trailers/list-trailers). > [accordion] View entity sync code > > ```ts theme={null} > async function syncFleetRoster(connectionToken: string) { > // Get vehicles from Terminal > const vehiclesResponse = await fetch( > 'https://api.withterminal.com/tsp/v1/vehicles', > { > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connectionToken, > }, > }, > ); > > const vehicles = await vehiclesResponse.json(); > > // Auto-populate your card management system > for (const vehicle of vehicles.results) { > await createOrUpdateVehicleRecord({ > vin: vehicle.vin, > name: vehicle.name, > licensePlate: vehicle.licensePlate, > fuelType: vehicle.fuelType, > tankCapacityLiters: vehicle.fuelTankCapacity, > telematicsId: vehicle.id, > }); > } > > // Repeat for /drivers and /trailers endpoints > return { > vehiclesImported: vehicles.results.length, > }; > } > ``` **Keeping entities in sync with webhooks:** Subscribe to [entity webhooks](/guides/webhooks) to stay in sync as the fleet's roster changes: > [accordion] View webhook handler > > ```ts theme={null} > // Webhook handler for entity changes > app.post('/webhooks/terminal', async (req, res) => { > const event = req.body; > > if (event.type === 'vehicle.added') { > const { vehicle, connection } = event.detail; > await createOrUpdateVehicleRecord({ > vin: vehicle.vin, > name: vehicle.name, > fuelType: vehicle.fuelType, > tankCapacityLiters: vehicle.fuelTankCapacity, > telematicsId: vehicle.id, > }); > } > > if (event.type === 'vehicle.removed') { > const { vehicle } = event.detail; > await flagVehicleAsRemoved(vehicle.id); > } > > if (event.type === 'driver.added') { > const { driver } = event.detail; > await createOrUpdateDriverRecord({ > firstName: driver.firstName, > lastName: driver.lastName, > licenseNumber: driver.licenseNumber, > telematicsId: driver.id, > }); > } > > if (event.type === 'driver.removed') { > const { driver } = event.detail; > await flagDriverAsRemoved(driver.id); > } > > res.status(200).send('OK'); > }); > ``` ### Transaction Verification: Location & Fuel For card authorization, we recommend the fuel card provider **poll Terminal on a schedule** and maintain a traceable copy of vehicle state (location snapshots, tank capacity, timestamps, provider metadata) in your own datastore. Then at swipe time, evaluate **Location Verification** and **fuel verification** (capacity checks) from your local data, while using Terminal API reads only as fallback/refresh paths (see [Managed Polling](/guides/managed-polling) and [real-time data](/guides/real-time-data)). **Recommended authorization flow:** ```mermaid theme={null} sequenceDiagram participant Card as Card Network participant Issuer as Fuel Card Provider participant Terminal as Terminal API participant Provider as Telematics Provider Issuer->>Terminal: Poll /vehicles/locations Terminal->>Provider: Fetch location & fuel data Provider-->>Terminal: Response payloads Terminal-->>Issuer: Normalized response payloads Issuer->>Issuer: Store location & fuel data Card->>Issuer: Authorization request (merchant location) Issuer->>Issuer: Perform Location Verification Issuer->>Issuer: Perform Fuel Verification alt All checks pass Issuer-->>Card: Approve else Any check fails Issuer-->>Card: Decline end ``` **Key endpoints:** | Endpoint | Use Case | Latency | | - | - | - | | [`GET /vehicles/locations`](/api-reference/vehicles/list-latest-vehicle-locations) | Current GPS position for Location Verification | Real-time | | [`GET /vehicles/{id}`](/api-reference/vehicles/get-vehicle) | Tank capacity for fuel verification | Cached | | [`GET /ifta/summary`](/api-reference/ifta/get-iftasummary) | Distance per jurisdiction for IFTA (km) | Aggregated | #### Fuel Verification Implementation Verify that the requested fuel amount doesn't exceed the vehicle's physical capacity. > [accordion] View fuel verification implementation > > ```ts theme={null} > async function verifyFuelCapacity( > vehicleId: string, > connectionToken: string, > requestedGallons: number, > ): Promise<{ > approved: boolean; > maxGallons: number; > reason?: string; > }> { > // Get current vehicle location (includes fuel percentage) > const locationResponse = await fetch( > `https://api.withterminal.com/tsp/v1/vehicles/locations?vehicleIds=${vehicleId}`, > { > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connectionToken, > }, > }, > ); > > const locationData = await locationResponse.json(); > const currentLocation = locationData.results[0]; > > // Get vehicle details for tank capacity > const vehicleResponse = await fetch( > `https://api.withterminal.com/tsp/v1/vehicles/${vehicleId}`, > { > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connectionToken, > }, > }, > ); > > const vehicle = await vehicleResponse.json(); > > if (!vehicle.fuelTankCapacity) { > // Tank capacity unknown—approve but flag for review > return { > approved: true, > maxGallons: requestedGallons, > reason: 'Tank capacity unknown—approved with flag', > }; > } > > // Convert liters to gallons (Terminal uses liters) > const tankCapacityGallons = vehicle.fuelTankCapacity * 0.264172; > const currentFuelPercent = currentLocation?.fuel || 0; > const currentFuelGallons = tankCapacityGallons * (currentFuelPercent / 100); > const maxFillableGallons = tankCapacityGallons - currentFuelGallons; > > // Add 10% buffer for measurement variance > const maxWithBuffer = maxFillableGallons * 1.1; > > if (requestedGallons > maxWithBuffer) { > return { > approved: false, > maxGallons: maxFillableGallons, > reason: `Requested ${requestedGallons.toFixed(1)} gal exceeds capacity (max: ${maxFillableGallons.toFixed(1)} gal)`, > }; > } > > return { > approved: true, > maxGallons: maxFillableGallons, > }; > } > ``` ### Polling Strategy for Location Verification The [`/vehicles/locations`](/api-reference/vehicles/list-latest-vehicle-locations) endpoint is **real-time**—each request triggers a synchronous call to the telematics provider. You have two approaches: | Approach | Best For | Trade-offs | | - | - | - | | **On-demand** | Location Verification checks at swipe time | Highest freshness, but 1-3s latency | | **Managed Polling** | High-volume authorization workflows | Sub-100ms latency, but data may be 15-60s old | #### On-Demand Calls Fetch data directly from the telematics provider at request time. Best when latency of 1-3 seconds is acceptable and you want maximum data freshness. #### Managed Polling For sub-second response times, enable [Managed Polling](/guides/managed-polling) in your Terminal dashboard. Terminal proactively caches location data at your configured interval (e.g., every 15 seconds). | Latency Target | Recommended Approach | Trade-off | | - | - | - | | Less than 800ms | Managed Polling (15s) | Location may be 15s old | | 1-3s acceptable | On-Demand | Freshest data, higher latency | > [!NOTE] > > **For sub-second Location Verification**: Most production implementations use > managed polling with a 15-30 second interval. A vehicle's location rarely > changes significantly in 15 seconds, making this acceptable for fraud > prevention while achieving sub-500ms authorization response times. > [!TIP] > > **Production recommendation**: Start with on-demand calls during pilot to > validate data quality, then switch to managed polling when you need sub-second > latency for production authorization flows. *** ## IFTA & Reconciliation After transactions occur, use Terminal data to automate IFTA compliance and enrich transactions for reconciliation. ### IFTA Automation The [`/ifta/summary`](/api-reference/ifta/get-iftasummary) endpoint returns distance driven per jurisdiction by vehicle and month, the key input for IFTA reporting. * `distance` is in kilometers. Convert to miles if your IFTA return needs them. * `jurisdiction` is `null` for distance outside the US and Canada, such as Mexico, or when the provider reports no recognizable jurisdiction. * The default `groupBy` (`vehicle,jurisdiction`) sums distance across every month in the range. Pass `groupBy=vehicle,jurisdiction,month` to get one row per month. > [accordion] View IFTA query > > ```ts theme={null} > async function getIFTASummary( > connectionToken: string, > startMonth: string, // 'YYYY-MM' > endMonth: string, > ): Promise { > const response = await fetch( > `https://api.withterminal.com/tsp/v1/ifta/summary?` + > `startMonth=${startMonth}&endMonth=${endMonth}&groupBy=vehicle,jurisdiction,month`, > { > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connectionToken, > }, > }, > ); > > const data = await response.json(); > return data.results; > } > > // Example response: > // [ > // { vehicle: 'vcl_123', jurisdiction: 'TX', distance: 1234.5, month: '2024-01' }, > // { vehicle: 'vcl_123', jurisdiction: 'OK', distance: 567.8, month: '2024-01' }, > // { vehicle: 'vcl_456', jurisdiction: 'TX', distance: 890.1, month: '2024-01' }, > // ] > ``` ### Dashboard Access The Terminal dashboard provides a visual interface for investigating transactions and verifying vehicle activity without writing code. Fraud and operations teams can: * **View vehicle history**: See trips, GPS breadcrumbs, and routes on an interactive map with timeline filtering * **Verify transaction locations**: Check where a vehicle was at a specific time to validate or investigate fuel purchases * **Browse live locations**: See current fleet positions for real-time verification * **Filter by date and vehicle**: Narrow down to specific vehicles and time ranges around suspicious transactions * **Export data**: Download trip and vehicle data as CSV for analysis or dispute resolution This is particularly useful for fraud investigation teams who need to quickly verify whether a vehicle was actually at a fuel station when a transaction occurred. *** ## Offboarding When a fleet churns or a contract ends, archive the connection to stop data syncing and clean up resources. ### Archiving Connections Mark a connection as archived when it's no longer needed using [`PATCH /connections/current`](/api-reference/connections/update-current-connection): > [accordion] View code > > ```bash theme={null} > curl --request PATCH \ > --url https://api.withterminal.com/tsp/v1/connections/current \ > --header 'Authorization: Bearer {SECRET_KEY}' \ > --header 'Connection-Token: {CONNECTION_TOKEN}' \ > --header 'Content-Type: application/json' \ > --data '{ > "status": "archived" > }' > ``` **Example: Account Closure Workflow** > [accordion] View code > > ```ts theme={null} > async function handleAccountClosed(accountNumber: string) { > // Find the connection by account tag > const connections = await fetch( > `https://api.withterminal.com/tsp/v1/connections?tag=account-${accountNumber}`, > { headers: { Authorization: `Bearer ${SECRET_KEY}` } }, > ); > > const data = await connections.json(); > const connection = data.results?.[0]; > > if (connection) { > // Archive the connection > await fetch('https://api.withterminal.com/tsp/v1/connections/current', { > method: 'PATCH', > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connection.token, > 'Content-Type': 'application/json', > }, > body: JSON.stringify({ > status: 'archived', > }), > }); > > // Record the archival in your system > await recordConnectionArchived({ > accountNumber, > connectionId: connection.id, > reason: 'account_closed', > archivedAt: new Date().toISOString(), > }); > > // Disable telematics features > await disableTelematicsFeatures({ > accountNumber, > features: ['gps_lock', 'fuel_verification'], > }); > } > } > ``` > [!TIP] > > Archiving a connection stops all data syncing and deliveries. Historical data > remains in your systems for audits, disputes, and analytics. *** ## Complete Webhook Reference Here's a summary of all webhook events relevant to fuel card workflows: | Event | Trigger | Recommended Action | | - | - | - | | `connection.completed` | Fleet completes telematics connection | Enable Location Verification and verification; sync fleet roster | | `connection.disconnected` | Connection credentials become invalid | Degrade fraud protection, notify fleet | | `connection.reconnected` | Previously disconnected connection restored | Restore full telematics features | | `vehicle.added` | New vehicle detected in fleet | Auto-add to card system, update mappings | | `vehicle.removed` | Vehicle removed from fleet | Flag/remove from card system | | `vehicle.modified` | Vehicle details changed | Update tank capacity, VIN records | | `driver.added` | New driver detected in fleet | Auto-add to card system | | `driver.removed` | Driver removed from fleet | Flag/deactivate driver cards | For event payload details, see the [Webhook Events Reference](/api-reference/webhook-events/overview). *** ## Full Sequence Diagram ```mermaid theme={null} %%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#e5e7eb', 'primaryTextColor':'#111827', 'primaryBorderColor':'#9ca3af', 'lineColor':'#6b7280', 'secondaryColor':'#f3f4f6', 'tertiaryColor':'#f9fafb'}}}%% sequenceDiagram participant Fleet participant Issuer as Fuel Card Provider participant Terminal participant CardNetwork as Card Network Note over Fleet,CardNetwork: Fleet Onboarding Issuer->>Fleet: Send Terminal Link URL Fleet->>Terminal: Connect telematics account Terminal->>Issuer: Webhook: connection.completed Issuer->>Terminal: GET /vehicles, /drivers, /trailers Terminal-->>Issuer: Fleet roster Issuer->>Issuer: Auto-populate card system Issuer->>Fleet: Confirm telematics active Note over Fleet,CardNetwork: Entity Sync loop Ongoing Terminal->>Issuer: Webhook: vehicle.added / driver.added Issuer->>Issuer: Update card system records end Note over Fleet,CardNetwork: Transaction: Location Verification & Fuel Verification loop Scheduled polling Issuer->>Terminal: Poll /vehicles/locations + /vehicles/{id} Terminal-->>Issuer: Latest location + tank data Issuer->>Issuer: Upsert local trace (data + timestamps) end Fleet->>CardNetwork: Swipe card at station CardNetwork->>Issuer: Authorization request Issuer->>Issuer: Read latest local vehicle snapshot Issuer->>Issuer: Perform Location Verification Issuer->>Issuer: Perform Fuel Verification opt Snapshot stale or missing Issuer->>Terminal: Refresh via Terminal API Terminal-->>Issuer: Latest vehicle data Issuer->>Issuer: Update local trace end alt All checks pass Issuer-->>CardNetwork: Approve CardNetwork-->>Fleet: Transaction approved else Any check fails Issuer-->>CardNetwork: Decline CardNetwork-->>Fleet: Transaction declined end Note over Fleet,CardNetwork: IFTA Reconciliation Issuer->>Terminal: GET /ifta/summary (monthly) Terminal-->>Issuer: Distance per jurisdiction (km) Issuer->>Issuer: Combine with fuel purchases Issuer->>Fleet: IFTA-ready reports Note over Fleet,CardNetwork: Disconnection Handling Terminal->>Issuer: Webhook: connection.disconnected Issuer->>Issuer: Degrade to static auth rules Issuer->>Fleet: Send reconnection notification Fleet->>Terminal: Reconnect via Link Terminal->>Issuer: Webhook: connection.reconnected Issuer->>Issuer: Restore full Location Verification Note over Fleet,CardNetwork: Offboarding Issuer->>Terminal: Archive connection Issuer->>Issuer: Disable telematics features ``` *** ## Next Steps * [Set up webhooks](/guides/webhooks) for event-driven automation * [Learn how to sync via the API](/guides/syncing-via-the-api) for pull-based patterns * [Compare replication options](/guides/data-replication) (API, S3, Kafka) * [Explore the API reference](/api-reference/authentication) to query telematics data * [Review custom identifiers](/guides/custom-identifiers) for connection organization * [Understand real-time data](/guides/real-time-data) for Location Verification implementation # Insurance Source: https://docs.withterminal.com/guides/insurance Best practices for implementing Terminal in auto insurance workflows, from quoting through policy binding. ## Overview This guide covers best practices for integrating Terminal into commercial auto insurance workflows. It's organized into key implementation areas that map to the insurance policy lifecycle: ### What This Guide Covers This guide walks through the complete insurance workflow with Terminal. Depending on your use case, some sections may be optional: | Section | Description | When to Use | | - | - | - | | **[Pre-Bind / Underwriting](#pre-bind--underwriting)** | Connecting fleets and accessing historical data for risk assessment | If you're evaluating telematics data before binding policies | | **[Connection Lifecycle](#connection-lifecycle)** | Handling connection events, disconnections, and compliance monitoring | All implementations—critical for maintaining data access | | **[Policy Binding Transition](#policy-binding-transition)** | Switching from manual to automatic sync when a policy is bound | If you start with underwriting and transition to ongoing monitoring | | **[Data Ingestion](#data-ingestion)** | S3 delivery and API options for getting data into your systems | All implementations—choose based on volume and architecture | | **[First Notice of Loss & Claims](#first-notice-of-loss--claims-investigation)** | Accessing crash reports, camera footage, and safety events for claims | If you handle claims investigation or FNOL workflows | | **[Offboarding](#offboarding)** | Archiving connections when quotes are rejected or policies cancelled | All implementations—for clean lifecycle management | ## Pre-Bind / Underwriting The first step in processing telematics data for underwriting is obtaining **consent** from the fleet. Terminal's Link component handles the consent flow and authorization with the telematics provider. ### Connecting Fleets with Terminal Link Use [Terminal Link](/guides/terminal-link) to guide fleets through connecting their telematics provider. During underwriting, use **Manual sync mode** to control costs—you only sync data when needed for risk assessment. > [accordion] View implementation options > > > [tab] Hosted Flow > > > > The hosted flow is a URL you can send directly to fleets via email, SMS, or any messaging channel: > > > > ``` > > https://link.withterminal.com/?sync_mode=manual&backfill_days=90&tags=app-7689&key={PUBLISHABLE_KEY} > > ``` > > > [tab] React SDK > > > > The React SDK can be embedded in your digital onboarding flow if you have one and use React. > > > > ```tsx theme={null} > > const terminal = useTerminalLink({ > > publishableKey: process.env.REACT_APP_TERMINAL_PUBLISHABLE_KEY, > > onSuccess: exchangeToken, > > params: { > > syncMode: 'manual', > > backfill: { days: 90 }, // Your backfill period > > tags: ['app-7689'], // Your application/submission number > > }, > > }); > > ``` > > > [tab] JavaScript SDK > > > > The JavaScript SDK can be embedded in your digital onboarding flow if you have one. > > > > ```ts theme={null} > > TerminalLink.initialize({ > > publishableKey: process.env.TERMINAL_PUBLISHABLE_KEY, > > onSuccess: (result) => exchangePublicToken(result.publicToken), > > params: { > > syncMode: 'manual', > > backfill: { days: 90 }, // Your backfill period > > tags: ['app-7689'], // Your application/submission number > > }, > > }).open(); > > ``` > [!TIP] > > Use `tags` to associate connections with your internal identifiers like > application numbers (`app-7689`) or policy numbers (`policy-1234`). ### Configuring historical data for Underwriting To assess risk, you'll typically need historical telematics data. The **backfill period** determines how much historical data Terminal retrieves from the provider. You can configure backfill in two ways: 1. **Per-link**: Set `backfill_days` or `backfill.days` when creating the connection (shown above) 2. **Application-level default**: Configure a default backfill period in your Terminal dashboard settings > [!NOTE] > > Historical data availability varies by provider. See the [Provider > Explorer](/providers/explorer) for details on history available for backfill. For details on how to access backfilled data once the connection is established, see the [Data Ingestion](#data-ingestion) section below. ## Connection Lifecycle Managing connection events is critical for insurance workflows. Use webhooks to automate responses to connection state changes. ### Handling Connection Completion When a fleet successfully connects their telematics provider, Terminal sends a `connection.completed` webhook. Use this to: * Record that the fleet has connected telematics for the quote * Update your internal systems with the connection details * Send a confirmation to the fleet > [accordion] View code > > ```ts theme={null} > // Webhook handler for connection.completed > app.post('/webhooks/terminal', async (req, res) => { > const event = req.body; > > if (event.type === 'connection.completed') { > const { connection } = event.detail; > > // Find application number from tags (e.g., 'app-7689') > const appTag = connection.tags?.find((t) => t.startsWith('app-')); > const applicationNumber = appTag?.replace('app-', ''); > > // Record that fleet has connected telematics > await recordTelematicsConnected({ > applicationNumber, > connectionId: connection.id, > provider: connection.provider.name, > connectedAt: event.timestamp, > }); > > // Notify your team or the fleet > await notifyQuoteTeam({ > applicationNumber, > message: 'Fleet has connected telematics - ready for underwriting', > }); > > // Optionally send confirmation to the fleet > await sendFleetConfirmation({ > email: getFleetEmail(applicationNumber), > subject: 'Telematics Connected Successfully', > message: > 'Your telematics data is now connected for your insurance quote.', > }); > } > > res.status(200).send('OK'); > }); > ``` ### Handling Disconnections When a connection becomes disconnected (credentials expire, provider access revoked, etc.), Terminal sends a `connection.disconnected` webhook. For active policies, this creates a compliance gap—notify the fleet promptly to reconnect. > [accordion] View code > > ```ts theme={null} > if (event.type === 'connection.disconnected') { > const { connection } = event.detail; > > // Check if this is an active policy (automatic sync = post-bind) > if (connection.syncMode === 'automatic') { > // Find policy number from tags (e.g., 'policy-1234') > const policyTag = connection.tags?.find((t) => t.startsWith('policy-')); > const policyNumber = policyTag?.replace('policy-', ''); > > // Send urgent notification to insured with reconnection link > await notifyInsured({ > email: getInsuredEmail(policyNumber), > subject: 'Action Required: Reconnect Your Telematics', > body: 'Your telematics connection has been disconnected. Please reconnect to stay compliant with your policy.', > reconnectUrl: connection.linkUrl, > priority: 'high', > }); > > // Flag the policy for compliance review > await flagPolicyForReview({ > policyNumber, > reason: 'telematics_disconnected', > }); > } > } > ``` ### Key Webhook Events for Insurance | Event | Trigger | Recommended Action | | - | - | - | | `connection.completed` | Fleet completes telematics connection | Record connection, notify team/fleet | | `connection.disconnected` | Connection credentials become invalid | Notify insured to reconnect for compliance | | `connection.reconnected` | Previously disconnected connection restored | Resume monitoring, clear compliance flags | See the [Webhooks Guide](/guides/webhooks) for setup instructions and the [Webhook Events Reference](/api-reference/webhook-events/overview) for detailed payload schemas. *** ## Policy Binding Transition When a quote is accepted and the policy is bound, transition the connection from **Manual** to **Automatic** sync mode. This enables continuous data synchronization for ongoing risk monitoring and claims support. > [accordion] View code > > ```bash theme={null} > curl --request PATCH \ > --url https://api.withterminal.com/tsp/v1/connections/current \ > --header 'Authorization: Bearer {SECRET_KEY}' \ > --header 'Connection-Token: {CONNECTION_TOKEN}' \ > --header 'Content-Type: application/json' \ > --data '{ > "syncMode": "automatic", > "tags": ["policy-1234"] > }' > ``` This API call: 1. Switches sync mode from manual to automatic for continuous data updates 2. Adds a policy tag to the connection for future reference (the application tag remains) **Example: Policy Binding Workflow** > [accordion] View code > > ```ts theme={null} > async function bindPolicy(applicationNumber: string, policyNumber: string) { > // Find the connection by application tag > const connections = await fetch( > `https://api.withterminal.com/tsp/v1/connections?tag=app-${applicationNumber}`, > { headers: { Authorization: `Bearer ${SECRET_KEY}` } }, > ); > > const connection = connections.data[0]; > > // Transition connection for post-bind monitoring > await fetch('https://api.withterminal.com/tsp/v1/connections/current', { > method: 'PATCH', > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connection.token, > 'Content-Type': 'application/json', > }, > body: JSON.stringify({ > syncMode: 'automatic', > tags: [...connection.tags, `policy-${policyNumber}`], // Add policy tag > }), > }); > > // Record the transition in your system > await recordPolicyBound({ > applicationNumber, > policyNumber, > connectionId: connection.id, > boundAt: new Date().toISOString(), > }); > } > ``` ### Post-Bind Monitoring With automatic sync enabled, Terminal continuously updates connection data. Use this for: **Ongoing Risk Monitoring** * Monitor safety events for policy risk assessment * Track driver behavior trends over the policy period * Identify high-risk vehicles or drivers **Claims Support** * Access historical vehicle locations for incident verification * Review driver HOS logs around claim dates * Retrieve safety event footage via camera media endpoints *** ## Data Ingestion Terminal provides two methods for ingesting telematics data into your systems. Both support initial backfills (historical data after connection) and incremental updates (ongoing data). ### Option 1: Data Delivery (Recommended for Insurance) For insurance use cases, we recommend using [S3 Data Delivery](/guides/aws-s3-destination). This approach: * **Simplifies pipeline architecture**: Data arrives in your S3 bucket automatically * **Handles scale efficiently**: Batch deliveries are more efficient than individual API calls * **Provides complete data ownership**: All data is stored in your AWS account * **Supports both backfills and incremental updates**: Automatic triggers for both scenarios #### How Data Delivery Works **Initial Backfill**: When a connection completes its first sync, Terminal automatically triggers a delivery of all historical data (based on your configured backfill period) to your S3 bucket. **Incremental Updates**: On your configured schedule (hourly, daily, etc.), Terminal delivers all new and updated data across your connections. #### Handling Delivery Events Listen for delivery webhooks to trigger your data processing pipeline: > [accordion] View code > > ```ts theme={null} > if (event.type === 'delivery.completed') { > const { delivery, destination } = event.detail; > > // Trigger ETL pipeline to process new S3 objects > await triggerETLPipeline({ > deliveryId: delivery.id, > connectionIds: delivery.connectionIds, > destinationId: destination.id, > // Data is already in your S3 bucket > }); > } > ``` > [!TIP] > > Configure your S3 destination with daily scheduled deliveries for post-bind > monitoring. The initial backfill happens automatically when connections > complete their first sync. ### Option 2: API For more control over data access or lower-volume use cases, query the API directly. The API approach gives you flexibility to fetch exactly the data you need, when you need it. **Backfill Data**: After a connection completes its first sync, query endpoints like `/vehicles`, `/safety/events`, and `/trips` with date filters to retrieve historical data for underwriting risk assessment. **Incremental Updates**: For ongoing monitoring, use the `modifiedAfter` query parameter to fetch only new or updated records since your last sync. This is efficient for keeping your systems in sync without re-fetching all data. For complete implementation details, code examples, and best practices for API-based data syncing, see [Syncing via the API](/guides/syncing-via-the-api). ## First Notice of Loss & Claims Investigation When a claim is filed, Terminal provides access to critical data for First Notice of Loss (FNOL) and claims investigation workflows. This includes crash detection, camera footage, and detailed safety event data. ### Safety Events & Crash Reports Terminal's [Safety Events](/models/safety-event) capture incidents detected by telematics devices, including harsh braking, collisions, speeding, and other driver behavior events. These events are invaluable for claims investigation. For a deeper dive on crash detection capabilities and provider support, see [Crash Reports](/guides/crash-reports). **Key capabilities:** * **Crash detection**: Many telematics providers detect collisions and report them as safety events with severity indicators * **Event details**: Access timestamp, location, speed, and g-force data for each event * **Driver context**: Link events to specific drivers and vehicles **Accessing safety events via API:** > [accordion] View code > > ```ts theme={null} > // Get safety events for a specific vehicle around a claim date > const claimDate = '2024-03-15'; > const startDate = new Date(claimDate); > startDate.setDate(startDate.getDate() - 1); // Day before > const endDate = new Date(claimDate); > endDate.setDate(endDate.getDate() + 1); // Day after > > const safetyEvents = await fetch( > `https://api.withterminal.com/tsp/v1/safety/events?vehicleIds=${vehicleId}&startedAfter=${startDate.toISOString()}&startedBefore=${endDate.toISOString()}`, > { > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connectionToken, > }, > }, > ); > > // Filter for crash events > const crashEvents = safetyEvents.data.filter((event) => > ['crash', 'near_crash'].includes(event.type), > ); > ``` ### Camera Media For connections with camera-equipped telematics devices, Terminal provides access to video footage and images captured during safety events. This is critical for accident reconstruction and liability determination. **Key capabilities:** * **Event footage**: Video clips captured before, during, and after safety events * **Multiple camera views**: Access road-facing, driver-facing, and cabin camera footage when available * **Timestamp correlation**: Camera media is linked to specific safety events for easy retrieval **Accessing camera media via API:** > [accordion] View code > > ```ts theme={null} > // Get camera media for a specific safety event > const cameraMedia = await fetch( > `https://api.withterminal.com/tsp/v1/safety/events/${safetyEventId}/camera-media`, > { > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connectionToken, > }, > }, > ); > > // Access media URLs for review > const media = await cameraMedia.json(); > > if (media.frontFacing?.videoUrl) { > console.log(`Front-facing camera: ${media.frontFacing.videoUrl}`); > } > > if (media.rearFacing?.videoUrl) { > console.log(`Rear-facing camera: ${media.rearFacing.videoUrl}`); > } > ``` > [!NOTE] > > Camera media availability depends on the telematics provider and device > capabilities. See [Camera Media](/models/camera-media) for details on the data > model. ### Safety Event Webhooks Subscribe to `safety_event.added` webhooks to receive real-time notifications when new safety events are recorded. This enables proactive claims handling—you can be notified of potential incidents before a claim is even filed. > [accordion] View code > > ```ts theme={null} > // Webhook handler for safety_event.added > if (event.type === 'safety_event.added') { > const { safetyEvent, connection } = event.detail; > > // Check if this is a severe event that may indicate a claim > const severeTypes = ['crash', 'near_crash']; > const isSevere = severeTypes.includes(safetyEvent.type); > > if (isSevere) { > // Find policy number from tags > const policyTag = connection.tags?.find((t) => t.startsWith('policy-')); > const policyNumber = policyTag?.replace('policy-', ''); > > // Alert claims team of potential incident > await alertClaimsTeam({ > policyNumber, > eventType: safetyEvent.type, > timestamp: safetyEvent.startedAt, > vehicle: safetyEvent.vehicle, > location: safetyEvent.startLocation, > severity: 'high', > }); > } > } > ``` ### Dashboard Access The Terminal dashboard provides a visual interface for reviewing safety events and camera media without writing code. Claims adjusters can: * **Browse safety events**: Filter by date, vehicle, driver, or event type * **Watch camera footage**: Play back video clips directly in the browser * **Export data**: Download event details and media for claims files * **View event locations**: See where incidents occurred on a map This is particularly useful for claims teams who need quick access to telematics data without API integration. *** ## Offboarding When a quote is rejected or an account is cancelled, archive the connection to stop data syncing and clean up resources. ### Archiving Connections Mark a connection as archived when it's no longer needed: > [accordion] View code > > ```bash theme={null} > curl --request PATCH \ > --url https://api.withterminal.com/tsp/v1/connections/current \ > --header 'Authorization: Bearer {SECRET_KEY}' \ > --header 'Connection-Token: {CONNECTION_TOKEN}' \ > --header 'Content-Type: application/json' \ > --data '{ > "status": "archived" > }' > ``` **Example: Quote Rejection Workflow** > [accordion] View code > > ```ts theme={null} > async function handleQuoteRejected(applicationNumber: string) { > // Find the connection by application tag > const connections = await fetch( > `https://api.withterminal.com/tsp/v1/connections?tag=app-${applicationNumber}`, > { headers: { Authorization: `Bearer ${SECRET_KEY}` } }, > ); > > const connection = connections.data[0]; > > if (connection) { > // Archive the connection > await fetch('https://api.withterminal.com/tsp/v1/connections/current', { > method: 'PATCH', > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connection.token, > 'Content-Type': 'application/json', > }, > body: JSON.stringify({ > status: 'archived', > }), > }); > > // Record the archival in your system > await recordConnectionArchived({ > applicationNumber, > connectionId: connection.id, > reason: 'quote_rejected', > archivedAt: new Date().toISOString(), > }); > } > } > ``` **Example: Policy Cancellation Workflow** > [accordion] View code > > ```ts theme={null} > async function handlePolicyCancelled(policyNumber: string) { > // Find the connection by policy tag > const connections = await fetch( > `https://api.withterminal.com/tsp/v1/connections?tag=policy-${policyNumber}`, > { headers: { Authorization: `Bearer ${SECRET_KEY}` } }, > ); > > const connection = connections.data[0]; > > if (connection) { > // Archive the connection > await fetch('https://api.withterminal.com/tsp/v1/connections/current', { > method: 'PATCH', > headers: { > Authorization: `Bearer ${SECRET_KEY}`, > 'Connection-Token': connection.token, > 'Content-Type': 'application/json', > }, > body: JSON.stringify({ > status: 'archived', > }), > }); > > // Record the archival in your system > await recordConnectionArchived({ > policyNumber, > connectionId: connection.id, > reason: 'policy_cancelled', > archivedAt: new Date().toISOString(), > }); > } > } > ``` > [!TIP] > > Archiving a connection stops all data syncing and deliveries. The historical > data remains available in your systems for reference but no new data will be > collected. *** ## Complete Webhook Reference Here's a summary of all webhook events relevant to insurance workflows: | Event | Trigger | Recommended Action | | - | - | - | | `connection.completed` | Fleet completes telematics connection | Record connection, notify team/fleet | | `connection.disconnected` | Connection credentials become invalid | Notify insured with reconnection link | | `connection.reconnected` | Previously disconnected connection restored | Resume data monitoring | | `sync.completed` | Data sync finishes successfully | Trigger data ingestion (API approach) | | `sync.failed` | Data sync encounters an error | Alert operations team | | `delivery.completed` | S3 data delivery completes | Trigger ETL pipeline | | `delivery.failed` | S3 delivery fails | Alert operations team | | `vehicle.added` | New vehicle detected in fleet | Update or compare to policy | | `vehicle.removed` | Vehicle removed from fleet | Update or compare to policy | | `driver.added` | New driver detected in fleet | Update or compare to policy | | `driver.removed` | Driver removed from fleet | Update or compare to policy | | `safety_event.added` | New safety event recorded | Update risk assessment | *** ## Full Sequence Diagram ```mermaid theme={null} %%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#e5e7eb', 'primaryTextColor':'#111827', 'primaryBorderColor':'#9ca3af', 'lineColor':'#6b7280', 'secondaryColor':'#f3f4f6', 'tertiaryColor':'#f9fafb'}}}%% sequenceDiagram participant Fleet participant Insurer participant Terminal Note over Fleet,Terminal: Pre-Bind / Underwriting Insurer->>Fleet: Send Consent Flow link Fleet->>Terminal: Connect telematics account via Consent Flow Terminal->>Insurer: Webhook: connection.completed Insurer->>Fleet: Notify fleet of successful connection Terminal->>Terminal: Sync historical data for backfill period Terminal->>Insurer: Deliver historical data Terminal->>Insurer: Webhook: delivery.completed Insurer->>Insurer: Ingest and process data for underwriting Insurer->>Fleet: Provide quote Note over Fleet,Terminal: Policy Binding Fleet->>Insurer: Accept quote Insurer->>Terminal: Update syncMode to automatic, add policy tag Note over Fleet,Terminal: Post-Bind Monitoring loop Continuous Monitoring Terminal->>Terminal: Incrementally ingest telematics data Terminal->>Insurer: Deliver incremental data Terminal->>Insurer: Webhook: delivery.completed Insurer->>Insurer: Ingest data for risk monitoring end Note over Fleet,Terminal: Claims / FNOL Terminal->>Insurer: Webhook: safety_event.added (collision detected) Insurer->>Insurer: Alert claims team, access camera media Insurer->>Terminal: Query safety events and media for investigation Note over Fleet,Terminal: Disconnection Handling Terminal->>Insurer: Webhook: connection.disconnected Insurer->>Fleet: Send reconnection notification (compliance) Fleet->>Terminal: Reconnect via Consent Flow Terminal->>Insurer: Webhook: connection.reconnected Terminal->>Terminal: Incrementally ingest telematics data Note over Fleet,Terminal: Offboarding alt Quote Rejected Insurer->>Terminal: Archive connection (status: archived) else Policy Cancelled Insurer->>Terminal: Archive connection (status: archived) end ``` *** ## Next Steps * [Set up webhooks](/guides/webhooks) for event-driven automation * [Configure S3 delivery](/guides/aws-s3-destination) for automated data replication * [Learn how to sync via the API](/guides/syncing-via-the-api) for pull-based ingestion patterns * [Compare replication options](/guides/data-replication) (API, S3, Kafka) * [Explore the API reference](/api-reference/authentication) to query telematics data * [Review custom identifiers](/guides/custom-identifiers) for connection organization # Kafka Destination Source: https://docs.withterminal.com/guides/kafka-destination Real-time data replication to your Kafka cluster > [!NOTE] > > Choosing how to get data out of Terminal? See [Data > Replication](/guides/data-replication) for sync vs replication and how Kafka > compares to the [API](/guides/syncing-via-the-api) and > [S3](/guides/aws-s3-destination). ## Overview In addition to our unified API, Terminal can stream normalized data directly to a Kafka cluster you operate. This enables: * Low-latency ingestion into your event-driven systems and stream processors * Routing the same data to your existing Kafka consumers, sinks, and downstream warehouses ## How it Works Terminal ingests data from telematics providers on an ongoing basis and normalizes it into our [Common Models](/models). As records are ingested or updated, Terminal produces them as events to topics on your Kafka cluster. ```mermaid theme={null} %%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#e5e7eb', 'primaryTextColor':'#111827', 'primaryBorderColor':'#9ca3af', 'lineColor':'#6b7280', 'secondaryColor':'#f3f4f6', 'tertiaryColor':'#f9fafb'}}}%% flowchart TB subgraph Terminal["Terminal AWS"] TI["Ingestion Service
(Normalizes TSP data)"] TWD["Data Warehouse"] KD["Kafka Replication Service"] end subgraph Consumer["Consumer Kafka"] Brokers["Kafka Cluster
(your brokers)"] Stream["Stream Processors
(Flink, Kafka Streams, etc.)"] DW["Data Warehouse
(Snowflake, Redshift, etc.)"] Apps["Application Services"] end TI -->|writes| TWD TI -->|stream| KD TWD -->|cdc| KD KD -->|produces records over SASL| Brokers Brokers -->|optional| Stream Brokers -->|optional| DW Brokers -->|optional| Apps ``` Terminal authenticates to your cluster using credentials you provide (see [Authentication](#authentication)) and produces records as soon as they are ingested or updated. ### Delivery model Kafka delivery is a continuous, push-based stream: * **Real-time**: records are produced to your topics shortly after Terminal ingests or updates them, without waiting for a schedule. * **Per-model topics**: you map each Common Model you want delivered to a topic name on your cluster. Terminal produces records for that model only to the configured topic. * **At-least-once**: records can occasionally be redelivered (for example, after retries or recovery). Use the keys described in [Message format](#message-format) to deduplicate downstream if your use case requires exactly-once semantics. * **Backfills**: when you onboard a new connection or request historical data, Terminal will produce existing records to the same topics so your consumers see a consistent stream. Records older than an [event age limit](#excluding-old-events) you set are skipped. ### Message format Each Kafka record contains: * **Value**: an [Avro](https://avro.apache.org/) encoded `MessageWrapper` event. The schema mirrors Terminal's [webhook event](/guides/webhooks) structure so the same downstream code can consume both. * **Key**: a UTF-8 encoded string derived from the configured [partition keys](#partition-keys) for the topic. * **Topic**: the topic name you configured for that model. * **Headers**: `terminal-*` headers that let you identify the record without decoding the value. See [Headers](#headers). The `MessageWrapper` record has the following shape: ```json theme={null} { "eventType": "insert", "model": "VehicleLocation", "detail": { "VehicleLocation": { "id": "vcl_loc_01ARZ3NDEKTSV4RRFFQ69G5FAV", "connectionId": "conn_01ARZ3NDEKTSV4RRFFQ69G5FBV", "vehicleId": "vcl_01ARZ3NDEKTSV4RRFFQ69G5FCV", "...": "..." } } } ``` Top-level fields: * `eventType`: `insert` for a newly ingested record, `modify` for an update to an existing record. * `model`: the [Common Model](/models) name (for example, `Vehicle`, `VehicleLocation`, `Trip`). * `detail`: a record where exactly one field is populated, matching `model`. Each field follows the canonical Common Model schema. In addition to the fields documented in the Common Models, every record includes a `connectionId` field that identifies the source connection. > [accordion] View supported models > > | Model | Reference | > | - | - | > | Vehicle | [View model](/models/vehicle) | > | Driver | [View model](/models/driver) | > | Device | [View model](/models/device) | > | Group | [View model](/models/group) | > | Trailer | [View model](/models/trailer) | > | VehicleLocation | [View model](/models/vehicle-location) | > | VehicleStatLog | [View model](/models/vehicle-stat-log) | > | SafetyEvent | [View model](/models/safety-event) | > | FaultCodeEvent | [View model](/models/fault-code-event) | > | Trip | [View model](/models/trip) | > | HOSDailyLog | [View model](/models/hosdaily-log) | > | HOSLog | [View model](/models/hoslog) | > | IFTAVehicleMonth | [View model](/models/iftavehicle-month) | > | VehicleUtilizationDay | [View model](/models/vehicle-utilization-day) | > [!TIP] > > **Getting the Avro schemas.** The public Avro schemas for Kafka delivery, > including `MessageWrapper` and every Common Model, live in > [terminal-api/schemas](https://github.com/terminal-api/schemas) under > `kafka/avro/`. Pin to a git tag when integrating so your consumers stay on a > stable contract. You can register the schemas in a schema registry, use them > for code generation, or load them directly with Avro deserializers in any > language. ### Headers Terminal adds these headers to each record. Use them to route, filter, or count records without decoding the Avro value. Each value is a UTF-8 string. | Header | Value | Set on | | - | - | - | | `terminal-application-id` | The ID of your Terminal application. | Every record | | `terminal-connection-id` | The source connection's ID. Matches `connectionId` in the value. | Every record | | `terminal-model` | The Common Model name. Matches `model` in the value. | Every record | | `terminal-provider` | The [provider code](/providers/explorer), such as `geotab`. Matches `provider` in the value. | Records with a `provider` | | `terminal-event-time` | When the event happened, as an ISO 8601 UTC timestamp. | Models with an event time | `terminal-event-time` looks like `2026-10-27T13:30:05Z`, with fractional seconds when the source time has them. It comes from a different field on each model: * `VehicleLocation`: `locatedAt` * `VehicleStatLog`: `timestamp` * `Trip`, `SafetyEvent`, and `HOSLog`: `startedAt` * `FaultCodeEvent`: `observedAt` * `HOSDailyLog` and `VehicleUtilizationDay`: `date`, at midnight UTC `Vehicle`, `Driver`, `Device`, `Group`, `Trailer`, and `IFTAVehicleMonth` have no event time, so their records don't carry this header. ### Partition keys Each topic has a configurable list of partition key components. Terminal builds the record key by joining the selected components with a colon (`:`), and Kafka uses that key to assign records to partitions consistently. Available components: * `CONNECTION`: the `connectionId` of the source connection. * `PRIMARY_KEY`: the model's own primary identifier (for example, `vehicleId` for `Vehicle`, `tripId` for `Trip`). * `FOREIGN_KEY`: the related entity's identifier (for example, `vehicleId` for a `VehicleLocation` or `VehicleStatLog`). Useful for keeping all activity for a single vehicle on the same partition. If multiple components are configured, the resulting key looks like `conn_01ARZ.../veh_01ARZ...`. If a record has no value for any of the configured components, the key falls back to a sentinel value so the record is still produced. Choose components based on your downstream ordering and parallelism needs. A common choice for time-series models is `[CONNECTION, FOREIGN_KEY]` so that all events for a given vehicle on a given connection land on the same partition in order. ### Ordering guarantees Terminal does not provide global ordering guarantees on Kafka delivery. There are two reasons: * Provider ingestion is not strictly ordered. Telematics providers expose data through APIs and webhooks that can return events out of order, especially during catch-up after a sync delay. * The replication pipeline is change-data-capture based and parallel, so the order in which records reach the producer is not the order in which they were originally generated by the device. To improve practical ordering, Terminal applies a short windowed sort before producing to your topics: * Records are grouped by the configured [partition key](#partition-keys) and sorted within a tumbling time window (currently 30 seconds, capped at 50,000 records per window). * Within that window, records for the same partition key are produced in event-time order. Across windows, or across different partition keys, no ordering is implied. The windowed sort is configurable as an `ordering` block on the destination. Today it is a single on/off toggle (`enabled`) and defaults to `false`, the 30-second window and 50,000-record cap are fixed. Enable it if you want Terminal to apply the per-partition sort before produce, or leave it off to have records flow through with the lowest possible latency and handle ordering entirely on your consumer side. This is best-effort smoothing, not a contract. Consumers that require strict ordering, exactly-once semantics, or de-duplication should still: * Pick a partition key that aligns with the entity you order around (for example, `[CONNECTION, FOREIGN_KEY]` for time-series models keeps all activity for a vehicle on one partition). * Apply their own windowing or buffering by event timestamp on the consumer side. The [`terminal-event-time`](#headers) header has that timestamp, so there's no need to decode the value first. ### Excluding old events You can have Terminal skip records whose event time is older than a limit you set for each model. Use this when your consumers only act on recent activity and you don't want late or historical records in your topics. Each limit is an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations), such as `P30D` (30 days) or `PT12H` (12 hours): ```json theme={null} "excludeEventsOlderThan": { "VehicleLocation": "P30D", "VehicleStatLog": "P30D" } ``` How it works: * Terminal compares a record's event time with the current time when it processes the record. If the record is older than its model's limit, Terminal doesn't produce it to your topic, and it isn't delivered later. * Event time is the value in the [`terminal-event-time`](#headers) header, so you can check what arrives against the limit. * The limit applies to every record for that model, including updates and [backfills](#delivery-model). An update to a record whose event time is past the limit is also skipped. * Event time is when the activity started. For `Trip`, `SafetyEvent`, and `HOSLog` that's `startedAt`, so a trip that lasts longer than the limit is skipped. * `HOSDailyLog` and `VehicleUtilizationDay` use their date at midnight UTC, so give them limits longer than a day. * Models without a limit are delivered as usual. Models with no event time (`Vehicle`, `Driver`, `Device`, `Group`, `Trailer`, and `IFTAVehicleMonth`) are never skipped, even if you set a limit for them. * Changes take effect within a few minutes. Raising or removing a limit only affects records processed after the change. > [!NOTE] > > Because of pipeline lag, a record can reach your topic a few seconds older > than the limit. ### Topic options You manage topics on your own cluster. For each Common Model you want delivered, you provide: * The topic name Terminal should produce to. * The partition key components for that topic. * Whether to include [raw provider data](/guides/raw-data) alongside the normalized payload. Topic-level controls (partition count, replication factor, retention, compaction, ACLs) remain on your side. Make sure each topic exists before enabling the destination, and that the credentials you give Terminal have produce permissions on it. ### Reference implementation These are the conventions we recommend when standing up a new Kafka destination. They are not enforced and you can deviate where it makes sense for your stack, but starting from these defaults makes most consumer patterns straightforward. **Topics** * One topic per Common Model, named with a stable prefix you control (for example, `terminal.vehicle`, `terminal.vehicle-location`, `terminal.trip`). * Replication factor `3` for production clusters. * Partition count sized for your largest model. For most fleets, `12` to `24` partitions on `VehicleLocation` and `VehicleStatLog` is a good starting point. Entity topics (`Vehicle`, `Driver`, `Trip`) can be smaller (`3` to `6`). * Retention sized for your replay window. `7` days of retention on time-series topics covers most operational replays. Entity topics work well as standard topics with longer retention rather than compacted, since Terminal emits both `insert` and `modify` events and consumers usually want the history. **Partition keys** * Time-series models (`VehicleLocation`, `VehicleStatLog`, `SafetyEvent`, `FaultCodeEvent`, `Trip`, `HOSLog`): `[CONNECTION, FOREIGN_KEY]`. This pins all activity for a given vehicle (or driver) on a given connection to one partition, which preserves the ordering window's benefit and gives you natural per-vehicle parallelism on the consumer side. * Entity models (`Vehicle`, `Driver`, `Device`, `Group`, `Trailer`): `[CONNECTION, PRIMARY_KEY]`. Updates to the same entity always land on the same partition. * Aggregate models (`HOSDailyLog`, `IFTAVehicleMonth`, `VehicleUtilizationDay`): `[CONNECTION, FOREIGN_KEY]` if you join them by vehicle, otherwise `[CONNECTION, PRIMARY_KEY]`. ### Sandbox environment Kafka delivery is not currently available in the [sandbox environment](/guides/sandbox-environment). To validate your consumer end-to-end, work with our team to set up a production destination against a non-production Kafka cluster you control. *** ## Setup and configuration ### Setup checklist The fastest path to a working Kafka destination, in order: 1. **Create the topics** on your cluster. Use the conventions in [Reference implementation](#reference-implementation) if you don't already have a standard. 2. **Provision a SASL user** dedicated to Terminal (for example, `terminal-producer`) and capture the username and password. 3. **Grant ACLs** to that user: `Write` and `Describe` on each topic. See [Required ACLs](#required-acls). 4. **Decide on network connectivity**: public internet, AWS PrivateLink, or AWS MSK VPC. Gather the corresponding identifiers (egress IP allow-list, VPC Endpoint Service name, or MSK cluster ARN). See [Network connectivity](#network-connectivity). 5. **Send the destination config** (template in [Share your destination details](#share-your-destination-details)) to your Terminal contact. ### Prepare your Kafka cluster 1. Identify the bootstrap servers Terminal will connect to (for example, `b-1.your-cluster.kafka.us-east-1.amazonaws.com:9096,b-2.your-cluster.kafka.us-east-1.amazonaws.com:9096`). 2. Decide which Common Models you want delivered, and create one topic per model on your cluster with the partition count, replication factor, and retention that fit your use case. 3. Choose how Terminal will reach your cluster: public internet, [AWS PrivateLink](#aws-privatelink), or [AWS MSK VPC peering](#aws-msk-vpc-peering). See [Network connectivity](#network-connectivity) for details. ### Authentication Terminal authenticates with your cluster over SASL. * **Security protocol**: `SASL_SSL` (default). All traffic is encrypted in transit using TLS to your brokers' certificates. * **SASL mechanism**: `SCRAM-SHA-512` (default). `SCRAM-SHA-256` is also supported on request. * **Credentials**: a username and password that Terminal uses to authenticate. Provision a dedicated user for Terminal so you can rotate or revoke access independently of other consumers. The credentials you provide are stored encrypted at rest in Terminal and are only used to authenticate the replication producer to your cluster. #### Required ACLs Grant the Terminal user the following ACLs on your cluster: * `Write` on each topic Terminal will produce to. * `Describe` on each topic Terminal will produce to (used to verify topic existence and metadata). * `IdempotentWrite` on the cluster (used so the producer can dedupe in-flight retries). The exact command depends on your broker tooling. On an Apache Kafka or MSK cluster using `kafka-acls.sh`, this looks like: ```bash theme={null} kafka-acls.sh --bootstrap-server --command-config admin.properties \ --add --allow-principal "User:terminal" \ --producer --topic terminal.vehicle kafka-acls.sh --bootstrap-server --command-config admin.properties \ --add --allow-principal "User:terminal" \ --operation IdempotentWrite --cluster ``` Repeat the topic ACL command for each topic Terminal will produce to. ### Network connectivity Terminal supports three ways to reach your cluster. > [tab] Public Internet > > The simplest setup. Terminal connects to your brokers over the public internet using the bootstrap servers you provide. All traffic is encrypted with `SASL_SSL`. > > Use this option if your brokers are publicly reachable and you are comfortable allowing inbound connections from Terminal's egress IPs. Contact our team for the current list of egress IPs to allow-list at your network boundary. > [tab] AWS PrivateLink > > Expose your cluster as a [VPC Endpoint Service](https://docs.aws.amazon.com/vpc/latest/privatelink/privatelink-share-your-services.html) and Terminal will connect through a private endpoint, avoiding the public internet. > > You'll need to provide: > > * **Service name**: the VPC Endpoint Service name (for example, `com.amazonaws.vpce.us-east-1.vpce-svc-0123456789abcdef0`). > * **Service region**: the AWS region the service runs in. If different from Terminal's region, the connection will be cross-region. > * **Allowed principal**: add Terminal's AWS account as an allowed principal on the endpoint service so we can create the endpoint. Our team will share the account ID for your environment. > * **Availability zones** (optional): AZ IDs (for example, `use1-az1`) to constrain which subnets Terminal uses. Required only for same-region setups when you want to pin specific AZs. > > Make sure your bootstrap servers resolve to addresses reachable through the endpoint (for example, MSK brokers' private DNS). > [tab] AWS MSK VPC peering > > For Amazon MSK clusters, Terminal can connect directly to your MSK brokers through a managed VPC connection. > > You'll need to provide: > > * **Cluster ARN**: the ARN of your MSK cluster (for example, `arn:aws:kafka:us-east-1:123456789012:cluster/your-cluster/abc123`). > * **Availability zones**: the AZ IDs of your MSK cluster's broker subnets (at least two). Terminal aligns its subnets to match. > * **Authentication**: SASL credentials are required for MSK VPC connectivity (IAM auth is not supported today). > > Authorize Terminal's AWS account on the cluster so the VPC connection can be established. Our team will share the account ID for your environment. ### Share your destination details The fastest way to send us your configuration is to fill out the JSON template below and share it with your Terminal contact (over your shared Slack channel or by email). Send the password through a secure channel separately. We'll confirm everything before provisioning. ```json theme={null} { "bootstrapServers": "b-1.your-cluster.kafka.us-east-1.amazonaws.com:9096,b-2.your-cluster.kafka.us-east-1.amazonaws.com:9096", "auth": { "type": "sasl", "username": "terminal-producer", "password": "", "mechanism": "SCRAM-SHA-512" }, "network": { "type": "public" }, "ordering": { "enabled": false }, "excludeEventsOlderThan": { "VehicleLocation": "P30D" }, "topics": { "Vehicle": { "topic": { "name": "terminal.vehicle" }, "partitionKeys": ["CONNECTION", "PRIMARY_KEY"], "includeRaw": false }, "VehicleLocation": { "topic": { "name": "terminal.vehicle-location" }, "partitionKeys": ["CONNECTION", "FOREIGN_KEY"], "includeRaw": false }, "Trip": { "topic": { "name": "terminal.trip" }, "partitionKeys": ["CONNECTION", "PRIMARY_KEY"], "includeRaw": false } } } ``` Notes on the template: * Replace `network` with one of the variants below if you are not using public internet. * Add or remove entries under `topics` for the Common Models you want delivered. The key (`Vehicle`, `VehicleLocation`, etc.) must match the [Common Model](/models) name exactly. * `excludeEventsOlderThan` is optional. Omit it to deliver every record. The keys follow the same Common Model names. See [Excluding old events](#excluding-old-events). > [accordion] network for AWS PrivateLink > > ```json theme={null} > { > "type": "private_link", > "serviceName": "com.amazonaws.vpce.us-east-1.vpce-svc-0123456789abcdef0", > "serviceRegion": "us-east-1", > "availabilityZones": ["use1-az1", "use1-az2"] > } > ``` > > Omit `serviceRegion` if it matches the region your VPC Endpoint Service runs in. Omit `availabilityZones` to let Terminal auto-discover them. > [accordion] network for AWS MSK VPC > > ```json theme={null} > { > "type": "msk_vpc", > "clusterArn": "arn:aws:kafka:us-east-1:123456789012:cluster/your-cluster/abc123", > "availabilityZones": ["use1-az1", "use1-az2"] > } > ``` For the full list of configuration options, see [Configuration options](#configuration-options). Our team is here to help recommend the best settings for your needs. > [!NOTE] > > Self-service destination management through the Terminal dashboard is coming > soon. *** ### Configuration options | Option | Description | | - | - | | Bootstrap servers | Comma-separated list of broker host:port pairs Terminal will use to connect (for example, `broker1:9096,broker2:9096`). | | Network mode | How Terminal reaches your cluster: `Public`, `PrivateLink`, or `MSK VPC`. See [Network connectivity](#network-connectivity). | | PrivateLink service | When network mode is `PrivateLink`: the VPC Endpoint Service name, region, and (optionally) availability zones. | | MSK cluster | When network mode is `MSK VPC`: the MSK cluster ARN and the broker availability zones. | | Authentication | SASL credentials Terminal uses to authenticate to your brokers. | | Username | SASL username for the dedicated Terminal user on your cluster. | | Password | SASL password for the user. Stored encrypted at rest and never returned in API responses. | | Security protocol | Transport-layer protocol. Defaults to `SASL_SSL`. | | SASL mechanism | Defaults to `SCRAM-SHA-512`. `SCRAM-SHA-256` is also supported on request. | | Ordering | Optional. Enable or disable Terminal's per-partition windowed sort before produce. Defaults to `enabled: false`. See [Ordering guarantees](#ordering-guarantees). | | Exclude old events | Optional. Per-model ISO 8601 durations. Records whose event time is older than the limit aren't delivered. See [Excluding old events](#excluding-old-events). | | Topics | Mapping of Common Model to topic configuration (see options below). At least one model is required. | | Topic name | The topic on your cluster that Terminal produces records for this model to. | | Partition keys | Ordered list of components used to build the record key: `CONNECTION`, `PRIMARY_KEY`, `FOREIGN_KEY`. See [Partition keys](#partition-keys). | | Include raw | Optional. Include [raw provider data](/guides/raw-data) with the normalized payload. Note: this increases data volume by 2-4x or more. | | Disabled | Optional. Pause delivery for a specific topic without removing the configuration. | # Link Analytics Events Source: https://docs.withterminal.com/guides/link-analytics-events Learn how to use the link.analytics_event_emitted webhook event to understand user activity during the Link flow. ## What are Link analytics events? Link analytics events let you track the steps a user takes while connecting their telematics account through Terminal Link. Terminal emits a `link.analytics_event_emitted` webhook when a user performs a tracked action, such as starting Link, searching for a provider, opening a help guide, starting OAuth, or completing a connection. This is useful when you need insight into the user journey prior to connection creation. You can use these events to understand where users drop off, which providers they search for, which unsupported providers they request, and which errors they encounter while connecting. ## Common use cases * Build a funnel from `link_started` to `create_connection_completed` to understand and optimize conversion rates. * Track provider search and selection with `provider_searched`, `provider_selected`, and `unsupported_provider_selected`. * Identify sessions encountering connection failures, including invalid credentials, insufficient permissions, and internal errors. ## Event structure All Link analytics events use the same webhook event type: ```json theme={null} { "id": "evt_01GV12VR4DJP70GD1ZBK0SDWFH", "type": "link.analytics_event_emitted", "timestamp": "2026-06-07T13:51:06.059Z", "detail": { "event": "provider_selected", "sessionId": "019cda63-4d78-77bc-8a68-0b7ce4b48d19", "externalId": "fleet_456", "language": "en", "tags": ["app-4567"], "properties": { "provider": "geotab" } } } ``` The `detail.event` field identifies the specific Link event. Fields like `sessionId`, `externalId`, `language`, `tags`, and `connectionId` apply across events, while the `properties` object depends on the event type. For example, search events include the user's `query` and `resultCount`, provider events include a `provider`, OAuth redirect events include a `result`, and failed connection events include a failure `reason`. See the [`link.analytics_event_emitted` API reference](/api-reference/webhook-events/link-analytics-event-emitted) for the full schema, including every supported event name and property shape. ## Correlating events Use `sessionId` to group activity from a single Link user session. A session represents one pass through the Link flow. If the same user opens Link again later or on a different device, Terminal assigns a new `sessionId`. Use `externalId` and `tags` to connect Link activity back to your own systems. `externalId` is the identifier you pass when initializing Link. `tags` are the connection tags passed into Link. These fields are useful for joining Link analytics events to a customer, quote, workflow, or other internal identifier. `connectionId` is present when Terminal knows the related connection, such as after a connection is created or when the session was started from a reconnection URL. ## Interpreting the funnel A typical successful flow includes events like: ```text theme={null} link_started agreement_accepted provider_searched provider_selected create_connection_attempted create_connection_completed ``` Users do not always move linearly through Link. They may search multiple times, select the wrong provider, go back, open help guides, retry credentials, or leave before completing the flow. There is no explicit abandonment event. To model abandonment, choose a timeout that fits your workflow and look for sessions where `create_connection_completed` has not occurred and the latest event is older than that threshold. ## Subscribing Subscribe to `link.analytics_event_emitted` in the Terminal dashboard. One subscription covers all Link analytics events. In your webhook handler, branch on `detail.event`. Terminal webhooks use at-least-once delivery. Deduplicate events by the top-level `id` field and handle events that arrive out of order. See [Webhooks](/guides/webhooks) for setup, request verification, retries, and replay behavior. ## Related docs * [Terminal Link](/guides/terminal-link) * [Webhooks](/guides/webhooks) * [`link.analytics_event_emitted`](/api-reference/webhook-events/link-analytics-event-emitted) # Managed Polling Source: https://docs.withterminal.com/guides/managed-polling Terminal polls and caches real-time data from providers ## Overview Managed Polling is an optional feature that allows Terminal to automatically poll and cache real-time data from providers at regular intervals. When enabled, Terminal will proactively fetch and store the latest data from providers, significantly reducing latency and increasing reliability of real-time endpoints. ## Real-Time Data Terminal provides access to real-time data from telematics providers through specialized endpoints. Learn more about [Real-Time Data](/guides/real-time-data). ## Supported Endpoints Managed Polling is available for the following real-time endpoints: * [Latest Vehicle Locations](/api-reference/vehicles/list-latest-vehicle-locations) * [Latest Trailer Locations](/api-reference/trailers/list-latest-trailer-locations) * [HOS Available Time](/api-reference/hours-of-service/list-hosavailable-time) ## Benefits * **Reduced Latency:** Access to pre-cached data eliminates the need to wait for provider API calls at request time * **Improved Reliability:** Mitigates issues with temporary provider downtime or rate limiting ## Considerations * **Billing Impact:** Terminal's real-time endpoints are billed by usage. When managed polling is enabled, you will be billed for all vehicles across all active connections. * **Data Freshness:** Data will be as fresh as your polling interval. If you need absolute real-time data, you may still prefer to use the standard endpoints directly. * **Sync Mode:** Managed Polling requires the connection to be in Automatic sync mode. Connections in Manual mode will not continue to poll. ## Configuration ### Enabling Managed Polling Managed Polling is disabled by default. To enable this feature: 1. Login to the [Terminal Dashboard](https://dashboard.withterminal.com/) 2. Navigate to [Settings](https://dashboard.withterminal.com/settings) 3. Enable the `Managed Polling` option 4. Configure the desired polling interval for each endpoint # Migrating to Terminal Source: https://docs.withterminal.com/guides/migrating-to-terminal This guide outlines how to migrate existing connections from another telematics aggregator or your direct integrations to Terminal. ## Overview Terminal supports importing credentials from other telematics aggregators or your direct integrations. This allows you to migrate existing connections without manual end-user re-authentication. The process involves exporting your current credentials, optionally adding custom identifiers, and securely sharing the file with Terminal to complete the migration. ## Migration Steps Below are the steps to migrate your connections to Terminal. ### 1. Prepare Credentials Export your existing connection credentials from your current system. If you're migrating from another telematics aggregator, request a bulk export from them. If you're migrating from direct integrations, compile your credentials into a structured format. The export should include all non-OAuth integrations. ### 2. Add Custom Identifiers (Optional) If you associate connections with internal identifiers in your system, add an `external_id` column to the exported file. This allows you to maintain your existing identifier mappings after migration. Learn more: [Custom Identifiers](/guides/custom-identifiers) ### 3. Share the File Securely Send the exported file to us through your preferred method - such as encrypted email or another secure method. We'll confirm receipt and validate that everything is complete. ### 4. Terminal Runs the Migration Script Once we have the file Terminal will run a script to import each set of credentials. This process validates the credentials and creates new connections in Terminal. ### 5. Verification Our team will: * Confirm that data is syncing correctly. * Run a quick validation to ensure the data matches what was previously coming through your prior system. ### 6. Wrap-Up After successful migration: * You'll receive a confirmation summary. * You can switch your API calls to use the Terminal API in place of your previous system. ## Limitations ### OAuth Connections Samsara and Motive both use OAuth to authenticate connections. If you have ownership of the OAuth applications used for these providers, it may be possible to migrate these connections to Terminal. If another party (such as a previous telematics aggregator) has ownership of the OAuth applications, we'll need to manually re-authenticate the connections with new OAuth applications in your name. ### Credential Structure Differences For some providers it's possible your current system uses a different structure for credentials than Terminal expects. In some cases this may mean specific connections or providers are not able to be migrated automatically and may require additional coordination. # Motive OAuth Configuration Source: https://docs.withterminal.com/guides/motive-oauth-configuration Follow this guide to configure an OAuth2 client for Motive integration ## Overview This guide provides detailed instructions on integrating Motive with your Terminal instance. This is required for Motive specifically in order to guarantee: * The OAuth flow is consistent with your branding. * The permissions are customized for your specific needs. * You can publish your application on the Motive [marketplace](https://marketplace.gomotive.com/). ## Creating a Developer Account > [!NOTE] > > You can skip this step if you already have a Motive developer account [https://www.loom.com/embed/3276f4c0c53445c0ab3dcb36a6862d7e?sid=2eb4268e-157b-4a99-9dad-f326df6b199f](https://www.loom.com/embed/3276f4c0c53445c0ab3dcb36a6862d7e?sid=2eb4268e-157b-4a99-9dad-f326df6b199f) 1. Create a Motive developer account by signing up [here](https://developer.gomotive.com/portal/auth/register). * **Tip**: use a shared email for your team as Motive does not have a multi-user feature. 2. Verify your email address by clicking the link in the email sent to you. 3. Log in to the [Motive Developer Portal](https://developer.gomotive.com/portal). 4. Share the `email` + `password` with the Terminal Team so we can help you complete setup. ## Creating an OAuth Application [https://www.loom.com/embed/872c1e1e319346fcacb6c06d429e27d8?sid=e96da9e1-2841-496c-99eb-ea278f84c490](https://www.loom.com/embed/872c1e1e319346fcacb6c06d429e27d8?sid=e96da9e1-2841-496c-99eb-ea278f84c490) To establish an OAuth client with Motive, execute the following steps: 1. **Create a new App**: * Log in to the [Motive Developer Portal](https://developer.gomotive.com/portal). * Click the **Create App** button. * Give your application a name and click **Create App**. 2. Navigate to **Configuration** 3. Under **Success Redirect URI**, input: ``` https://link.withterminal.com/oauth/callback/motive/{PUBLISHABLE_KEY} ``` > [!NOTE] > > Substitute `{PUBLISHABLE_KEY}` with your production publishable key, which is > available in your Terminal > [dashboard](https://dashboard.withterminal.com/api-keys). If you haven't > obtained production access to Terminal yet, you can skip this step and add the > redirect URI later. 4. Determine the **Permissions** your application will require. > [accordion] Which permissions should I select? > > Here's a breakdown of the permissions and scopes you might need from Motive, depending on the Terminal common models you plan to use. > > > [!TIP] > > > > It's best to request all the permissions you might need upfront. Adding > > permissions later will require customers to re-authenticate, which can be > > avoided with early planning. > > | Common Model | Motive Scope | > | - | - | > | **General** (required) | `Company Details (Read Only)` | > | **Vehicles** (required) | `Vehicles (Read Only)` | > | Devices | `ELDs (Read Only)` | > | Groups | `Groups (Read Only)` | > | Drivers | `Drivers and Fleet Managers (Read Only)` | > | Fault Code Events | `Fault Codes (Read Only)` | > | Latest Vehicle Locations | `Vehicles with Current Location and Current Driver (Read Only)` `Drivers with Current Location and Current Vehicle (Read Only)` | > | Historical Vehicle Locations Vehicle Stat Logs | `Vehicle Location History (Read Only)` | > | Trailers | `Assets (Read Only)` | > | Trailer Locations | `Asset with Asset Gateway Location History (Read Only)` | > | HOS Available Time | `Drivers with Hours of Service (Read Only)` | > | HOS Logs HOS Daily Log | `HOS Logs (Read Only)` | > | Safety Events | `Speeding Events (Read Only)` `Scorecard Summary (Read Only)` | > | IFTA Summaries | `IFTA Trip Reports (Read Only)` `Vehicles' Mileage Summary (Read Only)` | > | Vehicle Utilization | `Utilization Summary by Vehicle (Read Only)` | > | Passthrough | *Select any other scopes you plan to leverage if using [passthrough](/guides/passthrough)* | 5. Click **Save** to finalize application setup. 6. Share the `email` and `password` of the developer account with the Terminal Team. ## Update Motive Configuration in the Terminal Dashboard > [!NOTE] > > If you haven’t obtained production access to Terminal yet, you can skip this > step and complete it when you have production access. > > You must be a Terminal Dashboard admin to perform this step. 1. Go to the Terminal Dashboard [Settings](https://dashboard.withterminal.com/settings?tab=application) 2. Scroll down to **Motive** 3. Paste the **Client ID** and **Client Secret** from Motive into the Terminal dashboard. 4. Click **Edit Scopes** to configure the scopes your application will use. Use the **Sync** button to show what is enabled in Motive to match. > [!NOTE] > > The scopes selected here should match the scopes you selected in the Motive > developer portal. 5. Click **Close** to finish editing the scopes. 6. Click **Save Changes** to save the configuration. 7. Begin connecting Motive fleets to Terminal 🚛 ## Publishing Your Application Once your integration is in production and Motive fleets have connected to your application, you can request that Motive review your application for inclusion in their [marketplace](https://marketplace.gomotive.com/). Contact us when ready, and we'll help introduce you to the Motive team to expedite the review process. # Netradyne Configuration Source: https://docs.withterminal.com/guides/netradyne-configuration Follow this guide to configure Netradyne for Terminal ## Overview This guide explains the setup required before fleets can connect their Netradyne accounts through Terminal Link. Netradyne requires a partner enablement process before fleets can grant access to your integration. Terminal coordinates that process with you and Netradyne. At the end of the process, you will receive the Netradyne Client ID and Client Secret needed to configure Netradyne in the Terminal Dashboard. ## Complete Netradyne enablement Work with the Terminal team to complete the Netradyne enablement process. The process includes: 1. **Introduction to Netradyne** — Terminal introduces your company and use case to Netradyne. 2. **NDA** — Your company and Netradyne complete Netradyne's NDA process. 3. **Integration agreement** — Terminal, your company, and Netradyne complete the required integration agreement for your use case. 4. **Integration details** — You provide the company, product, branding, and technical details Netradyne needs to create your integration listing. This typically includes your company name, integration display name, logo, product description, support contact, and the Netradyne data your integration needs. 5. **Netradyne review and setup** — Netradyne reviews the submitted materials and creates the integration that fleets will later enable in Netradyne. 6. **Credential provisioning** — Terminal receives the Netradyne Client ID and Client Secret for your integration and shares them with you. You do not need to complete these steps on your own. Terminal will tell you what information is needed at each stage and will coordinate with Netradyne through setup. > [!WARNING] > > Do not share your Netradyne Client ID or Client Secret publicly. Treat them > like production API keys. ## Update Netradyne configuration in the Terminal Dashboard After Netradyne enablement is complete and you have production access to Terminal, add the credentials to your Terminal application. > [!NOTE] > > You must be a Terminal Dashboard admin to perform this step. 1. Go to the Terminal Dashboard [Settings](https://dashboard.withterminal.com/settings?tab=application) 2. Scroll down to **Netradyne** 3. Paste the **Client ID** and **Client Secret** from Terminal 4. Optionally set **Vehicle Location Downsampling Interval** if you want to reduce location data volume. For example, enter `30` to keep one location every 30 seconds. Leave empty for Netradyne's full 10-second location resolution. In most cases, we recommend leaving this empty. 5. Click **Save Changes** ## Connecting Netradyne fleets After your Netradyne configuration is saved in Terminal, each fleet needs to grant access to your integration. At a high level, they will: 1. Sign in to Netradyne 2. Subscribe to your integration in the **Driver•i Store** 3. Enable the integration under **Settings** > **Integrations** 4. Accept the integration terms 5. Copy the fleet's **Fleet Unique Identifier** from **Settings** > **Api Access** 6. Enter the Fleet Unique Identifier in Terminal Link Terminal Link includes a built-in Netradyne guide that walks fleets through these steps during connection. ## Troubleshooting If a fleet cannot connect or data is missing after connection, check the following: 1. Confirm the fleet subscribed to and enabled your integration in Netradyne before entering the Fleet Unique Identifier in Terminal Link. 2. Confirm the Fleet Unique Identifier matches the exact value shown in Netradyne under **Settings** > **Api Access**. 3. Confirm the fleet disabled and re-enabled the integration in Netradyne if the fleet connected before your Netradyne data requirements changed. 4. Confirm the fleet's Netradyne plan supports the historical data you need. Many fleets need a Fleet Tracking API subscription for historical location data. See the [Netradyne provider page](/providers/tsp/netradyne) for current model support and retention details. Contact [support@withterminal.com](mailto:support@withterminal.com) if you have questions about Netradyne setup or fleet enablement. # Passthrough Source: https://docs.withterminal.com/guides/passthrough Passthrough enables you to make authenticated HTTP requests directly to an integration's API. Terminal simplifies API requests to any of the integrations supported by Terminal using the connection tokens you've stored on behalf of your users. The requests are transmitted directly to the API of the integration and adhere to the specific API formats of each integration, not Terminal's standardized format. This approach is useful if you want to retrieve data that Terminal may not make requests for. > [!NOTE] > > Learn more by reviewing the documentation for > [`/passthrough`](/api-reference/data-management/passthrough) > [!NOTE] > > If the provider endpoint returns a file or another non-JSON payload, use > [`/passthrough/raw`](/api-reference/data-management/passthrough-raw) instead. > Raw Passthrough forwards a successful provider response body directly (with > the provider's `Content-Type`) instead of returning the `PassthroughOutput` > JSON envelope. When the provider itself responds with an error status, Raw > Passthrough returns HTTP `200` with the `PassthroughOutput` envelope (just > like `/passthrough`), so provider failures are not surfaced as Terminal API > errors. ### Request > [card] Passthrough Input > > **method** `string` *required* > > The method for the third-party request, such as `GET` or `POST`. > > Allowed values: `GET` `POST` `PUT` `PATCH` `DELETE` > > **path** `string` *required* > > A relative provider path such as `/reports`. Absolute URLs are accepted only when they target the connection's provider host (or another host that provider explicitly allows). > > Example: `/reports` > > **headers** `object` > > The headers to use for the request (Terminal will handle the connection's > authorization headers) > > **body** `string` > > The request body > > Example: `{"reportId":"1234"}` ### Response > [card] Passthrough Output > > **method** `string` *required* > > The HTTP method that was used when making the request. > > Example: `POST` > > **path** `string` *required* (default: /reports) > > The path that was called with the passthrough request. > > Example: `GET` > > **statusCode** `integer` *required* > > The resulting status code from the passthrough request. > > Example: `200` > > **headers** `object` *required* > > Any returned headers from the passthrough request. > > **response** `object` *required* > > The response body from the passthrough request # Planning Your Implementation Source: https://docs.withterminal.com/guides/planning-your-implementation The decisions to make before you build: which models you need, which providers your customers run, how fleets consent, which events you react to, and how connections map to your system. ## 1. Get access Make sure your team can sign in to the [Terminal Dashboard](https://dashboard.withterminal.com). It's where you manage [API keys](https://dashboard.withterminal.com/api-keys), provider configuration, and set up your Terminal Link. You've been sent Dashboard invites when your application was provisioned. If anyone on your team still needs an invite, ask an admin on your team who already has access. Once you're in, open [API keys](https://dashboard.withterminal.com/api-keys) with the environment set to Sandbox, then work through the [Quickstart](/guides/quickstart) to make your first test connection. Make sure you also know how to reach us: * **Email:** send support issues and questions to [support@withterminal.com](mailto:support@withterminal.com), or cc it when emailing your Terminal points of contact. Everything sent there lands in our ticket tracking, so nothing gets lost and the right person on our team picks it up quickly. * **Shared channel:** we support shared Slack and Microsoft Teams channels with your team. If you don't have one yet, or need a teammate added to it, just ask us. Questions and issues raised in the channel automatically land in our ticket tracking too. ## 2. Models you plan to use All provider data is normalized into [Common Models](/models/overview), so your integration works the same regardless of which provider a fleet is on. Review the models and decide which ones you need. Plans include different scopes of models. To see which models and APIs your application can call, open [API Access](https://dashboard.withterminal.com/api-keys#api-access) on the API Keys page in the Dashboard. To change your access, contact your Terminal account team. ## 3. Your customers' providers Look up each provider your customers run in the [Provider Explorer](/providers/explorer) to see the models and data it supports. To limit which providers your customers see in Link, set an include or exclude list with [Provider Access Control](/guides/provider-access-control). ## 4. How fleets give consent Decide how customers reach [Terminal Link](/guides/terminal-link): the [SDK](/guides/terminal-link#react-sdk) embedded in your app, or the [Hosted Page](/guides/terminal-link#hosted-page) you send to fleets directly. [Consent Templates](/guides/consent-templates) let you run different flows for different products or customer segments. Link shows your application's branding to every fleet you onboard, so upload your logo in the Dashboard under [Settings > Branding](https://dashboard.withterminal.com/settings?category=branding). See [Adding Your Logo](/guides/terminal-link#adding-your-logo). ## 5. Which events you react to [Webhooks](/guides/webhooks) tell you when a connection is created, a sync finishes, or data changes, so you aren't left polling. Decide which events your systems need. ## 6. How connections map to your system Every connection gets a Terminal connection ID, and that ID is enough on its own. If you'd rather use an ID you already have, set an `externalId` or `tags` with [Custom Identifiers](/guides/custom-identifiers). Use `tags` when several of your records point at one connection. A unique `externalId` per record creates a separate connection for the same fleet, since it feeds [duplicate connection](/guides/duplicate-connections) detection. ## 7. Working towards a Production release Everything above builds toward the [Production Readiness checklist](/guides/production-readiness), which covers the consent flow, connection lifecycle, data access, webhooks, and billing. It's where your development ends, so work through the guides and your own development and QA process first, and treat the checklist as the standard you're building toward. Once you're confident you've covered all of it, let your Terminal contact know. We'll go through it with you and help provision your production environment. # Production Readiness Source: https://docs.withterminal.com/guides/production-readiness A guide to help ensure your Terminal implementation is ready for production, covering what to have in place before going live so you can focus on the areas relevant to your use case. ## Consent Flow 1. Decide how you're integrating the [Link component](/guides/terminal-link): the [SDK](/guides/terminal-link#react-sdk) embedded in your app for a digital onboarding flow, or the [Hosted Page](/guides/terminal-link#hosted-page) sent directly to fleets for manual outreach. 2. If using the SDK, handle the `onSuccess` callback and [exchange the public token](/api-reference/authentication/public-token-exchange) for a connection token. 3. Open your Link page and confirm your application name and logo show correctly. This is what every fleet you send it to will see, and by default it falls back to your application branding. In sandbox you'll see a banner at the top of the page noting it's a test environment; that banner won't show in production. Optionally, use [Consent Templates](/guides/consent-templates) under **Add Connections > Consent Templates** in the dashboard for more control, such as a custom display name, logo, or theme colors. 4. Have a way to capture new connections: redirect handling, the [`connection.created` webhook](/api-reference/webhook-events/connection-created), [listing connections](/api-reference/connections/list-connections) from the API, or the dashboard. 5. Decide how you'll map connections back to entities in your system. The connection ID Terminal assigns is enough on its own. [`externalId`](/guides/custom-identifiers) and [`tags`](/guides/custom-identifiers) are optional, and both come back on every webhook. Use `tags` when several of your records point at one connection, since a unique `externalId` per record creates a separate connection for the same fleet. ## Connection Lifecycle 6. Store the [connection token](/api-reference/authentication#connection-tokens) you get back after each fleet completes the Link flow. This token identifies which customer connection you're calling the API on behalf of, so store it securely like any other credential, and associate it with the corresponding entity in your system. Otherwise you won't know which token to use when you need to call the API or backfill data for that fleet. 7. Have a process for when a [connection becomes disconnected](/guides/disconnected-connections): an automated notification, manual outreach, or an in-app prompt. 8. Support [re-connecting](/guides/terminal-link#re-authenticating-a-connection) a connection when needed. 9. Decide how you want to handle [duplicate connections](/guides/duplicate-connections) to the same provider account. 10. Have a process for winding down connections for the different events that drive it: a fleet leaving your product, a customer data deletion request, cleaning up test or duplicate connections. Know when to [archive vs delete](/guides/deleting-connections#archive-vs-delete): archive stops syncing but keeps history; delete permanently removes the data. ## Data Access You can use the [API](/guides/syncing-via-the-api), [S3 Data Delivery](/guides/aws-s3-destination), [Kafka](/guides/kafka-destination), or compare options in [Data Replication](/guides/data-replication): ### If using the API 11. Choose a [sync mode](/guides/data-replication#sync-modes) for your connections: automatic keeps data current in the background, while manual lets you request syncs through the API when you need control over timing or [cost](#billing). 12. Handle [pagination](/api-reference/pagination) for list endpoints. 13. Track what data you've already synced, for example using `modifiedAfter` checkpoints. 14. Account for [late arriving data](/guides/syncing-via-the-api#late-arriving-data-&-lookback-windows). `modifiedAfter` handles it for you, but [Vehicle Location](/models/vehicle-location) and [Vehicle Stat Log](/models/vehicle-stat-log) records are record time only, so re-query a trailing window on every run and keep your ingestion idempotent, since records inside that window come back every cycle. ### If using Data Delivery 15. Confirm where and how data is being delivered, and that your destination is connected and reachable. 16. Confirm you can see new files land and, if applicable, that you're receiving the corresponding webhook event. ## Webhooks If you're using [webhooks](/guides/webhooks), confirm which events you need and that you're handling them correctly: 17. Connection lifecycle: [`connection.created`](/api-reference/webhook-events/connection-created), [`connection.disconnected`](/api-reference/webhook-events/connection-disconnected) 18. Sync lifecycle: [`sync.completed`](/api-reference/webhook-events/sync-completed), [`sync.failed`](/api-reference/webhook-events/sync-failed) 19. Data Delivery lifecycle: [`delivery.completed`](/api-reference/webhook-events/delivery-completed), [`delivery.failed`](/api-reference/webhook-events/delivery-failed) 20. Data changes: [`vehicle.added`](/api-reference/webhook-events/vehicle-added), [`driver.added`](/api-reference/webhook-events/driver-added), [`safety_event.added`](/api-reference/webhook-events/safety-event-added) See the [full list of events](/api-reference/webhook-events/overview) for more options. ## Billing 21. Understand the billing model. [Entities](/models/overview#entities) like vehicles and drivers don't cost anything on their own; they're only billed through the [real-time](/models/overview#real-time-data) or [time series](/models/overview#time-series-data) data you sync for them. Real-time data is billed per vehicle, per month, at your contract's real-time rate. Time series data is billed per vehicle-month backfilled, at your contract's backfill rate. Example: a new connection for 500 vehicles is made today. It immediately backfills 6 months of history. That's 3,000 vehicle-months of backfill (500 vehicles × 6 months), billed once. It then continues syncing real-time data. That's 500 vehicle-months billed every month for as long as the connection stays active. Over the following 3 months, that's 1,500 vehicle-months of real-time usage (500 vehicles × 3 months). 22. If you'll use [filtering](/guides/vehicle-driver-filtering) to limit ingestion to active vehicles or drivers, or [managed polling](/guides/managed-polling), factor that into your estimate since both affect what you're billed for. 23. Estimate your costs for the first three months in production using this model, based on your expected connection volume and how much history you'll backfill. Implementation choices like backfill depth, filtering, and managed polling change what gets metered, so knowing the model up front helps you make those tradeoffs deliberately instead of discovering the bill after go-live. ## Post Production Provisioning 24. Update your integration to the production [API base URL and secret key](/api-reference/environments). 25. If you serve multiple brokers or brands, set up a separate [consent template](/guides/consent-templates) or [short link](/guides/short-links) for each. 26. Reconfigure your [webhooks](/guides/webhooks) in the production portal. Sandbox and production webhook configs are separate. 27. If using [Data Delivery](/guides/aws-s3-destination), send Terminal your production destination setup (for example your production S3 bucket and access details), then update your production ingestion to read from that destination. 28. For each provider that needs app credentials in Terminal, complete that [provider's configuration guide](/guides/motive-oauth-configuration) once your production app is provisioned. # Provider Access Control Source: https://docs.withterminal.com/guides/provider-access-control Control which telematics providers fleets can connect through the Consent Flow. Provider data coverage varies. Use Provider Access Control to prevent fleets from connecting providers that do not meet your data requirements. Before changing provider access, review the [Provider Explorer](/providers/explorer) to compare support for vehicles, locations, HOS logs, IFTA data, and other models. ## Provider access modes Terminal supports three provider access modes: * **Allow All Providers**: Fleets can connect any provider available through Terminal. * **Allow Only Selected**: Fleets can connect only the providers you select. * **Block Selected**: Fleets can connect any available provider except the providers you select. Use **Allow Only Selected** when you maintain a strict list of approved providers. New Terminal providers are not automatically added to this list. Use **Block Selected** when most providers meet your requirements and you only need to exclude specific providers. New Terminal providers remain available unless you block them. > [!NOTE] > > Provider Access Control determines whether a provider can be connected. It > does not disable existing connections or change the data models or attributes > that the provider supports. Existing connections continue syncing and can > still use live actions and reconnect after you change this setting. ## Configure provider access 1. Log in to the [Terminal Dashboard](https://dashboard.withterminal.com/). 2. Go to **Settings > Provider Configuration**. 3. Find the **Provider Access Control** section. 4. Under **Provider Access Mode**, select **Allow All Providers**, **Allow Only Selected**, or **Block Selected**. 5. If you selected **Allow Only Selected** or **Block Selected**, choose the providers to include in the list. 6. Click **Save Changes**. ## Override per Consent Template The steps above set provider access for your whole application. A [Consent Template](/guides/consent-templates) can define its own provider access instead, so one segment of your customers sees a different set of providers. 1. Go to **Consent Templates** and open a template. 2. Find the **Provider Access Control** section. 3. Under **Provider Access Mode**, choose **Allow All Providers**, **Allow Only Selected**, or **Block Selected**, then select providers if the mode needs a list. 4. Click **Save Changes**. A template's mode replaces your application setting for consent flows that use that template rather than narrowing it, so a template can make a provider available that your application blocks. Templates left on **Use application setting** follow your application configuration. ## What fleets see Allowed providers appear as available options in the Consent Flow. At the bottom of the provider list, fleets can select **Request Provider** to search providers that are not currently available for connection. Fleets normally use this option to request support for a provider that Terminal knows about but does not yet support. Blocked providers are removed from the main list and appear under **Request Provider** instead. If a fleet selects a blocked provider there, Terminal displays an **Integration Not Supported** message explaining that the provider does not meet your data requirements. The same message appears if the fleet opens the Consent Flow with that blocked provider already selected. > [accordion] Customize the blocked-provider experience > > You can also direct fleets to your own help page by setting a **Blocked > Provider Redirect URL** in a [Consent Template](/guides/consent-templates). In > that case, Terminal does not redirect the fleet automatically. The > blocked-provider message includes a **Continue** button that opens the > configured URL in a new tab. Use the destination page to explain your > requirements, recommend another provider, or provide contact information for > support. ## Review your configuration Provider coverage changes as Terminal adds integrations and expands existing ones. Review the Provider Explorer and your provider access configuration periodically so fleets can connect every provider that meets your requirements. ## Related docs * [Provider Explorer](/providers/explorer) * [Link Component](/guides/terminal-link) * [Consent Templates](/guides/consent-templates) # Quickstart Source: https://docs.withterminal.com/guides/quickstart Here's a step-by-step guide to get started integrating telematics data with Terminal. > [!NOTE] > > **Prerequisites** You must have a valid sandbox secret and publishable key to > follow this guide. Existing Terminal customers can get them from [API > keys](https://dashboard.withterminal.com/api-keys) with the environment set to > Sandbox. If you're not a Terminal customer yet, you can [connect with us > here](https://calendly.com/d/d2tk-y35-kb2/discovery-call). ## Overview Getting data flowing takes three parts: a customer authenticates through Terminal Link, you exchange the token Link returns for a connection token, then you pull that connection's data once its first sync finishes. The steps below run all three against the Sandbox provider, so you can test without a real telematics account. ## Instructions 1. Download our [Postman collection](https://github.com/terminal-api/postman) and import it into Postman. 2. Make a test connection. 1. Launch Link to create a new connection. Replace `{PUBLISHABLE_KEY}` with your sandbox publishable key and open the Link URL below. ``` https://link.sandbox.withterminal.com/?key={PUBLISHABLE_KEY}&backfill_days=2&redirect_url=https%3A%2F%2Fpostman-echo.com%2Fget ``` 2. Select the Sandbox provider. 3. Enter any value as the API Key to create a connection. > [!TIP] > > Any value works here, since this is a test connection in the sandbox > environment and Link doesn't check the API Key against a real telematics > account. Enter `invalid` or `permissions` instead if you want to > simulate a failed connection. See the [Sandbox Environment > guide](/guides/sandbox-environment) for details. 4. Wait to be redirected to the `redirect_url` with a `token` appended to the URL. 3. Pull the connection's data. 1. Copy the public `token` from the redirected page. 2. Exchange the public token for a long lived connection token. Call [`POST /public-token/exchange`](/api-reference/authentication/public-token-exchange): ```bash theme={null} theme={null} curl --request POST \ --url 'https://api.sandbox.withterminal.com/tsp/v1/public-token/exchange' \ --header 'Authorization: Bearer your_sandbox_secret_key' \ --header 'Content-Type: application/json' \ --data '{"publicToken": "your_public_token"}' ``` Save the `token` from the response. It's your connection token, and every request you make for this connection needs it in a `Connection-Token` header. 3. Poll until the initial sync completes. Call [`GET /connections/current`](/api-reference/connections/get-current-connection) and check `lastSync.status`: ```bash theme={null} theme={null} curl --request GET \ --url 'https://api.sandbox.withterminal.com/tsp/v1/connections/current' \ --header 'Authorization: Bearer your_sandbox_secret_key' \ --header 'Connection-Token: your_connection_token' ``` > [!TIP] > > Polling works fine for a quickstart, but for production traffic > subscribe to `sync.completed` (and `connection.created`) > [webhooks](/guides/webhooks) instead so you're not left waiting on a > request. 4. List the synced vehicles. Call [`GET /vehicles`](/api-reference/vehicles/list-vehicles): ```bash theme={null} theme={null} curl --request GET \ --url 'https://api.sandbox.withterminal.com/tsp/v1/vehicles' \ --header 'Authorization: Bearer your_sandbox_secret_key' \ --header 'Connection-Token: your_connection_token' ``` Congrats, you've completed the quickstart! You have a working connection in Sandbox and pulled its data. # Raw Data Source: https://docs.withterminal.com/guides/raw-data ## Overview Many of Terminal's endpoints support a `raw` parameter that enables you to retreive the underlying raw data used to form the common model. This can helpful in scenarios when a provider includes very unique fields that may not fit in to a unified model. Here's a quick demonstration of how raw data works in Terminal: [https://www.loom.com/embed/5449a0558f194ef981cfa42accd22810?sid=47461a69-ae52-4bd6-853f-610ef51ab436](https://www.loom.com/embed/5449a0558f194ef981cfa42accd22810?sid=47461a69-ae52-4bd6-853f-610ef51ab436) ### Considerations It's important to note that using the `raw` parameter may impact response times slightly (very minimal) and should only be used in scenarios where it is necessary. If you plan to use `raw`, please let us know as we are always curious to hear about gaps in our common model that might be roadmap opportunities. > [!WARNING] > > When `raw` is `true`, Vehicle Location and Vehicle Stats ingested within the > last 15 minutes may not include `raw`. `limit` must be `500` or less ## Usage When making a `GET` call to a supported endpoint, set the `raw` query parameter to `true` and retreive the common model as well as an additional `raw` property that includes the most recent list of raw responses used to form the common model. ### Example Response Here's an example of a request to `/vehicles/{id}?raw=true` ```JSON theme={null} { "id": "id_pfx_01D8ZQFGHVJ858NBF2Q7DV9MNC", "sourceId": "33901", "provider": "verizon-reveal", "status": "active", "name": "FD 0339", "make": "FORD", "model": "ECONOLINE", "year": 2010, "raw": [ { "provider": "verizon-reveal", "schema": "Vehicle", "extractedAt": "2023-03-26T17:57:40.942Z", "data": { "Name": "FD 0339", "VehicleNumber": "33901", "RegistrationNumber": null, "VIN": null, "Make": "FORD", "Year": 2010, "Model": "ECONOLINE", "TankCapacity": null, "HighwayMPG": null, "CityMPG": null, "VehicleSize": 0, "HasNavigationDevice": true } } ] } ``` # Real-Time Data Source: https://docs.withterminal.com/guides/real-time-data Access live telematics data from providers through Terminal ## Overview Terminal provides access to real-time data from telematics providers through specialized endpoints. These endpoints fetch live information directly from providers at the time of your request, allowing you to access the most current data available. Real-time endpoints are particularly valuable for applications that require up-to-the-minute information, such as live fleet tracking dashboards, driver management systems, and operational tools that depend on current vehicle state. ## Supported Real-Time Endpoints Terminal offers the following real-time data endpoints: * [Latest Vehicle Locations](/api-reference/vehicles/list-latest-vehicle-locations) * [Latest Trailer Locations](/api-reference/trailers/list-latest-trailer-locations) * [HOS Available Time](/api-reference/hours-of-service/list-hosavailable-time) These endpoints make live calls to the provider APIs when you request data, ensuring you receive the most current information available. ## How Real-Time Endpoints Work When you make a request to a real-time endpoint: 1. Terminal receives your API call 2. Terminal makes a synchronous request to the appropriate provider API 3. The provider returns the current data 4. Terminal transforms the data into its normalized common model 5. The normalized data is returned in the API response This process occurs in real-time for each request, giving you direct access to the latest information from the provider. ## Performance Considerations While real-time endpoints provide the most current data, they have some inherent considerations: * **Latency**: Responses may take longer since Terminal must wait for the provider API to respond * **Provider Limitations**: Provider API rate limits or outages can affect availability * **Reliability**: Dependent on provider API performance at the time of request ## Optimizing Real-Time Data Access For applications that need both fresh data and optimized performance, Terminal offers [Managed Polling](/guides/managed-polling), which proactively caches real-time data at regular intervals. This provides a balance between data freshness and response time. # Samsara OAuth Configuration Source: https://docs.withterminal.com/guides/samsara-oauth-configuration Here's a step-by-step guide to configure an OAuth2 client for Samsara ## Overview This guide provides detailed instructions on integrating Samsara with your Terminal instance. This is required for Samsara specifically in order to guarantee: * The OAuth flow is consistent with your branding. * The permissions are customized for your specific needs. * You can publish your application in the Samsara [marketplace](https://www.samsara.com/resources/marketplace/). > [!NOTE] > > Samsara operates different portals for different regions. Terminal supports > North America ([cloud.samsara.com](https://cloud.samsara.com)) and Europe > ([cloud.eu.samsara.com](https://cloud.eu.samsara.com)). If you have customers > in both regions, you will need to complete the steps below for each region. > Make sure to use a unique email address for each region because the same email > cannot be used for multiple regions. ## Creating a Developer Account > [!NOTE] > > You can skip this step if you already have a Samsara developer account in the > relevant region [https://www.loom.com/embed/366eb52d7b7f48578a7ad63564fd9df7?sid=2df5e971-309a-40c8-8391-6cd4acb85243](https://www.loom.com/embed/366eb52d7b7f48578a7ad63564fd9df7?sid=2df5e971-309a-40c8-8391-6cd4acb85243) 1. Submit Samsara's [partner application form](https://developers.samsara.com/docs/application-process). 2. Accept the invite Samsara sends you to create a developer account. This may take up to 7 business days. * If you don't receive an invite after 7 business days, reach out to `support@withterminal.com`. 3. Invite `support@withterminal.com` to your Samsara organization. ## Creating an OAuth Application [https://www.loom.com/embed/b1bd0b73a0cd461099522489dc1ea793?sid=35d65baf-1b4c-42a4-9a2f-7c4285124dc1](https://www.loom.com/embed/b1bd0b73a0cd461099522489dc1ea793?sid=35d65baf-1b4c-42a4-9a2f-7c4285124dc1) > [!NOTE] > > If you support multiple regions, repeat these steps in each regional portal To create an OAuth application with Samsara, follow these steps: 1. **Create a new application**: * Log in to your Samsara dashboard ([North America Link](https://cloud.samsara.com/organizations/list) | [EU link](https://cloud.eu.samsara.com/organizations/list)) and go to the **Apps** tab * Click **Create new app** * Enter the required details (name, tag line, logo, etc.) 2. Under **Redirect URLs**, add: ``` https://link.withterminal.com/oauth/callback/samsara ``` 3. Choose the necessary **Scopes** for your application. > [accordion] Which scopes should I choose? > > Below is a summary of the scopes you might need from Samsara, depending on the Terminal common models you intend to utilize. > > > [!TIP] > > > > It's best to request all the permissions you might need upfront. Adding > > permissions later will require customers to re-authenticate, which can be > > avoided with early planning. > > | Common Model | Samsara Scope | > | - | - | > | **General** (required) | `Setup & Administration > Read Org Information` `Setup & Administration > Read Webhooks` `Setup & Administration > Write Webhooks` | > | **Vehicles** (required) | `Vehicles > Read Vehicles` | > | Groups | `Setup & Administration > Read Tags` | > | Devices | `Setup & Administration > Read Gateways` | > | Drivers | `Drivers > Read Drivers` | > | Vehicle Locations Vehicle Stat Logs | `Vehicles > Read Vehicle Statistics` `Assignments > Read Assignments` | > | Trips | `Vehicles > Read Vehicle Trips` | > | Trailers | `Trailers > Read Trailers` `Equipment > Read Equipment` | > | Trailer Locations | `Trailers > Read Trailer Statistics` `Equipment > Read Equipment Statistics` | > | HOS Logs HOS Daily Logs HOS Available Time | `Compliance > Read ELD Hours of Service` `Compliance > Read ELD Compliance Settings` | > | Safety Events | `Safety & Cameras > Read Safety Events & Scores` `Safety & Cameras > Read Camera Media` (optional) `Speeding Intervals > Read Speeding Intervals` | > | IFTA Summaries | `Compliance > Read IFTA (US)` | > | Passthrough | *Select any other scopes you plan to leverage if using [passthrough](/guides/passthrough)* | 4. Click **Save** to create your application. 5. Click on the application you just created. 6. In the top right, change the app state to `Beta`. Learn more about app states [here](https://developers.samsara.com/docs/marketplace-apps#app-states). 7. Click **Save** to make your application available for customer use. 8. Invite `support@withterminal.com` to your Samsara organization. ## Update Samsara Configuration in the Terminal Dashboard > [!NOTE] > > You will need your Production Terminal app provisioned before you can > complete this step. If necessary, return here when that occurs. > > You must be a Terminal Dashboard admin to perform this step. 1. Go to the Terminal Dashboard [Settings](https://dashboard.withterminal.com/settings?tab=application) 2. Scroll down to **Samsara** 3. Paste the **Client ID** and **Client Secret** from Samsara into the Terminal dashboard. * If you created applications in multiple regions, paste the credentials for each region under its respective section 4. Click **Save Changes** to save the configuration. 5. Begin connecting Samsara fleets to Terminal 🚛 ## Connecting Samsara Fleets > [!WARNING] > > The user authorizing the connection on the fleet's Samsara account must have a > **Full Admin** or **Standard Admin** role. Samsara blocks OAuth installs for > users without one of these roles, and the error is surfaced on Samsara's side > before the flow returns to Terminal. ## Publishing Your Application Once your integration is in production and at least one Samsara fleet has connected to your application, follow Samsara's [App Certification Process](https://developers.samsara.com/docs/app-certification-process) to submit it for inclusion in the [Samsara App Marketplace](https://www.samsara.com/resources/marketplace/). > [!WARNING] > > Until your app is certified, fleets will see a banner during OAuth that says: > "This application has not been formally certified by Samsara." This will not > affect anyone's ability to connect through Samsara and it's okay for your app > to remain in this state indefinitely. > [!NOTE] > > If you support multiple regions, complete certification separately in each > regional portal ([North America](https://cloud.samsara.com) and > [Europe](https://cloud.eu.samsara.com)). # Sandbox Environment Source: https://docs.withterminal.com/guides/sandbox-environment Test your telematics integrations with Terminal's API The Terminal sandbox environment contains anonymized data from a real fleet, allowing you to test the full scope of Terminal's platform in a production-like environment. This sandbox environment is designed to provide developers with a comprehensive testing ground that closely mimics the behavior and data structure of the live production environment. By using the Terminal Sandbox, you can thoroughly validate your integration without the risk of affecting real-world operations. ## How to Access All Terminal customers have full access to the sandbox environment. To access the sandbox: 1. Log in to your [Terminal Dashboard](https://dashboard.sandbox.withterminal.com/). 2. Locate the environment switcher in the top right corner of the dashboard. 3. Ensure the switcher is set to `Sandbox`. 4. Get your sandbox keys [here](https://dashboard.sandbox.withterminal.com/api-keys) > [!TIP] > > **Need access?** > > Not a Terminal customer yet? We'd love to show you how our platform can benefit your business. [Schedule a demo](https://calendly.com/d/d2tk-y35-kb2/discovery-call) with our team to learn more about Terminal's capabilities and how our sandbox enables you to build and test your integration efficiently. ## Key Features 1. **Realistic Data:** The sandbox is populated with anonymized data from an actual fleet, ensuring that you're working with diverse and representative datasets. 2. **Full API Access:** Test all Terminal API endpoints and functionalities available in the production environment. 3. **Safe Testing Environment:** Experiment freely without the risk of impacting live data or operations. 4. **Consistent Behavior:** The sandbox aims to replicate the behavior of the production environment as closely as possible, including rate limits and error responses. 5. **Data Refresh:** Sandbox data is periodically updated to ensure you're always working with current and relevant information. ## Testing Failure States in the Consent Flow The sandbox environment allows you to test the behavior of the consent flow when encountering various error states. ### Invalid Credentials By using the username `invalid` in the credentials, you can simulate a failed authentication attempt. ### Permissions Error By using the username `permissions` in the credentials, you can simulate a permissions error. ## Best Practices for Sandbox Usage 1. Always test your integration thoroughly in the sandbox before moving to production. 2. Use the sandbox to simulate various scenarios and edge cases. 3. Familiarize yourself with any differences between sandbox and production environments. 4. Regularly update your test suite to cover new features and endpoints as they become available. While the sandbox provides a close approximation of the production environment, there might be slight differences in performance or data availability. Always perform final validation in the production environment before full deployment. ## Differences from Production * **Terminal Link:** In the sandbox environment, the [Terminal Link](/guides/terminal-link) will accept any credentials. * **Passthrough:** The [Passthrough Endpoint](/api-reference/data-management/passthrough) isn't functional as our system doesn't communicate with any providers in the sandbox environment. # SDKs Source: https://docs.withterminal.com/guides/sdks Terminal provides SDKs to make it easy to integrate with your application. ## Link SDKs Terminal provides packages to enable you to embed our Link component in your application. > [card] [@terminal-api/link-sdk](https://www.npmjs.com/package/@terminal-api/link-sdk) > > The Link SDK provides a JS client that you can use to embed the Link component > in your application. > [card] [@terminal-api/link-react](https://www.npmjs.com/package/@terminal-api/link-react) > > The Link SDK React package provides a React hook that you can use to embed the > Link component in your application. ## API SDKs > [!NOTE] > > Coming soon! We have plans to release SDKs for our API. Let us know what > language you'd like to see first by talking with our team. # Short Links Source: https://docs.withterminal.com/guides/short-links Learn how to create short, easy-to-type Link URLs to share with end users over channels like mailers and SMS. ## What are Short Links? Short Links let you replace the full Link URL with a compact 8-character code on `term.new`. Instead of sharing a long URL with every parameter visible, you mint a short link and share something like `https://term.new/az9qtk2d`. Short links are useful when URL length matters, like for printed mailers, SMS messages, or anywhere an end user may need to type or read the URL aloud. ## Creating a short link Call [`POST /tsp/v1/link/short`](/api-reference/link/create-short-link) with the same parameters you'd otherwise put in a Link URL. However, the endpoint is server-side only, so you authenticate with your secret key. ```bash theme={null} curl --request POST \ --url 'https://api.withterminal.com/tsp/v1/link/short' \ --header 'Authorization: Bearer {SECRET_KEY}' \ --header 'Content-Type: application/json' \ --data '{ "externalId": "fleet_456", "redirectUrl": "https://app.acme.com/telematics-success", "backfill": { "days": 30 }, "tags": ["uw-pilot"], "syncMode": "automatic", "template": "ltp_01JWBQBYDPC4EJ5EA9QBP1X5X1" }' ``` Terminal returns the new short link: ```json theme={null} { "id": "slk_01jb7k3n2qzp7tvr4fx8sdwfh9", "code": "az9qtk2d", "url": "https://term.new/az9qtk2d", "expiresAt": "2027-05-06T20:30:00.000Z" } ``` The `url` field is what you share with the end user. Persist the `id` if you may need to [delete the short link](/api-reference/link/delete-short-link) later — the public `code` / `url` alone cannot be used to delete. ### Supported parameters The request body accepts the same parameters available on the Link URL, including `externalId`, `template`, and `syncMode`. See the [API reference](/api-reference/link/create-short-link) for the complete list. ## Using a short link When an end user visits `https://term.new/{code}`, Terminal resolves the code server-side and runs the Link flow with the parameters you minted at creation time. Specifically, the browser redirects to `https://link.withterminal.com?short_code={code}`. The rest of the Link flow will always include the `short_code` in the url, not the full parameters, but will behave exactly like the long url. ## Idempotency and expiry Identical request bodies are de-duplicated automatically. Calling the endpoint a second time with the same parameters returns the original short link with an `Idempotent-Replayed: true` response header instead of minting a new code. Minting a short link with different parameters never invalidates a previously issued short link, each link lives independently until its own expiry date. Each short link is valid for **1 year** from its most recent creation or replay. The `expiresAt` timestamp is included in every response. Calling the create endpoint with the same body resets the expiry timestamp and returns the same code that's associated with those parameters. After expiry, the code stops resolving and you'll need to mint a new short link to share again. ## Deleting a short link Call [`DELETE /tsp/v1/link/short/{id}`](/api-reference/link/delete-short-link) with the short link `id` returned when you created (or replayed) the short link. Note that the delete path accepts only that durable `id` (`slk_…`), not the 8-character `code` from the shared URL. Deletion is permanent: the short URL stops resolving immediately, and creating a short link with the same parameters afterward mints a new code. ```bash theme={null} curl --request DELETE \ --url 'https://api.withterminal.com/tsp/v1/link/short/slk_01jb7k3n2qzp7tvr4fx8sdwfh9' \ --header 'Authorization: Bearer {SECRET_KEY}' ``` A successful delete returns `204 No Content`. ## Things to know * Short links are intended for new connections. Reconnects continue to use the `link.withterminal.com` url with the full parameters. * Once a short link is minted, its parameters are permanent. To use different parameters, mint a new short link. * There is no endpoint to list short links or look up one by `code`. Store the `id` from the create response if you need to delete later. * Rotating your publishable key does not invalidate previously-created short links. * Short links can only be minted or deleted server-side with your secret key. There is no browser-callable mint endpoint that accepts a publishable key. ## Related docs * [Terminal Link](/guides/terminal-link) * [Consent Templates](/guides/consent-templates) * [Custom Identifiers](/guides/custom-identifiers) # Syncing via the API Source: https://docs.withterminal.com/guides/syncing-via-the-api Pull Terminal data over the unified API using modifiedAfter and lookback windows. This guide is the API home for data replication: access patterns (`modifiedAfter` vs record time) and how to keep your system up to date by pulling from the unified API. For the overall picture and other egress options, start at [Data Replication](/guides/data-replication). Destination-specific setup lives in [S3](/guides/aws-s3-destination) and [Kafka](/guides/kafka-destination). Use [Webhooks](/guides/webhooks) to trigger pulls when syncs complete. > [!NOTE] > > For real-time data queries (like current vehicle locations), see [Real-Time > Data](/guides/real-time-data). This guide focuses on historical and record > data over the API. ## Core Concepts ### Late-Arriving Data & Lookback Windows Data doesn't always become available in Terminal immediately when events occur. There can be hours or even days between when an event happens and when it's available and ingested in our systems, creating a gap between **record time** (when the event occurred) and **ingestion time** (when Terminal processed it). When using record time for incremental access, apply a 24-48 hour lookback window to catch late-arriving data. Some endpoints such as HOS logs may require a longer lookback window due to the nature of when records can be updated. > [!TIP] > > Ingestion time access eliminates lookback windows by using Terminal's > processing time. ### Access Patterns **Ingestion Time Access**: Query data based on when Terminal processed it from the provider * Parameters: `modifiedAfter`, `modifiedBefore` * Best for: Incremental syncing by finding what data has changed since a point in time * Data is ordered by when it was ingested into Terminal (not record time) * Recommended to use when available since it eliminates the need for lookback windows > [!NOTE] > > Do not pass record time parameters when using ingestion time access **Record Time Access**: Query data based on when events actually occurred * Example parameters: `startedAfter`, `startedBefore`, `startAt`, `endAt` * Best for: Historical analysis and backfill scenarios * Data is ordered by record time (not ingestion time) * Required for: `/vehicles/{id}/locations`, `/vehicles/{id}/stats/historical` > [!NOTE] > > Make sure to apply lookback windows when using for incremental replication > (see above) ### Data Types Most data in Terminal is time-related and follows these patterns. Here are the three main categories: **1. Entities** - Vehicles, drivers, groups, trailers, devices * **Endpoints**: `/vehicles`, `/drivers`, `/groups`, `/trailers`, `/devices` * **How to sync**: Use `modifiedAfter` for incremental updates * **Notes**: No lookback windows needed **2. Records** - Safety events, trips, logs, and most other time-based data * **Endpoints**: `/safety/events`, `/trips`, `/hos/logs`, `/hos/daily-logs`, and most other time-based data * **How to sync**: Use `modifiedAfter` OR record time parameters * **Notes**: Can use lookback windows with record time **3. Historical Telematics** - Vehicle sensor data over time * **Endpoints**: `/vehicles/{id}/locations`, `/vehicles/{id}/stats/historical` * **How to sync**: Use record time parameters (`startAt`/`endAt`) * **Notes**: Requires lookback windows if using for incremental syncing **Real-Time Data**: For current state data like latest vehicle locations, see our [Real-Time Data Guide](/guides/real-time-data). You can also simply poll these endpoints when you need the latest data - this is often the simplest integration approach. *** ## Use Cases ### Continuous Data Replication **Goal**: Keep your data warehouse continuously updated\ **Best for**: Real-time dashboards, operational systems, ongoing analytics #### Step 1: Sync Entities & Records Start with the simple data types using `modifiedAfter`: ```bash theme={null} # Get vehicles modified since last sync curl "https://api.withterminal.com/tsp/v1/vehicles?modifiedAfter=2024-01-15T10:00:00.000Z" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" # Get safety events since last sync curl "https://api.withterminal.com/tsp/v1/safety/events?modifiedAfter=2024-01-15T10:00:00.000Z" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" ``` #### Step 2: Sync Historical Telematics Vehicle locations and stats require special handling with record time parameters: ```bash theme={null} # Get recent vehicle locations (24-48 hour lookback for late-arriving data) curl "https://api.withterminal.com/tsp/v1/vehicles/vcl_123/locations?startAt=2024-01-14T10:00:00.000Z" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" # Get recent vehicle stats curl "https://api.withterminal.com/tsp/v1/vehicles/vcl_123/stats/historical?startAt=2024-01-14T10:00:00.000Z" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" ``` #### Key Points for Steps 1 & 2 * Process all pages using the `cursor` parameter (see [Pagination Guide](/api-reference/pagination)) * Store sync start time before beginning, update only after successful completion * Maintain separate "last sync time" checkpoints for each endpoint * Run endpoint syncs in parallel for optimal performance * Use default page sizes by omitting the `limit` parameter for optimal performance * Apply 24-48 hour lookback windows for vehicle locations and stats * Expect data to be mutable - upsert records to your data store to handle updates * Consider syncing data 1-2 days old to reduce update frequency (especially for locations/stats) #### Step 3: Webhook Integration (Optional) Webhooks are optional but helpful for triggering ingestion when new data is available. Key events for sync triggers: * `sync.completed` - Provider sync finished and data is available through Terminal APIs; trigger your API-based incremental sync * `vehicle.added`, `vehicle.modified` - Sync vehicles endpoint or use event details directly * `safety_event.added`, `safety_event.modified` - Sync safety events endpoint or use event details directly Since there are no ordering guarantees, you can either use the webhook data directly (if order doesn't matter for your use case) or trigger a targeted sync to ensure consistency. See our [Webhooks Guide](/guides/webhooks) for complete event details and setup instructions. *** ### Historical Data Backfills **Goal**: Load historical data for analysis or reporting\ **Best for**: Data science, compliance reporting, one-time analysis projects #### Step 1: Request Historical Sync **For new connections**: Configure historical days during the connection setup process. **For existing connections**: Request a sync with historical data: ```bash theme={null} # Sync historical data for replication curl --request POST \ --url 'https://api.withterminal.com/tsp/v1/syncs' \ --header 'Authorization: Bearer your_secret_key' \ --header 'Connection-Token: con_tkn_your_token' \ --header 'Content-Type: application/json' \ --data '{"startFrom": "2024-01-01T00:00:00.000Z"}' ``` How long a backfill takes depends on the provider, fleet, window, and enabled models. See [Backfill Duration](/guides/backfill-duration). Wait for the sync to complete using one of these methods: * **Webhook**: `connection.first_sync_completed` (for new connections only) * **Webhook**: `sync.completed` (for any sync completion) * **Polling**: `GET /syncs/{id}` or `GET /connections/current` endpoints > [!NOTE] > > Sync completion means data is available through Terminal APIs. For S3/data > delivery destinations, wait for `delivery.completed` before treating delivered > files as complete. #### Step 2: Replicate Historical Data Once the sync completes, query and replicate historical data to your data store: ```bash theme={null} # Safety events for date range curl "https://api.withterminal.com/tsp/v1/safety/events?startedAfter=2024-01-01T00:00:00.000Z&startedBefore=2024-01-31T23:59:59.999Z" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" # Trips for date range curl "https://api.withterminal.com/tsp/v1/trips?startedAfter=2024-01-01T00:00:00.000Z&startedBefore=2024-01-31T23:59:59.999Z" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" # Vehicle locations (use month boundaries for efficiency) curl "https://api.withterminal.com/tsp/v1/vehicles/vcl_123/locations?startAt=2024-01-01T00:00:00.000Z&endAt=2024-01-31T23:59:59.999Z" \ -H "Authorization: Bearer your_secret_key" \ -H "Connection-Token: con_tkn_your_token" ``` **Key Points:** * Process all pages using the `cursor` parameter (see [Pagination Guide](/api-reference/pagination)) * Split large time ranges into smaller chunks (weeks or months) for parallel processing * Use default page sizes by omitting the `limit` parameter for optimal performance * If you plan to use this for ongoing updates, apply lookback windows for late-arriving data * Stream data directly to your data store for efficiency > [!TIP] > > We recommend using an orchestration tool like Airflow, Step Functions, or > Dagster for advanced parallel processing of large historical datasets. ### Complete Data Pipeline (Historical + Continuous) **Goal**: Build a complete data pipeline with historical data plus ongoing updates\ **Best for**: Production data warehouses, comprehensive analytics platforms **Approach**: Start with historical backfill, then switch to continuous replication. #### Step 1: Initial Historical Sync **For new connections**: Configure historical days during the connection setup process. **For existing connections**: Request a sync with historical data: ```bash theme={null} # Request 90 days of historical data curl --request POST \ --url 'https://api.withterminal.com/tsp/v1/syncs' \ --header 'Authorization: Bearer your_secret_key' \ --header 'Connection-Token: con_tkn_your_token' \ --header 'Content-Type: application/json' \ --data '{"days": 90}' # Or specify exact start date curl --request POST \ --url 'https://api.withterminal.com/tsp/v1/syncs' \ --header 'Authorization: Bearer your_secret_key' \ --header 'Connection-Token: con_tkn_your_token' \ --header 'Content-Type: application/json' \ --data '{"startFrom": "2024-01-01T00:00:00.000Z"}' ``` #### Step 2: Replicate Historical Data Use record time access patterns to replicate your historical data to your data store (same approach as [Historical Data Backfills](#historical-data-backfills)). #### Step 3: Switch to Continuous Replication Once historical data is processed, implement the ongoing sync pattern from [Continuous Data Replication](#continuous-data-replication): * Use `modifiedAfter` for most endpoints * Use record time with lookback for vehicle locations/stats * Listen for webhook triggers to enable real-time updates **Key Points:** * Replicate historical data first using record time parameters * Set your "last sync start time" to mark the transition point between historical and ongoing data * Switch to ingestion time patterns for ongoing updates * Consider orchestration tools for complex data pipelines *** ## Understanding the Parameters ### Record Time Parameters These query by when events actually occurred: * **`startAt`/`endAt`**: Time range for vehicle locations and stats (ISO 8601) * **`startedAfter`/`startedBefore`**: Time range for events with duration (ISO 8601) * **`startDay`/`endDay`**: Events from a specific day (YYYY-MM-DD) * **`startMonth`/`endMonth`**: Events from a specific month (YYYY-MM) ### Ingest Time Parameters These query by when Terminal processed the data: * **`modifiedAfter`**: Records modified after this time * **`modifiedBefore`**: Records modified before this time ## Best Practices ### Error Handling & Rate Limits * Implement exponential backoff for retries (start with 1s, double each attempt) * Handle HTTP 429 responses by respecting the `Retry-After` header * Follow our [Rate Limits Guide](/api-reference/rate-limits) for proper throttling * Log failed requests with context for debugging ### Data Replication Efficiency * Process data in batches using pagination cursors and time range chunking * Use default page sizes by omitting the `limit` parameter for optimal performance * Stream data directly to your data store to avoid memory accumulation * Use bulk insert operations for optimal database write performance * Use parallel processing for large historical datasets ### Data Consistency * Store sync timestamps before starting, update only after successful completion * Use database transactions when processing batches * Track progress and resume from failures using pagination cursors or sub-jobs # Terminal Link Source: https://docs.withterminal.com/guides/terminal-link Terminal provides a hosted 'Link' that makes it easy to authenticate with any telematics provider. With only a few steps you will be able to provide customers/partners an easy self-serve flow to connect their telematics account. ![](https://mintcdn.com/terminal-docs/CsBNyIr4mg-Im42C/images/link-component.png?fit=max\&auto=format\&n=CsBNyIr4mg-Im42C\&q=85\&s=040c957b926803e532cf95929e06ec28) ## Adding Your Logo Link shows your logo to every fleet that connects. Manage it yourself in the Dashboard. 1. Open [Settings > Branding](https://dashboard.withterminal.com/settings?category=branding). 2. Choose **Upload a logo** and pick a PNG, JPEG, or WebP up to 3 MB. The Dashboard trims empty space around the artwork and shows a preview before you upload. 3. Use it as your **default logo**. Link shows the default unless a [Consent Template](/guides/consent-templates) chooses its own. Your logo library keeps every logo you upload. You can replace a logo's image, change which one is the default, or delete one you no longer use. A logo that is still in use can only be deleted once the templates that chose it switch to another logo, which the Dashboard offers to do for you. Members, developers, and admins can manage logos. Viewers can see them but not change them. ## Accessing Terminal Link Terminal Link is a user-friendly, hosted page designed to facilitate authentication with any telematics provider. It provides a simple, self-serve flow for customers or partners to connect their telematics accounts. You have two options to integrate Terminal Link into your application: 1. Directly link to the hosted page. 2. Embed it within your application using one of our SDKs. > [tab] React SDK > > Terminal provides a React hook that makes it easy to embed the link in your application. > > View the package on NPM here: [`@terminal-api/link-react`](https://www.npmjs.com/package/@terminal-api/link-react) > > ### Installation > > ```bash theme={null} > npm install @terminal-api/link-react > ``` > > ### Cross-Origin-Opener-Policy Header > > If your application sends a `Cross-Origin-Opener-Policy` (COOP) header, set it > to: > > ```http theme={null} > Cross-Origin-Opener-Policy: same-origin-allow-popups > ``` > > This setting allows Terminal Link to communicate with provider OAuth popups > during authentication. > > ### Usage > > #### Creating a Connection > > Terminal handles capturing, validating and securely storing customer's credentials to ensure that each TSP integration is as consistent as possible. > > Here's an overview of the steps involved when using the React hook: > > **Steps** > > 1. Initialize auth link with desired options (see available options below) > 2. Open link and wait for user to complete authentication > 3. Handle `onSuccess` callback and exchange public token for a connection token on your backend using [`POST /tsp/v1/public-token/exchange`](/api-reference/authentication/public-token-exchange) > > #### Re-Authenticating a Connection > > In certain scenarios, connections may become disconnected. This can occur when customers modify their password or withdraw access. > > In such cases, Terminal updates the Connection status to `disconnected` and prompts you to reauthenticate the customer's TSP to continue syncing. > > The reauthentication process mirrors the link flow, but requires the `connectionId` parameter to specify which connection needs to be updated. > > #### Examples > > ```tsx Create a Connection theme={null} > import { useCallback } from 'react'; > import { useTerminalLink } from '@terminal-api/link-react'; > > const MyComponent = () => { > const api = useYourBackendApi(); > > // if you are defining the function inside the component > // make sure to wrap it in useCallback > const exchangeToken = useCallback( > async ({ publicToken }: { publicToken: string }) => { > // Send the public token to your backend to exchange for a connection token > // and store it in your database. > return await api.post('/api/terminal', { publicToken }); > }, > [api], > ); > > const terminal = useTerminalLink({ > // production or sandbox publishable key from the Terminal dashboard > publishableKey: process.env.REACT_APP_TERMINAL_PUBLISHABLE_KEY, > onSuccess: exchangeToken, > params: { > // optional parameters > externalId: 'my-external-id', > }, > }); > > return ( >
> > > > >
> ); > }; > > export default MyComponent; > ``` > > ```tsx Re-authenticate a Connection theme={null} > import React from 'react'; > import { useTerminalLink } from '@terminal-api/link-react'; > > const MyComponent = ({ onSuccess }: { onSuccess: () => void }) => { > const terminal = useTerminalLink({ > // production or sandbox publishable key from the Terminal dashboard > publishableKey: process.env.REACT_APP_TERMINAL_PUBLISHABLE_KEY, > connectionId: 'conn_01GSKTHCD24NRZ2SBJTPZBCQ1R', > onSuccess, // token exchange is optional for re-authentication > }); > > return ( > > ); > }; > > export default MyComponent; > ``` > > ### Available Options > > The link SDK provides a number of options to customize the behavior of the link. > > **publishableKey** `string` *required* > > Your publishable key. > > **connectionId** `string` > > Optional connection ID to update. If not provided, a new connection will be > created. > > **linkBaseUrl** `string` > > Base URL for the link. Defaults based on the publishable key (production or > sandbox). > > **onSuccess** `(data: \{ publicToken: string \}) =\> void` > > Called when link is successfully completed. > > **onExit** `() =\> void` > > Called when the link is exited by the user. > > **onOpen** `() =\> void` > > Called when the link is opened. > > **onClose** `() =\> void` > > Called when the link is closed. > > **params** `Link Parameters` > > **params** > > **syncMode** `'automatic' | 'manual'` > > Optional override for the sync mode. Defaults to account's default sync mode. > > **company** `Company` > > **company** > > **name** `string` > > Name of the company to associate with the connection. > > **externalId** `string` > > Optional external ID to associate with the connection (e.g., your organization ID). You can learn more about External IDs [here](/guides/custom-identifiers). > > **tags** `string[]` > > A list of tags that can be used to associate searchable references or categories to your connections. (e.g., `['organizationId', 'Business Unit A']`). You can learn more about tags [here](/guides/custom-identifiers). > > **provider** `string` > > Filters the providers shown in Link to the specified provider code (e.g., `geotab`). Must be a supported provider code. > > **providerHints** `string[]` > > Moves the specified providers to the top of Link’s provider selection list. Each value must be a supported provider code (e.g., `geotab`). > > **backfill** `Backfill Config` > > **backfill** > > **days** `number` > > Number of days for backfill. Defaults to 0. > > **startFrom** `string` > > Date to start backfilling from. Defaults to current date. > > **template** `string` > > Optional template ID to apply to the connection. If provided, the template's > settings will be used for branding, custom agreements, and default values. > Learn more in the [Consent Templates guide](/guides/consent-templates). > [tab] JS SDK > > Terminal provides a javascript SDK that makes it easy to embed the link in your application. > > View the package on NPM here: [`@terminal-api/link-sdk`](https://www.npmjs.com/package/@terminal-api/link-sdk) > > ### Installation > > **NPM** > > ```bash theme={null} > npm install @terminal-api/link-sdk > ``` > > **Script Tag** > > ```html theme={null} >