linxio-js
SDK Reference

Geofences

Area and area-group lifecycle methods, including create, update, archive, restore, and delete.

Linxio calls geofences areas in the REST API. The SDK uses linxio.geofences to make that domain clearer.

geofences.list()

GET

List geofences

/areaslinxio.geofences.list(params)

Loads one page of geofence areas.

Input

params.limit
number
optional
Number of geofences to request.
params.page
number
optional
Page number to request.
Default: 1
params.sort
string
optional
Sort expression accepted by Linxio.
params.fields
string[]
optional
Optional field projection.

Returns

data
LinxioGeofence[] | null
optional
Geofence records for the requested page.
meta
LinxioPaginationMeta | null
optional
Pagination metadata.
error
LinxioError | null
optional
Typed SDK error when the page fails.

geofences.iterate()

GET

Load all geofences

/areaslinxio.geofences.iterate(params)

Auto-paginates geofence pages into one result object.

Input

params
LinxioGeofenceListParams
optional
Same parameters as geofences.list().

Returns

data
LinxioGeofence[] | null
optional
Flat array containing every loaded geofence.
error
LinxioError | null
optional
Typed SDK error if any page fails.

geofences.stream()

GET

Stream geofences

/areaslinxio.geofences.stream(params)

Streams geofences lazily across pages.

Input

params
LinxioGeofenceListParams
optional
Same parameters as geofences.list().

Returns

yield
LinxioGeofence
optional
One geofence at a time.
throws
LinxioError
optional
Thrown if a page request fails.

geofences.get()

GET

Get a geofence

/areas/{areaId}linxio.geofences.get(areaId)

Fetches one geofence by Linxio area ID.

Input

areaId
LinxioId
required
Geofence area identifier.

Returns

data
LinxioGeofence | null
optional
Geofence record.
error
LinxioError | null
optional
Typed SDK error when the geofence cannot be loaded.

geofences.create()

POST

Create a geofence

/areaslinxio.geofences.create(payload)

Creates a geofence area.

Input

payload.name
string
required
Display name.
payload.type
GeofenceType
required
Geometry type.
circlepolygonpolylinerectangle
payload.coordinates
LatLng[]
optional
Geometry coordinates. Circles typically use one centre point.
payload.radius
number
optional
Radius in metres for circle geofences.
payload.color
string
optional
Display colour accepted by Linxio.

Returns

data
LinxioGeofence | null
optional
Created geofence.
error
LinxioError | null
optional
Typed SDK error when creation fails.

geofences.update()

PATCH

Update a geofence

/areas/{areaId}linxio.geofences.update(areaId, payload)

Updates a geofence area.

Input

areaId
LinxioId
required
Geofence area identifier.
payload
Partial<LinxioGeofencePayload>
required
Partial geofence payload containing fields to change.

Returns

data
LinxioGeofence | null
optional
Updated geofence.
error
LinxioError | null
optional
Typed SDK error when update fails.

geofences.archive()

PATCH

Archive a geofence

/areas/{areaId}/archivelinxio.geofences.archive(areaId)

Soft-archives a geofence area.

Input

areaId
LinxioId
required
Geofence area identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when archive fails.

geofences.restore()

PATCH

Restore a geofence

/areas/{areaId}/restorelinxio.geofences.restore(areaId)

Restores a previously archived geofence area.

Input

areaId
LinxioId
required
Archived geofence area identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when restore fails.

geofences.delete()

DELETE

Delete a geofence

/areas/{areaId}linxio.geofences.delete(areaId)

Permanently deletes a geofence area. Use archive() instead when you need a reversible operation.

Input

areaId
LinxioId
required
Geofence area identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when delete fails.

geofences.listGroups()

GET

List geofence groups

/area-groupslinxio.geofences.listGroups()

Lists area groups.

Input

none
void
optional
listGroups() does not take parameters.

Returns

data
LinxioAreaGroup[] | null
optional
Area group records.
error
LinxioError | null
optional
Typed SDK error when groups cannot be loaded.

geofences.getGroup()

GET

Get a geofence group

/area-groups/{groupId}linxio.geofences.getGroup(groupId)

Fetches one area group by ID.

Input

groupId
LinxioId
required
Area group identifier.

Returns

data
LinxioAreaGroup | null
optional
Area group record.
error
LinxioError | null
optional
Typed SDK error when the group cannot be loaded.

geofences.createGroup()

POST

Create a geofence group

/area-groupslinxio.geofences.createGroup(payload)

Creates an area group.

Input

payload.name
string
required
Area group display name.

Returns

data
LinxioAreaGroup | null
optional
Created area group.
error
LinxioError | null
optional
Typed SDK error when group creation fails.

geofences.updateGroup()

PATCH

Update a geofence group

/area-groups/{groupId}linxio.geofences.updateGroup(groupId, payload)

Updates an area group.

Input

groupId
LinxioId
required
Area group identifier.
payload.name
string
optional
New group name.

Returns

data
LinxioAreaGroup | null
optional
Updated area group.
error
LinxioError | null
optional
Typed SDK error when group update fails.

geofences.archiveGroup()

PATCH

Archive a geofence group

/area-groups/{groupId}/archivelinxio.geofences.archiveGroup(groupId)

Soft-archives an area group.

Input

groupId
LinxioId
required
Area group identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when group archive fails.

geofences.restoreGroup()

PATCH

Restore a geofence group

/area-groups/{groupId}/restorelinxio.geofences.restoreGroup(groupId)

Restores a previously archived area group.

Input

groupId
LinxioId
required
Archived area group identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when group restore fails.

geofences.deleteGroup()

DELETE

Delete a geofence group

/area-groups/{groupId}linxio.geofences.deleteGroup(groupId)

Permanently deletes an area group. Prefer archiveGroup() when the action should be reversible.

Input

groupId
LinxioId
required
Area group identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when group delete fails.

On this page