Skip to content
ClockLap Developers
API reference clocklap.com Get an API key

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

NameTypeDescription
location_idstring

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

NameTypeDescription
idrequiredstring

Body (JSON)

NameTypeDescription
namestring
shapeobject
shape.typerequired"circle"
shape.centerrequiredobject
shape.radius_mrequirednumber
rulesobject
rules.dwell_snumber or null
rules.exit_buffer_mnumber or null
rules.exit_dwell_snumber or null
rules.short_exit_break_minnumber or null
rules.max_accuracy_mnumber or null
activeboolean

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

NameTypeDescription
idrequiredstring

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)

NameTypeDescription
latrequirednumber
lngrequirednumber

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

NameTypeDescription
idrequiredstring

Body (JSON)

NameTypeDescription
namestring
shaperequiredobject
shape.typerequired"circle"
shape.centerrequiredobject
shape.radius_mrequirednumber
rulesobject
rules.dwell_snumber or null
rules.exit_buffer_mnumber or null
rules.exit_dwell_snumber or null
rules.short_exit_break_minnumber or null
rules.max_accuracy_mnumber or null
activeboolean

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

NameTypeDescription
idrequiredstring

Query parameters

NameTypeDescription
daysinteger Default 7

Example

curl "https://ca-api.clocklap.com/v1/locations/{id}/punch-map" \
  -H "Authorization: Bearer $CLOCKLAP_API_KEY"

Responses

200