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

API reference

Locations

7 endpoints. Click one to see its parameters, fields and an example. Code samples use the region you pick.

GET/v1/locationsList locations (flat; build the tree from parent_id/path), each with its client and default project

List locations (flat; build the tree from parent_id/path), each with its client and default project

Query parameters

NameTypeDescription
include_archivedboolean

Example

curl "https://ca-api.clocklap.com/v1/locations" \
  -H "Authorization: Bearer $CLOCKLAP_API_KEY"

Responses

200

POST/v1/locationsAdd a region, site or zone. Sites may name a client (customer_id) and a default project.

Add a region, site or zone. Sites may name a client (customer_id) and a default project.

Body (JSON)

NameTypeDescription
parent_idstring or null
typerequired"region" | "site" | "zone"
namerequiredstring
codestring or null
addressstring or null
timezonestring or null
latnumber or null
lngnumber or null
geofence_radius_mnumber
customer_idstring or null
default_project_idstring or null

Example

curl -X POST "https://ca-api.clocklap.com/v1/locations" \
  -H "Authorization: Bearer $CLOCKLAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"region","name":"Example"}'

Responses

200

GET/v1/locations/{id}Get one location

Get one location

Path parameters

NameTypeDescription
idrequiredstring

Example

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

Responses

200

PATCH/v1/locations/{id}Edit a location. On sites, customer_id and default_project_id (null removes them).

Edit a location. On sites, customer_id and default_project_id (null removes them).

Path parameters

NameTypeDescription
idrequiredstring

Body (JSON)

NameTypeDescription
parent_idstring or null
type"region" | "site" | "zone"
namestring
codestring or null
addressstring or null
timezonestring or null
latnumber or null
lngnumber or null
geofence_radius_mnumber
customer_idstring or null
default_project_idstring or null

Example

curl -X PATCH "https://ca-api.clocklap.com/v1/locations/{id}" \
  -H "Authorization: Bearer $CLOCKLAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Responses

200

POST/v1/locations/{id}/archiveArchive

Archive

Path parameters

NameTypeDescription
idrequiredstring

Example

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

Responses

200

GET/v1/locations/{id}/managersWho manages this location (here, from a region above, or workspace-wide)

Who manages this location (here, from a region above, or workspace-wide)

Path parameters

NameTypeDescription
idrequiredstring

Example

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

Responses

200

POST/v1/locations/{id}/restoreRestore

Restore

Path parameters

NameTypeDescription
idrequiredstring

Example

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

Responses

200