API reference
Geofences
6 endpoints. Click one to see its parameters, fields and an example. Code samples use the region you pick.
GET/v1/geofencesList geofences
List geofences
Query parameters
| Name | Type | Description |
|---|---|---|
location_id | string |
Example
curl "https://ca-api.clocklap.com/v1/geofences" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
PATCH/v1/geofences/{id}Update one geofence
Update one geofence
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
name | string | |
shape | object | |
shape.typerequired | "circle" | |
shape.centerrequired | object | |
shape.radius_mrequired | number | |
rules | object | |
rules.dwell_s | number or null | |
rules.exit_buffer_m | number or null | |
rules.exit_dwell_s | number or null | |
rules.short_exit_break_min | number or null | |
rules.max_accuracy_m | number or null | |
active | boolean |
Example
curl -X PATCH "https://ca-api.clocklap.com/v1/geofences/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Example","shape":{"type":"circle","center":{"lat":-90,"lng":-180},"radius_m":25},"rules":{},"active":true}'Responses
200
DELETE/v1/geofences/{id}Delete one geofence
Delete one geofence
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl -X DELETE "https://ca-api.clocklap.com/v1/geofences/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/geofences/testWhich fences contain this point? (PostGIS, cross-checked with device geometry)
Which fences contain this point? (PostGIS, cross-checked with device geometry)
Body (JSON)
| Name | Type | Description |
|---|---|---|
latrequired | number | |
lngrequired | number |
Example
curl -X POST "https://ca-api.clocklap.com/v1/geofences/test" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"lat":1,"lng":1}'Responses
200
POST/v1/locations/{id}/geofencesGeofences
Geofences
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
name | string | |
shaperequired | object | |
shape.typerequired | "circle" | |
shape.centerrequired | object | |
shape.radius_mrequired | number | |
rules | object | |
rules.dwell_s | number or null | |
rules.exit_buffer_m | number or null | |
rules.exit_dwell_s | number or null | |
rules.short_exit_break_min | number or null | |
rules.max_accuracy_m | number or null | |
active | boolean |
Example
curl -X POST "https://ca-api.clocklap.com/v1/locations/{id}/geofences" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Example","shape":{"type":"circle","center":{"lat":-90,"lng":-180},"radius_m":25},"rules":{},"active":true}'Responses
200
GET/v1/locations/{id}/punch-mapRecent punch coordinates at a location (geofence tuning)
Recent punch coordinates at a location (geofence tuning)
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Query parameters
| Name | Type | Description |
|---|---|---|
days | integer | Default 7 |
Example
curl "https://ca-api.clocklap.com/v1/locations/{id}/punch-map" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200