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. Updated: 2025-01-09 - Added support for multiple airtags and devices in a geofence.
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", "tag_789012"],
}
]
Create a Geofence
Create a new geofence for multiple trackable devices of the same type.
Endpoint
POST /v1/geofences
Request Body
{
name: string;
latitude: number;
longitude: number;
radius: number;
trackableId: string[]; // Array of trackable IDs
notifyType?: string; // Optional notification type
notifyDestination?: string; // Optional notification destination
}
Example Request
curl -X POST "https://api.airpinpoint.com/v1/geofences" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Home",
"latitude": 37.7749,
"longitude": -122.4194,
"radius": 100,
"trackableId": ["tag_123456", "tag_789012"]
}'
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", "tag_789012"],
}
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 during the beta period
- All trackables in a geofence must be of the same type (airtag, device, or beacon)
- A trackable must have location data available before it can be added to a geofence
- Geofences require a name, latitude, longitude, and radius
- Multiple trackables can be added to a single geofence