Geofences
Update Geofence
Change, pause or resume a geofence
PATCH
/
api
/
v1
/
geofences
/
{id}
Update Geofence
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/geofences/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/geofences/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/geofences/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/geofences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/geofences/{id}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sequenzy.com/api/v1/geofences/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/geofences/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"geofence": {
"id": "<string>",
"name": "<string>",
"externalId": {},
"group": {},
"latitude": 123,
"longitude": 123,
"radiusMeters": 123,
"dwellSeconds": {},
"cooldownSeconds": 123,
"active": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}
}Changes only the fields you send.
null clears dwellSeconds, group and externalId. Send "active": false to pause a geofence without deleting it. Requires the geofences:write scope.
Apps pick up changes on their next refresh. Events already recorded keep the name and group the geofence had at the time.
string
required
Geofence ID.
Request
Any of the create fields, none required.curl -X PATCH "https://api.sequenzy.com/api/v1/geofences/geo_123" \
-H "Authorization: Bearer $SEQUENZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "radiusMeters": 300, "dwellSeconds": null }'
Response
object
Show properties
Show properties
string
Geofence ID.
string
Name.
string | null
Your ID for the place.
string | null
Group label.
number
Center latitude.
number
Center longitude.
integer
Radius in meters.
integer | null
Dwell time, or
null when off.integer
Cooldown per contact and transition.
boolean
Whether apps watch it.
string
ISO 8601 creation time.
string
ISO 8601 time of the last change.
Errors
| Status | When |
|---|---|
| 400 | A field is out of range or has the wrong type. The message names the field, for example radiusMeters must be between 100 and 10000. |
| 401 | The API key is missing or invalid. |
| 403 | The key lacks the required scope or has no company selected. |
| 404 | No geofence with this ID in the workspace. |
| 409 | Another geofence already uses this externalId. |
⌘I
Update Geofence
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/geofences/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/geofences/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/geofences/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/geofences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/geofences/{id}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sequenzy.com/api/v1/geofences/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/geofences/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"geofence": {
"id": "<string>",
"name": "<string>",
"externalId": {},
"group": {},
"latitude": 123,
"longitude": 123,
"radiusMeters": 123,
"dwellSeconds": {},
"cooldownSeconds": 123,
"active": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}
}