Skip to main content

Create a geofence

POST 

/api/v1/geofences

Add a new geofence to the system.

A geofence defines a geographic boundary (currently only circular boundaries are supported) that can be used to enforce location-based access control for time entries, expense entries, or custom entries.

Assignment Logic

You can optionally include an assignments array when creating a geofence to specify which users, groups, projects, or entry screens it applies to:

  • User assignments: Direct assignment to individual users
  • Group assignments: Applies to all users in the specified group
  • Project assignments: Applies when logging time to that project
  • Entry screen assignments: Applies when using that specific entry screen

When multiple geofences apply to a user/project combination, the system uses OR logic: the user only needs to be within ONE applicable geofence to pass validation.

Priority Geofences

If you set is_priority: true, this geofence will override non-priority geofences. When ANY applicable geofence is marked as priority, ONLY priority geofences are checked.

Required abilities

This operation requires the Geofence - Manage ability, or Authority - Administrator.

Unique Names

The pname field must be unique across all geofences. Attempting to create a geofence with a duplicate name will result in a 409 Conflict error.

Request

Responses

Successfully created the geofence. The response includes the full geofence object including the generated ID, timestamps, and URI.

Note: Unlike many REST APIs that return 201 Created for POST operations, this endpoint returns 200 OK with the complete geofence object in the response body.

Response Headers
    Location

    The URL of the newly created object.

    X-Item-Id

    The ID of the newly created object.

    X-Item-Table

    The name of the table where the object was created.