A boundary is the area that a worker must be inside to clock in to an activity. An
activity lists its boundaries in geofences. See
the Activity object.
| To do this | Use | Scopes |
|---|---|---|
| Add a boundary when you create an activity | location on POST /activities | activity:write. A drawn boundary also needs geofences:write. |
| Redraw a boundary, or add another one | location on PATCH /activities/{activityId} | activity:write and geofences:write |
| Turn a boundary off or on | PATCH /activities/{activityId}/geofences/{geofenceId} | activity:write and geofences:write |
Publishing. A boundary that your key draws is live at once only when the key has the
geofences:publish scope. Without it, the boundary is saved as a draft. It shows
isPublished: false (for a new boundary) and hasDraftPending: true until an
administrator publishes it. Every redraw is kept as a version.
Who can change a boundary. Your key can change only a boundary that its own source
system owns, and not one that an administrator took over (isLocallyManaged: true).
See Locations for the shape and size rules.
Back to the index · Conventions · Errors
PATCH /activities/{activityId}/geofences/{geofenceId}
Turns one boundary off (false) or on (true). The boundary and its versions are kept.
The phone uses only active boundaries.
Scopes: activity:write and geofences:write
This change does not move the activity's updatedAt.
Path parameters
| Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
activityId | integer | Yes | 1 or more | The activity's id | |
geofenceId | integer | Yes | 1 or more | One of the activity's boundaries, from its geofences list |
Request body
| Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
isActive | boolean | Yes | false turns the boundary off. true turns it on. |
Example request
curl -X PATCH "$TIMECARD_BASE_URL/activities/48213/geofences/9120" \
-H "X-API-Key: $TIMECARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "isActive": false }'
Example response 200 OK
The response is the activity after the change.
{
"status": 200,
"message": "Success: fence removed.",
"record": {
"activityId": 48213,
"kind": "Job",
"code": "J-2026-104",
"geofences": [
{
"geofenceId": 9120,
"isActive": false,
"isPublished": false,
"hasDraftPending": true,
"sourceSystem": "acme-erp",
"isLocallyManaged": false
}
],
"updatedAt": "2026-11-03T15:04:05.123Z"
}
}
The record has every field of the Activity object.
It is shortened here. When you turn a boundary on, the message is
Success: fence restored. Sending the value that the boundary already has changes nothing.
Errors
| Status | code | When |
|---|---|---|
| 400 | validation_failed | An id is not a positive integer, or isActive is not a boolean |
| 401 | No key, or a key that is not valid, revoked or expired | |
| 403 | insufficient_scope or forbidden | The key does not have activity:write or geofences:write |
| 404 | not_found | No activity has this id within the key's companies, or the boundary is not one of its boundaries |
| 409 | conflict | The boundary is locally managed, or another source system owns it |
| 500 | internal_error | The boundary could not be changed |
| 503 | service_unavailable | The service cannot check the key at the moment |