API Documentation

Integrate GPS tracking into your applications

Version 2.0.0 | Last updated: March 17, 2026

Your API Credentials

Login to view your API credentials

Getting Started

The Track2Secure247 API allows you to integrate real-time GPS tracking, location history, geofencing, and alerts into your own applications. Our RESTful API uses standard HTTP methods and returns JSON responses.

Base URL

https://api.track2secure.com/v2

Quick Example

// Get last known location for a device
curl -X GET https://api.track2secure.com/v2/devices/12345/last-location \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Authentication

All API requests require authentication using your API key. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Never expose your API key in client-side code. Use server-side proxies for mobile or web apps.

Rate Limits

Plan Requests per Minute Requests per Day
Free3010,000
Professional120100,000
EnterpriseUnlimitedUnlimited

Rate limit headers are included in all responses: X-RateLimit-Limit, X-RateLimit-Remaining

Devices API

GET /devices

Get all devices for authenticated user

Parameters:

  • status (optional) - Filter by status: active/inactive/maintenance
  • limit (optional) - Number of results (default: 20, max: 100)
  • page (optional) - Page number for pagination

Response:

{
  "status": "success",
  "data": [
    {
      "id": "dev_12345",
      "name": "Fleet Truck #1",
      "model": "GT-1000",
      "status": "active",
      "battery_level": 87,
      "last_location": {
        "lat": 40.7128,
        "lng": -74.0060,
        "timestamp": "2026-03-17T10:30:00Z"
      }
    }
  ],
  "pagination": {
    "total": 45,
    "page": 1,
    "limit": 20,
    "pages": 3
  }
}
GET /devices/{device_id}

Get detailed information about a specific device

PUT /devices/{device_id}

Update device information

Request Body:

{
  "name": "Updated Device Name",
  "custom_fields": {
    "driver": "John Doe",
    "department": "Logistics"
  }
}

Locations API

GET /devices/{device_id}/last-location

Get the most recent location for a device

{
  "status": "success",
  "data": {
    "device_id": "dev_12345",
    "lat": 40.7128,
    "lng": -74.0060,
    "altitude": 15.2,
    "speed": 45.5,
    "heading": 270,
    "accuracy": 3.5,
    "battery": 87,
    "timestamp": "2026-03-17T10:30:00Z"
  }
}
POST /devices/{device_id}/locations

Report a new location (used by device firmware)

Request Body:

{
  "lat": 40.7128,
  "lng": -74.0060,
  "altitude": 15.2,
  "speed": 45.5,
  "heading": 270,
  "accuracy": 3.5,
  "battery": 87,
  "timestamp": "2026-03-17T10:30:00Z"
}

Geofences API

POST /geofences

Create a new geofence

{
  "name": "Warehouse Zone",
  "type": "circle", // or "polygon"
  "radius": 500, // meters, for circle type
  "center": { "lat": 40.7128, "lng": -74.0060 }, // for circle
  "vertices": [ // for polygon
    { "lat": 40.7128, "lng": -74.0060 },
    { "lat": 40.7234, "lng": -74.0156 }
  ],
  "devices": ["dev_12345", "dev_67890"],
  "alerts": {
    "on_entry": true,
    "on_exit": true,
    "notify_email": ["security@example.com"],
    "notify_sms": ["+1234567890"]
  }
}
GET /geofences/{geofence_id}/events

Get entry/exit events for a geofence

Alerts API

GET /alerts

Get recent alerts with optional filters

Parameters:

  • type - speed, geofence, battery, sos, maintenance
  • device_id - Filter by specific device
  • from - Start date (ISO 8601)
  • to - End date (ISO 8601)
  • read - true/false filter by read status
PATCH /alerts/{alert_id}/acknowledge

Mark an alert as read/acknowledged

Location History API

GET /devices/{device_id}/history

Get location history for a device

Parameters:

  • from (required) - Start date (ISO 8601)
  • to (required) - End date (ISO 8601)
  • resolution - low/medium/high (affects point density)
  • format - json or polyline (for map display)
{
  "status": "success",
  "data": {
    "device_id": "dev_12345",
    "from": "2026-03-17T00:00:00Z",
    "to": "2026-03-17T23:59:59Z",
    "points": [
      {
        "lat": 40.7128,
        "lng": -74.0060,
        "timestamp": "2026-03-17T08:00:00Z",
        "speed": 0,
        "odometer": 12345.6
      }
    ],
    "summary": {
      "total_distance": 124.5,
      "max_speed": 75.2,
      "avg_speed": 45.3,
      "idle_time": 3600,
      "moving_time": 7200
    }
  }
}

Webhooks

Receive real-time notifications when events occur. Configure webhooks in your dashboard to receive HTTP POST requests.

Event Types

location.updated

Device location changed

geofence.entered

Device entered geofence

geofence.exited

Device exited geofence

speed.alert

Speed threshold exceeded

battery.low

Battery below 15%

device.online

Device came online

Webhook Payload Example

{
  "event": "geofence.entered",
  "timestamp": "2026-03-17T10:30:00Z",
  "data": {
    "device_id": "dev_12345",
    "device_name": "Fleet Truck #1",
    "geofence_id": "gf_67890",
    "geofence_name": "Warehouse Zone",
    "location": {
      "lat": 40.7128,
      "lng": -74.0060
    }
  }
}

Error Codes

Code Description Example
400Bad RequestInvalid parameters
401UnauthorizedMissing or invalid API key
403ForbiddenAccess to resource denied
404Not FoundDevice or resource not found
429Rate LimitToo many requests
500Server ErrorInternal server error

All errors return a JSON object with status: "error" and a message field.

SDKs & Libraries

Code Examples

curl -X GET "https://api.track2secure.com/v2/devices" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

API Changelog

Version 2.0.0 March 1, 2026

  • Added geofencing API endpoints
  • Improved rate limiting with headers
  • Deprecated v1 endpoints

Version 1.5.0 Jan 15, 2026

  • Added webhook support
  • Batch location updates