Skip to main content
GET
/
v1
/
users
/
{userId}
/
trips
/
history
curl "https://api.bookovia.com/v1/users/86927352-9739-4317-980c-59dfbb6059eb/trips/history" \
  -H "X-API-Key: bkv_test_your_api_key"
{
  "success": true,
  "data": {
    "trips": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "org_id": "org_123456",
        "vehicle_id": "16128b9d-5356-48a8-b9e0-be1a9b904c6f",
        "user_id": "86927352-9739-4317-980c-59dfbb6059eb",
        "status": "completed",
        "purpose": "business",
        "start_time": "2026-04-17T10:30:00Z",
        "end_time": "2026-04-17T11:45:00Z",
        "duration_seconds": 4500,
        "distance_meters": 42700,
        "created_at": "2026-04-17T10:30:00Z"
      },
      {
        "id": "b2c3d4e5-f6g7-8901-bcde-f23456789012",
        "org_id": "org_123456",
        "vehicle_id": "16128b9d-5356-48a8-b9e0-be1a9b904c6f",
        "user_id": "86927352-9739-4317-980c-59dfbb6059eb",
        "status": "completed",
        "purpose": "personal",
        "start_time": "2026-04-16T14:20:00Z",
        "end_time": "2026-04-16T15:05:00Z",
        "duration_seconds": 2700,
        "distance_meters": 18300,
        "created_at": "2026-04-16T14:20:00Z"
      }
    ],
    "count": 2,
    "filter": "completed"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.bookovia.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Fetches trip history for a specific user. Defaults to completed trips, with optional status filtering. Returns up to 100 trips ordered by start time (newest first).

Path Parameters

userId
string
required
The unique identifier for the user whose trip history you want to retrieve

Query Parameters

status
string
Filter trips by status. If not provided, defaults to “completed”. Valid values: “completed”, “cancelled”, “recording”, “paused”

Headers

X-API-Key
string
required
Your API key for authentication starting with bkv_

Response

success
boolean
Indicates if the request was successful
data
object
Response data object
curl "https://api.bookovia.com/v1/users/86927352-9739-4317-980c-59dfbb6059eb/trips/history" \
  -H "X-API-Key: bkv_test_your_api_key"
{
  "success": true,
  "data": {
    "trips": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "org_id": "org_123456",
        "vehicle_id": "16128b9d-5356-48a8-b9e0-be1a9b904c6f",
        "user_id": "86927352-9739-4317-980c-59dfbb6059eb",
        "status": "completed",
        "purpose": "business",
        "start_time": "2026-04-17T10:30:00Z",
        "end_time": "2026-04-17T11:45:00Z",
        "duration_seconds": 4500,
        "distance_meters": 42700,
        "created_at": "2026-04-17T10:30:00Z"
      },
      {
        "id": "b2c3d4e5-f6g7-8901-bcde-f23456789012",
        "org_id": "org_123456",
        "vehicle_id": "16128b9d-5356-48a8-b9e0-be1a9b904c6f",
        "user_id": "86927352-9739-4317-980c-59dfbb6059eb",
        "status": "completed",
        "purpose": "personal",
        "start_time": "2026-04-16T14:20:00Z",
        "end_time": "2026-04-16T15:05:00Z",
        "duration_seconds": 2700,
        "distance_meters": 18300,
        "created_at": "2026-04-16T14:20:00Z"
      }
    ],
    "count": 2,
    "filter": "completed"
  }
}

Use Cases

  • Trip Analytics: Analyze user driving patterns and behavior
  • Expense Tracking: Calculate total mileage for reimbursement
  • Performance Review: Review driver efficiency and compliance
  • Reporting: Generate user-specific trip reports

Important Notes

  • Defaults to status=completed if no status filter provided
  • Maximum 100 trips returned per request
  • Results are ordered by start_time DESC (newest first)
  • Empty array returned if user has no matching trips
  • Requires valid API key with bkv_ prefix

Status Filter Options

StatusDescription
completedTrips that have been successfully completed (default)
cancelledTrips that were cancelled before completion
recordingTrips currently in progress
pausedTrips that are temporarily paused

Error Responses

401 Unauthorized
{
  "success": false,
  "error": "API key required"
}
401 Invalid API Key
{
  "success": false,
  "error": "Invalid API key format"
}
500 Server Error
{
  "success": false,
  "error": "Failed to fetch trip history"
}