API reference

Three calls to your first device list.

Sign in, create a token, send it as a bearer token. Below that: every endpoint for your own devices, positions, reports, geofences, alerts, commands and care profiles.

Choose a package in the portal; you see the first invoice before you confirm.

POST/api/sessionSign in200Set-Cookie: tracker_session1POST/api/session/tokenCreate a token200the token, as text2GET/api/devices?limit=20List your devices200[{ "id": 12, "name": "Van 12" }, …]3

Quick start

Sign in, create a token, list your devices

Three steps with curl. Replace YOUR_HOST with the address of your Alongpin account.

  1. Sign in

    The server sets a session cookie. Accounts with two-factor sign-in send a code with the password; HTTP Basic does not work for those accounts.

    curl -s -c cookies.txt \
      -d 'email=you@example.com&password=YOUR_PASSWORD' \
      https://YOUR_HOST/api/session > /dev/null
  2. Ask for an API token with that session

    Tokens last up to 365 days (7 by default) and can be revoked.

    TOKEN=$(curl -s -b cookies.txt -X POST https://YOUR_HOST/api/session/token)
  3. Send the token as a bearer token

    Every call has exactly the rights of the user who made the token. Here: list your devices.

    curl -H "Authorization: Bearer $TOKEN" "https://YOUR_HOST/api/devices?limit=20"

On this installation the API is served at https://app.alongpin.com/api.

Access

The API cannot do more than you can

Every call is checked against the account that made the token: its roles, the devices it owns or is shared, and its read-only flag. Keep a token for one integration, give it a user with a narrow role, and revoke it when you no longer need it.

The last column of each table below names the right a user with roles needs, as service:object:read or :write, with a scope that covers the object. Users without roles read what is theirs or shared with them and change what they own.

How roles and the audit log work
  • Create a dedicated user and a role that grants only what the integration needs
  • A read-only user gets a read-only token
  • Share links give a temporary read-only user, with an end date and an optional PIN
  • Every request that changes something is in the audit log; secrets are never written to it

Reference

Endpoints by resource

The endpoints for the things your account tracks. Paths are relative to your host; bodies and answers are JSON unless a row says otherwise.

Session and API tokens

A token is made by a signed-in user and carries that user’s rights. There is no endpoint that lists tokens: store the token when you create it, and revoke it when the integration ends.

Session and API tokens: endpoints
EndpointWhat it doesMain fieldsNeeds
POST /api/sessionSign in; sets the session cookieForm or JSON: email, password, code (accounts with two-factor sign-in), rememberYour credentials
GET /api/sessionThe signed-in user; 404 when not signed inSigned in
DELETE /api/sessionSign outSigned in
POST /api/session/tokenCreate an API token; the answer is the token as textexpiration (an ISO-8601 instant, optional)Signed in
POST /api/session/token/revokeRevoke a token; 204Form: tokenYour own token

Devices

Trackers, watches, phones and dashcams. A device is identified to the platform by its uniqueId (usually the IMEI). Other settings live in its attributes map.

Devices: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/devicesList the devices you can readid, uniqueId, keyword, limit, offset, excludeAttributesdevice:device:read
POST /api/devicesAdd a device, within your device limitname, uniqueId, groupId, category, model, phone, contact, attributesdevice:device:write
GET /api/devices/{id}Read one device, with its status and last updatedevice:device:read
PUT /api/devices/{id}Change a device; send the whole objectAs for creating, plus iddevice:device:write
DELETE /api/devices/{id}Delete a devicedevice:device:write
GET /api/devices/{id}/attributes/effectiveThe device’s attributes, including those inherited from its groupskeysdevice:device:read
PUT /api/devices/{id}/accumulatorsSet the odometer and engine hourstotalDistance (metres), hours (milliseconds)device:device:write
GET /api/devices/{id}/privacyThe device’s privacy status: private trip switch and working hoursdevice:device:read
Add a device
curl -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"name": "Van 1", "uniqueId": "864000000000001"}' \
  https://YOUR_HOST/api/devices

# 200: the device as stored
# {"id": 1, "name": "Van 1", "uniqueId": "864000000000001", "status": "…", "attributes": {}, …}

Device groups

Groups hold devices and other groups (a depot, a team). Objects linked to a group apply to every device in it.

Device groups: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/groupsList the groups you can readkeyword, limit, offset, excludeAttributesdevice:group:read
POST /api/groupsCreate one; answers it with its idname, groupId (the parent group), attributesdevice:group:write
GET /api/groups/{id}Read onedevice:group:read
PUT /api/groups/{id}Change one; send the whole objectname, groupId (the parent group), attributesdevice:group:write
DELETE /api/groups/{id}Delete onedevice:group:write

