{
  "info": {
    "name": "TrackMind API",
    "description": "REST API for integrating with the TrackMind GPS platform.\n\nDocs: https://app.trackmind.ru/docs/api\nSwagger UI: https://app.trackmind.ru/docs/swagger",
    "version": "1.0.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.trackmind.ru",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "tm_your_key_here",
      "type": "string",
      "description": "Create your key in Settings -> API -> Create Key"
    },
    {
      "key": "vehicleId",
      "value": "",
      "type": "string",
      "description": "Vehicle UUID"
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Vehicles",
      "item": [
        {
          "name": "List vehicles",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/vehicles",
              "host": ["{{baseUrl}}"],
              "path": ["vehicles"]
            },
            "description": "Returns all vehicles with their last known positions."
          }
        },
        {
          "name": "Get vehicle",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/vehicles/{{vehicleId}}",
              "host": ["{{baseUrl}}"],
              "path": ["vehicles", "{{vehicleId}}"]
            }
          }
        },
        {
          "name": "Last position",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/vehicles/{{vehicleId}}/last",
              "host": ["{{baseUrl}}"],
              "path": ["vehicles", "{{vehicleId}}", "last"]
            },
            "description": "Returns coordinates only, without vehicle metadata."
          }
        }
      ]
    },
    {
      "name": "Track History",
      "item": [
        {
          "name": "Route history",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/vehicles/{{vehicleId}}/track?from=2026-06-01T00:00:00Z&to=2026-06-01T23:59:59Z&min_stop=5",
              "host": ["{{baseUrl}}"],
              "path": ["vehicles", "{{vehicleId}}", "track"],
              "query": [
                { "key": "from", "value": "2026-06-01T00:00:00Z", "description": "Period start (ISO 8601 UTC)" },
                { "key": "to",   "value": "2026-06-01T23:59:59Z", "description": "Period end. Max 31 days." },
                { "key": "min_stop", "value": "5", "description": "Minimum stop duration (minutes)" },
                { "key": "interpolate", "value": "0", "description": "Set to 1 to interpolate signal gaps", "disabled": true }
              ]
            },
            "description": "Coordinates, stops and statistics. Maximum period: 31 days."
          }
        }
      ]
    },
    {
      "name": "Geofences",
      "item": [
        {
          "name": "List geofences",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/geofences",
              "host": ["{{baseUrl}}"],
              "path": ["geofences"]
            }
          }
        },
        {
          "name": "Get geofence",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/geofences/:id",
              "host": ["{{baseUrl}}"],
              "path": ["geofences", ":id"],
              "variable": [{ "key": "id", "value": "" }]
            }
          }
        },
        {
          "name": "Geofence events",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/geofences/events?from=2026-06-01T00:00:00Z&to=2026-06-01T23:59:59Z&limit=200",
              "host": ["{{baseUrl}}"],
              "path": ["geofences", "events"],
              "query": [
                { "key": "from",        "value": "2026-06-01T00:00:00Z" },
                { "key": "to",          "value": "2026-06-01T23:59:59Z" },
                { "key": "geofence_id", "value": "", "disabled": true, "description": "Filter by geofence UUID" },
                { "key": "vehicle_id",  "value": "", "disabled": true, "description": "Filter by vehicle UUID" },
                { "key": "limit",       "value": "200", "description": "Max 1000" }
              ]
            },
            "description": "Entry/exit event history with filtering."
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List webhooks",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/webhooks",
              "host": ["{{baseUrl}}"],
              "path": ["webhooks"]
            }
          }
        },
        {
          "name": "Create webhook",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://your-server.com/webhook\",\n  \"secret\": \"your-secret-key\",\n  \"events\": [\"position\", \"geofence.enter\", \"geofence.exit\"]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/webhooks",
              "host": ["{{baseUrl}}"],
              "path": ["webhooks"]
            },
            "description": "Requires scope `full`."
          }
        },
        {
          "name": "Update webhook",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": true,\n  \"events\": [\"geofence.enter\", \"geofence.exit\"]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/webhooks/:id",
              "host": ["{{baseUrl}}"],
              "path": ["webhooks", ":id"],
              "variable": [{ "key": "id", "value": "" }]
            }
          }
        },
        {
          "name": "Send test request",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{baseUrl}}/webhooks/:id/test",
              "host": ["{{baseUrl}}"],
              "path": ["webhooks", ":id", "test"],
              "variable": [{ "key": "id", "value": "" }]
            },
            "description": "Sends a test payload to the webhook URL."
          }
        },
        {
          "name": "Delete webhook",
          "request": {
            "method": "DELETE",
            "url": {
              "raw": "{{baseUrl}}/webhooks/:id",
              "host": ["{{baseUrl}}"],
              "path": ["webhooks", ":id"],
              "variable": [{ "key": "id", "value": "" }]
            }
          }
        }
      ]
    },
    {
      "name": "API Keys",
      "item": [
        {
          "name": "List API keys",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api-keys",
              "host": ["{{baseUrl}}"],
              "path": ["api-keys"]
            }
          }
        },
        {
          "name": "Create API key",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"CRM Integration\",\n  \"scope\": \"read\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api-keys",
              "host": ["{{baseUrl}}"],
              "path": ["api-keys"]
            },
            "description": "Full key is shown only once - save it immediately."
          }
        },
        {
          "name": "Revoke API key",
          "request": {
            "method": "DELETE",
            "url": {
              "raw": "{{baseUrl}}/api-keys/:id",
              "host": ["{{baseUrl}}"],
              "path": ["api-keys", ":id"],
              "variable": [{ "key": "id", "value": "" }]
            }
          }
        }
      ]
    }
  ]
}
