Skip to content

Get user geofences​

GET
/users/{id}/geofences

Authorizations​

ApiKeyAuth

API Key for authentication. Retrieval from either API version login routes, or other authentication token type. See Authentication for more details.

Type
API Key (header: Authorization)
Example"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Parameters​

Path Parameters

id*

user id

Type
string
Required
Format
"JSON"

Query Parameters

filter

JSON Filter object

Type
string
Format
"JSON"

Request example

Responses​

Request was successful

application/json
JSON
[
  
{
  
  
"outline": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"center": {
  
  
  
"lat": 0,
  
  
  
"lng": 0
  
  
},
  
  
"radius": 0,
  
  
"type": "string",
  
  
"name": "string",
  
  
"wasInside": false,
  
  
"lastChecked": "string",
  
  
"modified": false,
  
  
"meta": {
  
  
},
  
  
"foreignId": "string",
  
  
"id": 0,
  
  
"deviceId": 0,
  
  
"configId": 0,
  
  
"userId": 0
  
}
]
Try this endpoint

Playground​

Authorization
Variables
Key
Value

OpenAPI definition ​

References are expanded below, except recursive definitions and references with sibling fields. Documentation overrides are included. Full original OpenAPI spec (JSON).

View endpoint OpenAPI definition
yaml
openapi: 3.1.0
info:
  version: 1.1.0
  title: TrackingAPI
  description: V1 API for retrieving tracking data and changing settings on Lightbug devices
servers:
  - url: https://api.lightbug.cloud/api
externalDocs: {}
security:
  - ApiKeyAuth: []
tags: []
paths:
  /users/{id}/geofences:
    get:
      tags:
        - geofences
      summary: Get user geofences
      parameters:
        - name: id
          in: path
          description: user id
          required: true
          schema:
            type: string
            format: JSON
        - name: filter
          description: JSON Filter object
          in: query
          required: false
          schema:
            type: string
            format: JSON
      responses:
'200':
yaml
          description: Request was successful
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    outline:
                      description: Array of {lat:x,lng:y} objects representing the vertices of the polygon. Do not use with center and radius.
                      type: array
                      items:
                        type: object
                    center:
                      properties:
                        lat:
                          type: number
                        lng:
                          type: number
                      type: object
                    radius:
                      description: For circular geofences, the radius of the circle in meters. Property is ignored if outline != null.
                      type: number
                      format: ''
                    type:
                      description: Grouping value
                      type: string
                    name:
                      type: string
                    wasInside:
                      default: false
                      description: If the last point received was inside the geofence. Only updated for notifications (not the safe-zone as that is evaluated on the device)
                      type: boolean
                    lastChecked:
                      description: When the geofence was last evaluated. Only updated for notifications (not the safe-zone as that is evaluated on the device)
                      type: string
                      format: date-time
                    modified:
                      default: false
                      type: boolean
                    meta:
                      type: object
                    foreignId:
                      type: string
                    id:
                      type: number
                      format: ''
                    deviceId:
                      type: number
                      format: ''
                    configId:
                      type: number
                      format: ''
                    userId:
                      type: number
                      format: ''
                  type: object
yaml
      deprecated: false
      security:
        - ApiKeyAuth: []
      operationId: get-users-id-geofences
components:
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey
      description: API Key for authentication. Retrieval from either API version login routes, or other authentication token type. See <a href='/apis/authentication'>Authentication</a> for more details.
      example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...