Positions, live and historical

One endpoint answers the latest position and the history, depending on the parameters. Speed is in knots; from and to are inclusive ISO-8601 instants. Private trips arrive reduced and marked private.

Positions, live and historical: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/positionsThe latest position of every device you can readtracking:position:read
GET /api/positionsThe latest position of one devicedeviceIdtracking:position:read
GET /api/positionsHistory of a device, oldest firstdeviceId, from, to; optional geofenceId; a page with limit (1 to 10000) and offsettracking:position:read
GET /api/positionsPositions by idid (repeatable)tracking:position:read
GET /api/positions/countHow many positions the history would answer, per devicedeviceId (repeatable), from, totracking:position:read
GET /api/positions/{csv|gpx|kml|kmz}History as a file, one track per devicedeviceId (repeatable), from, to; optional geofenceId, timezonetracking:position:read on every device
DELETE /api/positionsDelete history of a device; 204deviceId, from, totracking:position:write from a role
One day of history
curl -H "Authorization: Bearer $TOKEN" \
  "https://YOUR_HOST/api/positions?deviceId=1&from=2026-09-26T00:00:00Z&to=2026-09-27T00:00:00Z"

# 200: a list of positions
# [{"id": …, "deviceId": 1, "fixTime": "…", "latitude": …, "longitude": …,
#   "speed": …, "course": …, "address": "…", "attributes": {…}}, …]

Events and alarms

What happened to a device: geofence enter and exit, overspeed, alarms such as SOS, device offline, maintenance due. Acknowledging an alarm records who handled it and when; the first acknowledgement wins.

Events and alarms: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/eventsEvents of devices or of a geofence, oldest firstdeviceId (repeatable), from, to; optional type (repeatable), geofenceId, acknowledgedtracking:event:read
GET /api/events/{id}Read one eventtracking:event:read
POST /api/events/{id}/acknowledgeAcknowledge an event; answers it with acknowledgedBy and acknowledgedAtNo bodytracking:event:read, not a read-only user
GET /api/events/unseenHow many events you have not seen yetOptional type, alarm, deviceId, groupIdtracking:event:read
POST /api/events/{id}/seenMark an event as seen (DELETE marks it unseen again)tracking:event:read
POST /api/events/seenMark every event up to a time as seenuntiltracking:event:read

Reports and exports

Reports are computed from positions and events for a period. Each answers JSON by default, CSV with Accept: text/csv, and Excel from the /xlsx address. Distance is in metres, durations in milliseconds, fuel in litres.

Reports and exports: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/reports/routeEvery position of the perioddeviceId or groupId (repeatable), from, to; limit, offsetreport:report:read for each device
GET /api/reports/tripsTrips with distance, speeds, duration and driverdeviceId or groupId, from, to; optional driverUniqueIdreport:report:read
GET /api/reports/stopsStops with place and durationAs tripsreport:report:read
GET /api/reports/summaryTotals per device: distance, speeds, engine hours, fueldeviceId or groupId, from, to; dailyreport:report:read
GET /api/reports/eventsEvents of the periodAs trips, plus type (repeatable); limit, offsetreport:report:read
GET /api/reports/idleStanding time with the engine ondeviceId or groupId, from, toreport:report:read
GET /api/reports/geofencesVisits to geofencesdeviceId or groupId, from, to; optional geofenceIdreport:report:read
GET /api/reports/combinedRoute, events and positions togetherAs tripsreport:report:read
GET /api/reports/wellnessThe wellness reportdeviceId or groupId, from, toreport:report:read
GET /api/reports/{report}/xlsxThe same report as an Excel fileAs the reportreport:report:read
GET /api/reports/{report}/mailThe same report sent by emailAs the reportreport:report:read
GET /api/reportsList the scheduled reports you can readkeyword, limit, offset, excludeAttributesreport:scheduledReport:read
POST /api/reportsCreate one; answers it with its idtype, description, calendarId, attributesreport:scheduledReport:write
GET /api/reports/{id}Read onereport:scheduledReport:read
PUT /api/reports/{id}Change one; send the whole objecttype, description, calendarId, attributesreport:scheduledReport:write
DELETE /api/reports/{id}Delete onereport:scheduledReport:write
A month of trips as CSV
curl -H "Authorization: Bearer $TOKEN" -H 'Accept: text/csv' \
  "https://YOUR_HOST/api/reports/trips?deviceId=1&from=2026-09-01T00:00:00Z&to=2026-09-27T00:00:00Z"

