Geofencing

Set up and manage geofences for your trackable devices with the AirPinpoint API.


Beta Feature: Geofencing is currently in beta and available only for business users.

Geofencing

The Geofencing endpoints allow you to create, manage, and monitor geofences for your trackable devices.

List Geofences

Retrieve a list of all geofences.

Endpoint

GET /v1/geofences

Query Parameters

  • skip: Number of items to skip (for pagination, default: 0)
  • limit: Maximum number of items to return (1-100, default: 20)
  • trackable_id: Optional ID to filter geofences for a specific trackable

Example Request

curl -X GET "https://api.airpinpoint.com/v1/geofences?limit=20&trackable_id=tag_123456" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Response

[
  {
    "id": "geofence_789012",
    "name": "Home",
    "authUserId": "user_123",
    "latitude": 37.7749,
    "longitude": -122.4194,
    "radius": 100,
    "createdAt": "2023-06-15T17:00:00Z",
    "updatedAt": "2023-06-15T17:00:00Z",
    "trackableId": "tag_123456",
    "trackableType": "airtag"
  }
]

Create a Geofence

Create a new geofence for a specific trackable device.

Endpoint

POST /v1/trackables/{trackable_id}/geofences

Request Body

{
  name: string;
  latitude: number;
  longitude: number;
  radius: number;
}

Example Request

curl -X POST "https://api.airpinpoint.com/v1/trackables/tag_123456/geofences" \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "name": "Home",
       "latitude": 37.7749,
       "longitude": -122.4194,
       "radius": 100
     }'

Example Response

{
  "id": "geofence_789012",
  "name": "Home",
  "authUserId": "user_123",
  "latitude": 37.7749,
  "longitude": -122.4194,
  "radius": 100,
  "createdAt": "2023-06-15T17:00:00Z",
  "updatedAt": "2023-06-15T17:00:00Z",
  "trackableId": "tag_123456",
  "trackableType": "airtag"
}

Delete a Geofence

Remove a geofence.

Endpoint

DELETE /v1/geofences/{geofence_id}

Example Request

curl -X DELETE "https://api.airpinpoint.com/v1/geofences/geofence_789012" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "message": "Geofence deleted successfully"
}

Limitations

  • Geofencing is currently in beta and available only for business users
  • Each user is limited to 10 geofences
  • A trackable must have location data available before a geofence can be created for it
  • Geofences require a name, latitude, longitude, and radius