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
| Name | Type | Description |
|---|---|---|
include_archived | boolean |
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)
| Name | Type | Description |
|---|---|---|
parent_id | string or null | |
typerequired | "region" | "site" | "zone" | |
namerequired | string | |
code | string or null | |
address | string or null | |
timezone | string or null | |
lat | number or null | |
lng | number or null | |
geofence_radius_m | number | |
customer_id | string or null | |
default_project_id | string 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
| Name | Type | Description |
|---|---|---|
idrequired | string |
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
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
parent_id | string or null | |
type | "region" | "site" | "zone" | |
name | string | |
code | string or null | |
address | string or null | |
timezone | string or null | |
lat | number or null | |
lng | number or null | |
geofence_radius_m | number | |
customer_id | string or null | |
default_project_id | string 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
| Name | Type | Description |
|---|---|---|
idrequired | string |
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
| Name | Type | Description |
|---|---|---|
idrequired | string |
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
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl -X POST "https://ca-api.clocklap.com/v1/locations/{id}/restore" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200