# As JSON, each trip carries among others:
# deviceId, deviceName, startTime, endTime, startAddress, endAddress,
# distance, averageSpeed, maxSpeed, duration, idleDuration, driverName, spentFuel

Geofences

Zones on the map. The area is written as text, a circle or a polygon. A geofence raises events only for the devices or groups it is linked to.

Geofences: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/geofencesList the geofences you can readdeviceId, groupId, keyword, limit, offset, excludeAttributesdevice:geofence:read
POST /api/geofencesCreate one; answers it with its idname, description, area, calendarId, attributesdevice:geofence:write
GET /api/geofences/{id}Read onedevice:geofence:read
PUT /api/geofences/{id}Change one; send the whole objectname, description, area, calendarId, attributesdevice:geofence:write
DELETE /api/geofences/{id}Delete onedevice:geofence:write
POST /api/permissionsLink a geofence or an alert rule to a device or group (DELETE with the same body removes the link)A pair, for example deviceId and geofenceId, or groupId and notificationIddevice:permission:write
A circle of 250 metres, linked to device 1
curl -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"name": "Depot", "area": "CIRCLE (52.52 13.40, 250)"}' \
  https://YOUR_HOST/api/geofences

curl -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"deviceId": 1, "geofenceId": 1}' \
  https://YOUR_HOST/api/permissions

Alert rules

A rule names an event type and the channels that carry it. The types and channels your installation offers are answered by the API, so read them before you write a rule.

Alert rules: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/notificationsList the alert rules you can readdeviceId, groupId, keyword, limit, offset, excludeAttributesnotification:notification:read
POST /api/notificationsCreate one; answers it with its idtype, notificators (channels, comma-separated), always (every device), calendarId, commandId, description, attributesnotification:notification:write
GET /api/notifications/{id}Read onenotification:notification:read
PUT /api/notifications/{id}Change one; send the whole objecttype, notificators (channels, comma-separated), always (every device), calendarId, commandId, description, attributesnotification:notification:write
DELETE /api/notifications/{id}Delete onenotification:notification:write
GET /api/notifications/typesThe event types a rule can nameSigned in
GET /api/notifications/notificatorsThe channels a rule can useSigned in
POST /api/notifications/{id}/testTest one rule’s channels; the messages go to you aloneOptional deviceIdRead access to the rule
A rule for every device
curl -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"type": "geofenceEnter", "notificators": "web", "always": true}' \
  https://YOUR_HOST/api/notifications

Commands to devices

Which commands a device accepts depends on its protocol; ask for the types first. Sending to an offline device answers 202 and the command waits in the queue until the device reconnects; 200 means delivered.

Commands to devices: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/commands/typesThe command types a device’s protocol supportsdeviceId, textChanneldevice:command:read
POST /api/commands/sendSend a command to a device, or to a group with groupIdBody: deviceId, type, attributes, textChannel (by SMS); query: groupId, outcomesdevice:command:write
GET /api/commands/sendThe saved commands usable for a devicedeviceIddevice:command:read
GET /api/commands/queuedCommands waiting for a device, oldest firstdeviceIddevice:command:write
DELETE /api/commands/queued/{id}Cancel a waiting commanddevice:command:write
GET /api/commands/historyCommands sent to a device and their results, newest firstdeviceId; optional from, to, limitdevice:command:write
GET /api/commandsList the saved commands you can readdeviceId, groupId, keyword, limit, offset, excludeAttributesdevice:savedCommand:read
POST /api/commandsCreate one; answers it with its idtype, description, deviceId, textChannel, attributesdevice:savedCommand:write
GET /api/commands/{id}Read onedevice:savedCommand:read
PUT /api/commands/{id}Change one; send the whole objecttype, description, deviceId, textChannel, attributesdevice:savedCommand:write
DELETE /api/commands/{id}Delete onedevice:savedCommand:write
Send a command
curl -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"deviceId": 1, "type": "engineStop"}' \
  https://YOUR_HOST/api/commands/send
# 200 delivered, 202 queued

Drivers

A driver is a name and the uniqueId a device reports for them. Trips, stops, routes and events can then be asked for by driver.

