Query current positions and trails
const url = 'https://api.elwids.xyz/api/integration/v1/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/location-map/query';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"device_uuids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"trail_window":"1h","include_trails":true,"geofence_uuid":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.elwids.xyz/api/integration/v1/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/location-map/query \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "device_uuids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "trail_window": "1h", "include_trails": true, "geofence_uuid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Requires: locations:read
Rate limits: 240 a minute per address, 60 a minute per application
Positions, geofence condition and optional trails (last 1h, 6h, 24h or 7d) of 1 to 100 granted devices. Device entries are the device runtime’s output with four fields added by the control plane. 403 when a requested device is not granted; 422 for invalid input or when the runtime rejects the query (under errors.runtime); 503 when the runtime is unavailable.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organization UUID. A value that does not match returns 404.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”location-map.v1. Entries in data.devices are runtime-shaped.
object
location-map.v1: positions and trails of the requested devices.
object
One entry per requested device that has a location binding.
The device runtime’s map entry, passed through unchanged, plus wandering, active_alert, assignment_status and deployment_status added by the control plane.
object
object
unknown unless the latest fix is live-eligible.
Whether the geofence rule’s condition is active.
object
Runs of valid fixes; a gap longer than twice the binding’s max_age_seconds starts a new segment. Empty unless trails were requested.
Whether the trail was thinned to at most 200 points.
Whether the device’s geofence workflow has an active alert.
The geofence assignment’s status, or null when the device has no assignment.
The assignment workflow’s deployment status, or null.
Example
{ "data": { "schema_version": "location-map.v1", "trail_window": "24h", "geofence": null, "devices": [ { "device_uuid": "00000000-0000-4000-8000-000000000003", "device_name": "Herd tracker 17", "binding_uuid": "00000000-0000-4000-8000-000000000001", "latest": null, "condition": "unknown", "active": false, "geometry": null, "trail": { "segments": [], "sampled": false }, "wandering": false, "active_alert": null, "assignment_status": "active", "deployment_status": "active" } ] }}Headers
Section titled “Headers”Responses to authenticated integration requests are never cached. The header also carries private.
Example
no-store, privateNo valid credentials: no session (first-party API), or a missing, invalid, expired or revoked application token (integration API).
The body of most error responses.
object
Example generated
{ "message": "example"}The caller is not allowed: not a member of the organization, missing a tenant or platform permission, or (integration API) an ability not granted on both the application and the token.
The body of most error responses.
object
Example generated
{ "message": "example"}Not found: an unknown organization or resource, a resource in another organization or not granted to the application, or a malformed identifier (the route does not match).
The body of most error responses.
object
Example generated
{ "message": "example"}The input failed validation.
422 for input that failed validation.
object
The first error, followed by a count of the others.
Messages per field, keyed by the field’s dotted path. A rejection by the device runtime appears under runtime.
object
Example generated
{ "message": "example", "errors": { "runtime": [ "example" ] }}A rate limit was reached; see x-rate-limits on the operation.
The body of most error responses.
object
Example generated
{ "message": "example"}Headers
Section titled “Headers”Seconds to wait before retrying.
The device runtime is not configured, unavailable, or could not complete the request.
The body of most error responses.
object
Example generated
{ "message": "example"}