API Reference
Connect your assigned Barq devices. Complete fleet visibility with reported status, events, and reports.
Set Up Your Development Environment
Configure Your API Token
Use cURL, Python 3 or server-side JavaScript. Save the token issued by Barq as
BARQ_API_TOKENin your server environment.Confirm Your Access
Read
GET /api/v1/auth/me/withAuthorization: Bearer YOUR_BARQ_API_TOKENto check permissions and shared quotas.List Your Devices
Call
GET /api/v1/devices/, follow eachnextpage and copy a returnedid.Read a Device’s Status
Use that ID in
GET /api/v1/devices/{device_id}/status/. Check the response ID and report timestamps.
Open the full setup guide for copyable requests and a Python example. Tracking-platform sign-in is separate from API-token authorization.
Authentication
Barq issues a customer-scoped API token. Send it in the Authorization header. Browser tracking sign-in is separate.
Errors
401: verify your token. 403: check your account permissions and subscription. 429 or 503: wait for Retry-After before retrying reads. Never automatically retry an uncertain physical command.
Time Windows and Limits
Use ISO 8601 timestamps with offsets. History windows are at most 24 hours, start included and end excluded. Device assignment dates apply.
Read Your Collected Automatic Alerts
/api/v1/alerts/Returns up to 50 newest stored alerts within your current device assignments. Count is the total matching alerts and can exceed the number of returned results; this endpoint has no pagination parameter. No supplier request is sent. Collection requires enabled device monitoring; an empty response does not establish that monitoring is enabled. Email readiness is returned separately. Acknowledgement remains per named user in the tracking portal. Uses one shared read quota unit.
Parameters
- No parameters.
Revoke This API Credential
/api/v1/auth/logout/Send your current Bearer credential in the Authorization header. An API session is ended; a persistent API key is revoked. Only this credential is affected, including when it is already expired or access is suspended. Other sessions, other keys, staff browser sessions and the supplier connection remain active. A repeated logout returns 204.
Parameters
- No parameters.
Get Current API Access and Limits
/api/v1/auth/me/Returns this credential's current customer permissions and configured shared quota limits. Requires an active credential, customer and subscription; read permission is not required to inspect access. Uses one shared read quota unit. Device command capabilities are separate. Command access does not imply physical execution or an enabled device profile. This response does not include token expiry or device history-access dates.
Parameters
- No parameters.
List Your Devices
/api/v1/devices/Lists your active devices, 20 per page. Plate and device type are set in Barq Admin; an unassigned plate is N/A. Status flags use a cached inventory snapshot.
Parameters
alarm_active· querydevice_type· queryonline· querypage· query A page number within the paginated result set.search· query Search Barq UUID, name or Admin-defined plate.unused· query
Get Reported Device Address
/api/v1/devices/{device_id}/address/Returns the reported address with its timestamp prefix removed, or null when unavailable. recorded_at remains unverified.
Parameters
device_id· path · required
Get Alarm History
/api/v1/devices/{device_id}/alarms/Returns permitted alarm records in time order for the requested period. Multiple records can describe one incident.
Parameters
device_id· path · requiredend· query · required Exclusive end, with timezone and whole seconds. Must be after start and no more than 24 hours after start.start· query · required Inclusive start, with timezone and whole seconds. Must be on or after your permitted history access date.
Get Device Command Capabilities
/api/v1/devices/{device_id}/command-capabilities/Returns configured command kinds and whether this credential may submit commands now. Device support, current assignment, subscription, credential/member permissions, and the command dispatch switch are all required. Raw command templates and device passwords are never returned. Named instruction labels are available only to command-authorized callers.
Parameters
device_id· path · required
Submit an Approved Device Command
/api/v1/devices/{device_id}/commands/Requests a lock or unlock for one assigned device. Command permission is required on both your key and subscription, and Barq must enable commands for the device.
Kinds: lock (action lock/unlock), query-status, query-parameters, query-identifier, text (content), named (instruction, optional empty parameters), and engine (action cut/restore). Additional kinds require an explicitly verified device profile. Text and named commands use exact approved allowlists. Engine cut additionally requires a stationary report received within 60 seconds. Scheduled unlock and SIM control remain unavailable pending their contracts. Query requests return receipts only; they do not return parameters or identifiers and never disclose raw protocol replies. Send kind=lock with action=lock or unlock. Accepted acknowledges submission only; execution_verified remains false. The API does not wait for physical movement.
Verified eLock queries query-version and query-corner take only kind, require explicit profile assignment, and return receipts rather than raw device replies. Typed settings: reporting-intervals requires integer moving_seconds (5–1800) and stationary_seconds (300–43200); latent-interval requires integer wake_minutes (5–43200); corner-reporting requires integer angle_degrees (0–180; 0 disables); latent-schedule requires local_times, one to four distinct HH:MM strings in the device timezone. Wake schedules use the device timezone, not your browser timezone; changing it shifts all wake times. Barq does not change the device timezone or convert these local times. Settings require asset-management permission and private model/firmware verification. Sleep modes can delay tracking updates and queued commands. No automatic reply matching is available for these settings or the two new eLock queries: Barq must review delivery. requested_parameters records requested values only.
Use one UUID Idempotency-Key per intentional command. Repeat the same key, body and device to retrieve its stored result without another dispatch. A changed body/device returns 409. A dispatching, accepted or unknown receipt blocks new commands for the device with 409 until delivery is recorded or an administrator reviews delivery. Neither a device reply nor delivery review verifies physical execution; review also does not cancel a queued command. Never automatically resend after a timeout or unknown result; read the stored command result or contact Barq.
All customer keys share 10 writes and 5 command submissions per UTC minute. New commands for one device are separated by at least 10 seconds. Request examples can change a physical lock when run with enabled access.
Parameters
Idempotency-Key· header · required Unique UUID for this intentional command. Preserve it when checking a retry.device_id· path · required
Get Command Request Result
/api/v1/devices/{device_id}/commands/{command_id}/Returns the stored result for an assigned device without sending a device command. Requires command permission on both key and subscription. Status is the request state; physical execution remains unverified. This GET counts towards your read allowance.
Parameters
command_id· path · required Barq command ID returned by the submission response.device_id· path · required
Get Period Distance
/api/v1/devices/{device_id}/distance/Returns reported distance in kilometres for the permitted period. Null means unavailable; zero is an explicit reading.
Parameters
device_id· path · requiredend· query · required Exclusive end, with timezone and whole seconds. Must be after start and no more than 24 hours after start.start· query · required Inclusive start, with timezone and whole seconds. Must be on or after your permitted history access date.
Get Geofence Entry and Exit History
/api/v1/devices/{device_id}/fence-events/Returns reported geofence entry and exit times, optionally filtered by event_type. Uses an inclusive start and exclusive end, with a maximum 24-hour window after your permitted history date. Geofence identity is unavailable: geofence_id and geofence_name are null. Source time coverage is unconfirmed. An empty report does not establish event support, retention or the absence of a crossing. Uses one shared read quota unit and one report quota unit.
Parameters
device_id· path · requiredend· query · required Exclusive end, with timezone and whole seconds; at most 24 hours after start.event_type· query Optional entry or exit filter. Omit to include both.start· query · required Inclusive start, with timezone and whole seconds, on or after your permitted history date.
Get Reported Fence Membership
/api/v1/devices/{device_id}/fence-membership/Reads membership in an assigned Barq geofence. Use a geofence ID from your geofence list. Requires verified device-to-fence and service mappings; unavailable mappings return 404 or 503. A reported membership does not establish a fresh position. Uses one read quota unit.
Parameters
device_id· path · requiredgeofence_id· query · required Barq geofence UUID from the geofence list.
Get Location History
/api/v1/devices/{device_id}/history/Returns permitted location points in time order for the requested period. An empty list means no matching records.
Parameters
device_id· path · requiredend· query · required Exclusive end, with timezone and whole seconds. Must be after start and no more than 24 hours after start.start· query · required Inclusive start, with timezone and whole seconds. Must be on or after your permitted history access date.
Get Latest Permitted Alarm
/api/v1/devices/{device_id}/latest-alarm/Returns the latest alarm within your permitted history, or null. Check device status for the current alarm-active flag.
Parameters
device_id· path · required
Get Lock-Event History
/api/v1/devices/{device_id}/lock-events/Returns permitted lock events in time order. Location is null when its timestamp is missing or outside your permitted history.
Parameters
device_id· path · requiredend· query · required Exclusive end, with timezone and whole seconds. Must be after start and no more than 24 hours after start.start· query · required Inclusive start, with timezone and whole seconds. Must be on or after your permitted history access date.
Get Device Message Record Metadata
/api/v1/devices/{device_id}/messages/Returns permitted message metadata, newest first, with redacted content. Message outcomes and log completeness are unverified. Responses over 1,000 source records return 422.
Parameters
device_id· path · required
Rename Your Barq Asset
/api/v1/devices/{device_id}/name/Updates the client-facing Barq asset name. Requires asset-management permission on the credential or named customer member and the subscription. Every change is audited and idempotent. The supplier name is unchanged. All reads and the tracking portal use the Barq name.
Parameters
Idempotency-Key· header · required One UUID per intentional write. Reuse with the same body/device to retrieve the existing result.device_id· path · required
Update Your Barq Vehicle Plate
/api/v1/devices/{device_id}/plate/Updates the client-facing Barq plate only, with asset-management permission on both credential/member and subscription. Use an empty string to remove a plate. Barq plate lookups immediately use this value; ambiguous plates are rejected by lookup endpoints. Supplier metadata is unchanged. The change is audited and idempotent.
Parameters
Idempotency-Key· header · required One UUID per intentional write. Reuse with the same body/device to retrieve the existing result.device_id· path · required
Get Reported Device Position
/api/v1/devices/{device_id}/position/Returns the reported WGS84 position, address and compass direction, or null. A missing heading uses the latest device report; heading_received_at dates that heading. GCJ-02 coordinates remain separate.
Parameters
device_id· path · required
Get Reported Device Regions
/api/v1/devices/{device_id}/regions/Checks up to 20 geofences assigned to this device and lists reported inside memberships. Uses one read quota unit per checked fence (minimum one). No configured mappings returns 503; unknown memberships increase unavailable_count and make complete false. entered_at is null: membership does not establish an entry event. This covers configured Barq geofences only.
Parameters
device_id· path · required
Get a Date-Range Report or CSV Export
/api/v1/devices/{device_id}/reports/{kind}/Seven report types: history, alarms, lock-events, tamper-alarms, fence-events, daily distance, and stored command receipts. The kind selects the result record schema below. Both dates are inclusive in the requested timezone, or your account timezone when none is given. The server splits the range into daily reads, clamps the start to your assignment's history-access boundary, rechecks access between reads, and reserves one read unit per day plus one report unit per request. Results are newest first. Maximum seven days and 20,000 combined rows; each daily source read is also bounded at 5,000 records. CSV export is protected against spreadsheet formula injection and uses a subset of the JSON fields. Distance rows are reported daily totals, not a reconciled distance/fuel summary. Command receipts disclose no operator notes or raw protocol text. Fence identity/completeness and physical command execution remain unverified.
Parameters
device_id· path · requireddownload· query Set csv to download the same permitted records. The CSV has report-specific columns, a UTF-8 BOM and an additional time_iso8601 column in the requested timezone; it does not contain every JSON field.from· query · required Inclusive calendar date in the requested timezone (your account timezone by default).kind· path · requiredtimezone· query IANA timezone, for example Europe/Berlin. Defaults to your account timezone.to· query · required Inclusive calendar date; at most seven days and no future dates.
Get Latest Reported Device Status
/api/v1/devices/{device_id}/status/Returns the latest reported status, battery, lock state and location. heading_direction shows the compass direction; 0° is North. Report times may be older than this API read.
Parameters
device_id· path · required
Get Tamper and Power Alarms
/api/v1/devices/{device_id}/tamper-alarms/Returns reported removal, power-off and cover-open alarms from alarm history. Omit alarm_type to include all three. Uses an inclusive start and exclusive end, with a maximum 24-hour window after your permitted history date. An empty report does not establish sensor support, retention or the absence of a physical event. Uses one shared read quota unit and one report quota unit.
Parameters
alarm_type· query Optional alarm filter. Omit to include all three supported types.device_id· path · requiredend· query · required Exclusive end, with timezone and whole seconds; after start and at most 24 hours later.start· query · required Inclusive start, with timezone and whole seconds, on or after your permitted history date.
Get Tracking History with Filters
/api/v1/devices/{device_id}/trace/Returns reported WGS84 history with stationary and network-position filters. Uses an inclusive start and exclusive end, with a maximum 24-hour window after your permitted history date. Correction is unavailable in this release: corrected_path is null, including when correct_path=true. Reported speed does not prove physical movement; source completeness and retention are unknown. Uses one shared read quota unit and one report quota unit.
Parameters
correct_path· query Default false. When requested, correction is reported as unavailable in this release; corrected_path stays null.device_id· path · requiredend· query · required Exclusive end, with timezone and whole seconds; at most 24 hours after start.include_fallback· query Default true. False keeps only reported GPS points and excludes network or unknown-source points.include_stationary· query Default true. False keeps only points with reported speed greater than zero; this does not prove movement.start· query · required Inclusive start, with timezone and whole seconds, on or after your permitted history date.
Get Reported Address by Plate
/api/v1/devices/by-plate/address/Returns the reported address, or null. Uses the exact plate set in Barq Admin for your assigned device. Returns 404 if unavailable or 409 if more than one assigned device has that plate.
Parameters
plate· query · required Exact plate set in Barq Admin for one of your active devices (case-sensitive).
Get Alarm History by Plate
/api/v1/devices/by-plate/alarms/Uses the exact plate set in Barq Admin for your assigned device. Returns 404 if unavailable or 409 if more than one assigned device has that plate.
Parameters
end· query · required Exclusive end, with timezone and whole seconds. Must be after start and no more than 24 hours after start.plate· query · required Exact plate set in Barq Admin for one of your active devices (case-sensitive).start· query · required Inclusive start, with timezone and whole seconds. Must be on or after your permitted history access date.
Get Geofence Events by Plate
/api/v1/devices/by-plate/fence-events/Resolves your exact Admin-defined plate to an assigned device. Returns reported geofence entry and exit times, optionally filtered by event_type. Uses an inclusive start and exclusive end, with a maximum 24-hour window after your permitted history date. Geofence identity is unavailable: geofence_id and geofence_name are null. Source time coverage is unconfirmed. An empty report does not establish event support, retention or the absence of a crossing. Uses one shared read quota unit and one report quota unit.
Parameters
end· query · required Exclusive end, with timezone and whole seconds; at most 24 hours after start.event_type· query Optional entry or exit filter. Omit to include both.plate· query · required Exact vehicle plate set in Barq Admin for one of your active devices.start· query · required Inclusive start, with timezone and whole seconds, on or after your permitted history date.
Get Location History by Plate
/api/v1/devices/by-plate/history/Uses the exact plate set in Barq Admin for your assigned device. Returns 404 if unavailable or 409 if more than one assigned device has that plate.
Parameters
end· query · required Exclusive end, with timezone and whole seconds. Must be after start and no more than 24 hours after start.plate· query · required Exact plate set in Barq Admin for one of your active devices (case-sensitive).start· query · required Inclusive start, with timezone and whole seconds. Must be on or after your permitted history access date.
Get Reported Position by Plate
/api/v1/devices/by-plate/position/Returns the reported position and compass direction. Uses the exact plate set in Barq Admin for your assigned device. Returns 404 if unavailable or 409 if more than one assigned device has that plate.
Parameters
plate· query · required Exact plate set in Barq Admin for one of your active devices (case-sensitive).
Get Device Status by Plate
/api/v1/devices/by-plate/status/Returns the latest reported device status. Uses the exact plate set in Barq Admin for your assigned device. Returns 404 if unavailable or 409 if more than one assigned device has that plate.
Parameters
plate· query · required Exact plate set in Barq Admin for one of your active devices (case-sensitive).
Find Devices in an Area
/api/v1/devices/in-area/Checks reported positions of your active devices against a closed rectangle. Maximum 20 assigned devices; larger fleets return 422. Uses one read quota unit per scanned device (minimum one). Missing coordinates increase unavailable_count. Coordinate acquisition time is unknown.
Parameters
coordinate_system· querymax_latitude· query · requiredmax_longitude· query · requiredmin_latitude· query · requiredmin_longitude· query · required
List Your Geofences
/api/v1/geofences/Lists active, verified geofences configured by Barq Admin for your account. Uses one read quota unit.
Parameters
page· query Page number; 20 results per page.
Open Your Assigned-Device Tracking Workspace
/api/v1/portal-entry/Validates up to 20 current Barq device UUIDs and returns the customer tracking URL with the chosen workspace view. The browser uses its separate customer sign-in. This URL contains no API credential and never grants access to additional devices or the staff admin portal.
Parameters
- No parameters.
List Your Managed SIMs
/api/v1/sims/Lists verified managed SIM associations for your active devices. An empty list does not establish that an unmanaged SIM is absent. Uses one read quota unit.
Parameters
page· query Page number; 20 results per page.
Get Managed SIM Details
/api/v1/sims/{sim_id}/Reads carrier-reported package, state and usage for a verified managed SIM. Use a Barq SIM ID from your SIM list. Carrier service support is required; unavailable service returns 503. Dates and usage are reported values, not independently measured. Private identifiers and configuration stay hidden. Uses one read quota unit.
Parameters
sim_id· path · required Barq SIM UUID from your managed SIM list.