Drivers: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/driversList the drivers you can readdeviceId, groupId, keyword, limit, offset, excludeAttributesdevice:driver:read
POST /api/driversCreate one; answers it with its idname, uniqueId, attributesdevice:driver:write
GET /api/drivers/{id}Read onedevice:driver:read
PUT /api/drivers/{id}Change one; send the whole objectname, uniqueId, attributesdevice:driver:write
DELETE /api/drivers/{id}Delete onedevice:driver:write

Maintenance plans

A plan names a value of the device, where it starts and its period; the platform raises a maintenance event when it is due.

Maintenance plans: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/maintenanceList the maintenance plans you can readdeviceId, groupId, keyword, limit, offset, excludeAttributesdevice:maintenance:read
POST /api/maintenanceCreate one; answers it with its idname, type, start, period, allDevices, attributesdevice:maintenance:write
GET /api/maintenance/{id}Read onedevice:maintenance:read
PUT /api/maintenance/{id}Change one; send the whole objectname, type, start, period, allDevices, attributesdevice:maintenance:write
DELETE /api/maintenance/{id}Delete onedevice:maintenance:write

Share links

A share link gives a temporary read-only user for one device or group, with an end date and an optional PIN. The creator lists, labels and revokes links one by one.

Share links: endpoints
EndpointWhat it doesMain fieldsNeeds
POST /api/share/deviceCreate a link to one device; the answer is its token as textForm: deviceId, expiration, label, pin (4 to 6 digits)Any user who is not read-only
POST /api/share/groupCreate a link to one groupForm: groupId, expiration, label, pinAny user who is not read-only
GET /api/share/linksYour links, newest firstOptional deviceId, groupId, limit, offsetThe creator
GET /api/share/links/{id}One link: its address, label, end date and whether it is activeThe creator
PUT /api/share/links/{id}Rename a linklabelThe creator, not read-only
DELETE /api/share/links/{id}Revoke a link; 204The creator

Care profiles and contacts

A profile describes the person or pet a tracker is worn by: who they are, their home zone and which alerts are on. Contacts are the people around them and whether they receive alerts and reminders.

Care profiles and contacts: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/care/profilesList the care profiles you can readtype, deviceId, keyword, limit, offset, excludeAttributescare:profile:read
POST /api/care/profilesCreate one; answers it with its idtype, name, deviceId, homeGeofenceId, timezone, birthDate, alertSos, alertFall, alertLeftHome, alertLowBattery, alertChannelscare:profile:write
GET /api/care/profiles/{id}Read onecare:profile:read
PUT /api/care/profiles/{id}Change one; send the whole objecttype, name, deviceId, homeGeofenceId, timezone, birthDate, alertSos, alertFall, alertLeftHome, alertLowBattery, alertChannelscare:profile:write
DELETE /api/care/profiles/{id}Delete onecare:profile:write
GET /api/care/contactsList the contacts you can readprofileId, role, keyword, limit, offset, excludeAttributescare:profile:read
POST /api/care/contactsCreate one; answers it with its idprofileId, name, relationship, role, mobile, email, primary, receiveAlerts, receiveReminderscare:profile:write
GET /api/care/contacts/{id}Read onecare:profile:read
PUT /api/care/contacts/{id}Change one; send the whole objectprofileId, name, relationship, role, mobile, email, primary, receiveAlerts, receiveReminderscare:profile:write
DELETE /api/care/contacts/{id}Delete onecare:profile:write
GET /api/care/alertsCare alerts (SOS, fall, left home, low battery), newest firstprofileId; optional from, to (the last 30 days by default), acknowledged, typecare:profile:read
GET /api/care/alerts/{id}Read one alertcare:profile:read
POST /api/care/alerts/{id}/acknowledgeMark an alert as handled; answers it with who and whenAccess to the profile

Health readings and reminders

Readings a device reports or a carer enters, the dated records behind reminders (vaccinations, medication) and appointments. Health data is the most protected part of the platform: a carer with a location-only share does not receive it.

