Skip to main content

PMaaS API

Integrate Vehk data into your own systems.

Authentication​

All API requests require a Vehk API key (starting with vehk_). You can pass it in either the HTTP Header or as a URL Query Parameter:

X-API-Key: vehk_live_abcdef1234567890...

(Also supports Authorization: Bearer vehk_...)

Option 2: URL Query Parameter​

GET https://api.vehk.in/api/external/devices/locations?X-API-Key=vehk_live_abcdef1234567890...

Get Your API Key​

  1. Dashboard (https://axle.vehk.in) → Settings → API Keys
  2. Click "Create New Key"
  3. Select your permission scopes (e.g., telemetry:read, telemetry:write, devices:read, vehicles:read, predict)
  4. Copy immediately (shown only once)

Format: vehk_live_... or vehk_...


Base URL​

Production API endpoints:

EnvironmentBase URL
Production APIhttps://api.vehk.in
External Fleet APIhttps://api.vehk.in/api/external
Dashboardhttps://axle.vehk.in
API Documentation

Full interactive API documentation (Swagger) is available at your API base URL + /docs

Permission Scopes​

Supported permission scopes for API keys:

  • telemetry:write / telemetry:read
  • tracking:write / tracking:read
  • predict
  • vehicles:read / vehicles:write
  • devices:read / devices:write
  • sub_clients:read / sub_clients:manage (Reseller & White-Label platform)
  • * (Full access)

Reseller & Sub-Client Platform API​

If you are a reseller or white-label partner managing multiple downstream fleets (e.g., Client Alpha, Client Beta), use the Reseller Platform API to programmatically manage sub-clients, provision devices, register vehicles, and query partitioned telemetry and predictions.

See the dedicated Reseller & Sub-Client Platform Guide for full API specs, code samples, and workflow guides.

Common Endpoints​

List Vehicles​

GET /vehicles

Response:

{
"vehicles": [
{
"id": "MH01AB1234",
"vin": "1HGBH41JXMN109186",
"make": "Tata",
"model": "LPT 1518",
"healthScore": 87.5
}
]
}

Get Vehicle Health​

GET /vehicles/{id}/health

Response:

{
"vehicleId": "MH01AB1234",
"healthScore": 87.5,
"components": {
"engine": 92,
"transmission": 85,
"brakes": 78
},
"alerts": []
}

Get Predictions​

GET /predictions?vehicleId={id}

Response:

{
"predictions": [
{
"vehicleId": "MH01AB1234",
"component": "battery",
"issue": "Voltage degradation detected",
"rul_days": 45,
"confidence": 0.87,
"severity": "medium"
}
]
}

Get Alerts​

GET /alerts?severity=critical

Response:

{
"alerts": [
{
"id": "alert_123",
"vehicleId": "MH01AB1234",
"severity": "critical",
"message": "Engine overheating detected",
"timestamp": "2026-01-12T10:00:00Z"
}
]
}

Ingest Telemetry Data​

Push vehicle telemetry data to Vehk:

Via REST API​

POST /telemetry
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

Request Body:

{
"vehicleId": "MH01AB1234",
"timestamp": "2026-01-13T10:00:00Z",
"engine_speed": 2400,
"coolant": 92,
"battery_voltage": 13.2,
"vehicleSpeed": 65
}

Via Kafka​

For high-volume streaming, use Kafka integration:

  1. Go to Settings → Kafka Config in the dashboard
  2. Configure your Kafka broker connection
  3. Publish telemetry messages to the configured topic

Rate Limits​

PlanRate Limit
Starter100,000 calls/month
ProfessionalUnlimited
EnterpriseUnlimited

Webhooks​

Receive real-time notifications:

Setup​

  1. Dashboard → Settings → Webhooks
  2. Add endpoint URL
  3. Select events to receive

Events​

EventDescription
vehicle.health.changedHealth score changed significantly
alert.createdNew alert generated
prediction.createdNew maintenance prediction
maintenance.completedMaintenance marked complete

Example Payload:

{
"event": "alert.created",
"timestamp": "2026-01-13T10:00:00Z",
"data": {
"vehicleId": "MH01AB1234",
"severity": "critical",
"message": "Brake failure predicted in 7 days"
}
}

Code Examples​

Python​

import requests

API_KEY = "vehk_your_api_key_here"
BASE_URL = "https://api.vehk.in/api/external"

headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}

# 1. Get all vehicle live locations & telemetry
response = requests.get(f"{BASE_URL}/devices/locations", headers=headers)
locations = response.json()

# 2. Get single vehicle location
response = requests.get(f"{BASE_URL}/vehicles/MH01AB1234/location", headers=headers)
vehicle_loc = response.json()

JavaScript / TypeScript​

const API_KEY = 'vehk_your_api_key_here';
const BASE_URL = 'https://api.vehk.in/api/external';

const headers = {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
};

// 1. Get all vehicle live locations & telemetry
const response = await fetch(`${BASE_URL}/devices/locations`, { headers });
const data = await response.json();

// 2. Get single vehicle location
const vehicleRes = await fetch(`${BASE_URL}/vehicles/MH01AB1234/location`, { headers });
const vehicleLoc = await vehicleRes.json();

cURL​

# Using Header
curl -X GET "https://api.vehk.in/api/external/devices/locations" \
-H "X-API-Key: vehk_your_api_key_here"

# Using Query Parameter (useful for quick browser or Postman checks)
curl -X GET "https://api.vehk.in/api/external/devices/locations?X-API-Key=vehk_your_api_key_here"

Error Handling​

All errors return JSON:

{
"error": {
"code": "invalid_api_key",
"message": "The API key provided is invalid"
}
}

Common Errors:

StatusCodeDescription
400invalid_requestMalformed request
401invalid_api_keyAPI key is invalid or missing
404not_foundResource not found
429rate_limit_exceededToo many requests
500server_errorInternal server error

Next Steps​