Health readings and reminders: endpoints
EndpointWhat it doesMain fieldsNeeds
GET /api/care/measurementsList the readings you can readprofileId, type, from, to, limit, offsetcare:health:read
POST /api/care/measurementsCreate one; answers it with its idprofileId, type, value, value2, unit, time, notescare:health:write
GET /api/care/measurements/{id}Read onecare:health:read
PUT /api/care/measurements/{id}Change one; send the whole objectprofileId, type, value, value2, unit, time, notescare:health:write
DELETE /api/care/measurements/{id}Delete onecare:health:write
GET /api/care/recordsList the health records you can readprofileId, kind, status, limit, offsetcare:health:read
POST /api/care/recordsCreate one; answers it with its idprofileId, kind, title, dosage, frequency, startDate, endDate, dueDate, status, remindercare:health:write
GET /api/care/records/{id}Read onecare:health:read
PUT /api/care/records/{id}Change one; send the whole objectprofileId, kind, title, dosage, frequency, startDate, endDate, dueDate, status, remindercare:health:write
DELETE /api/care/records/{id}Delete onecare:health:write
POST /api/care/records/{id}/doneMark a record as donecare:health:write
GET /api/care/appointmentsList the appointments you can readprofileId, kind, status, from, to, limit, offsetcare:appointment:read
POST /api/care/appointmentsCreate one; answers it with its idprofileId, title, kind, startTime, endTime, location, status, remindercare:appointment:write
GET /api/care/appointments/{id}Read onecare:appointment:read
PUT /api/care/appointments/{id}Change one; send the whole objectprofileId, title, kind, startTime, endTime, location, status, remindercare:appointment:write
DELETE /api/care/appointments/{id}Delete onecare:appointment:write
GET /api/care/remindersThe dated items of a profile, or of all your profiles, with their remindersOptional profileId, from, to, enabledAccess to the profile
PUT /api/care/reminders/{itemType}/{itemId}Switch one reminder on or off, or change when it is sentenabled, daysBefore, channelsWrite access to the item

Dashcam media and live video

Photos and clips are files the camera stored; each arrives with a media event that names the file. A photo or a live stream is asked for with a command, where the camera supports it. Every view of a recording or stream is written to the view log.

Dashcam media and live video: endpoints
EndpointWhat it doesMain fieldsNeeds
POST /api/commands/sendAsk a camera for a photo, or start and stop live videodeviceId, type: requestPhoto, videoStart, videoStopdevice:command:write; video also device:stream:read
GET /api/media/{uniqueId}/{file}A photo or recording of the deviceOptional format=web (a converted copy, where one exists)device:media:read
GET /api/stream/{deviceId}/{channel}/live.m3u8The HLS playlist of a camera channel’s live video; empty when there is no streamdevice:stream:read
GET /api/stream/{deviceId}/{channel}/{index}.tsOne video segment of that playlistdevice:stream:read

Live

One WebSocket for the live map

Connect to /api/socket with your token. You first receive a snapshot of your devices and their latest positions, then each change as it happens.

JavaScript
const ws = new WebSocket(`wss://YOUR_HOST/api/socket?token=${TOKEN}`);
ws.onmessage = (e) => {
  const msg = JSON.parse(e.data);
  if (msg.positions) console.log('positions', msg.positions);
  if (msg.devices) console.log('devices', msg.devices);
  if (msg.events) console.log('alerts', msg.events);
};

The server sends a keep-alive every 30 seconds and closes the socket when the token is revoked or expires.

  • Positions arrive only for devices the user may read
  • Private trips arrive reduced and marked private
  • Health readings are left out for users who may not see them
{"devices": […]} and {"positions": […]}
On connect: a snapshot of your devices and their latest positions
{"positions": [position]}
A position was stored; a private trip’s position arrives reduced and marked private
{"devices": [device]}
A device changed, including its status
{"events": [event]}
An alert for you
{"eventUpdates": […]}
An event was acknowledged for the first time
{}
Keep-alive, every 30 seconds

Conventions

The same rules on every endpoint

Lists
Page long lists with limit and offset; leave out attribute maps with excludeAttributes=true if you do not need them.
Times and units
Dates are ISO-8601 instants. Speed is in knots, distance in metres, durations in milliseconds, fuel in litres.
Errors
Errors are RFC 9457 problem details (application/problem+json): 401 without a valid token, 403 when the user’s role does not cover the object.
Token in the address
On GET requests the token may be sent as ?token=, for WebSockets and downloads.

FAQ

Questions about the API

Is there a sandbox?

A free trial, where the package has one, gives you an account where you can create devices, tokens and test data. You can also book a demo and we will show the API.

How do I authenticate a server-side integration?

Create a user with a narrow role, sign in once, create a token and store it as a secret. Tokens last up to 365 days and can be revoked.

Can I get live positions without polling?

Yes. Open the WebSocket at /api/socket with your token: you receive a snapshot first, then each change as it happens.

Why does a call answer 403?

The API can do no more than the user who made the token. Check the user’s role and the devices it covers. Users and roles explains how access is granted.

Get a token and make your first call

Create an account, or talk to us about your integration. Choose a package in the portal; you see the first invoice before you confirm.

Chat with us