Create a geofence (a polygon, or a circle); an existing externalId is replaced
POST
/v1/geofences
const url = 'https://api.tareky.com/v1/geofences';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"externalId":"example","name":"example","metadata":{"additionalProperty":"example"},"geometry":{"type":"Polygon","coordinates":["example"]},"circle":{"center":["example"],"radiusM":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tareky.com/v1/geofences \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "externalId": "example", "name": "example", "metadata": { "additionalProperty": "example" }, "geometry": { "type": "Polygon", "coordinates": [ "example" ] }, "circle": { "center": [ "example" ], "radiusM": 1 } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”x-access-key-id
string
Legacy key id (until its sunset)
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
externalId
string
name
string
metadata
object
key
additional properties
geometry
object
type
required
string
coordinates
required
Array
circle
object
center
required
array
radiusM
required
number
Responses
Section titled “Responses”Rate limit or monthly quota exceeded; see Retry-After
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable code, e.g. quota_exceeded, no_route
string
message
required
string
status
required
integer
details
For invalid_request: the validation issues
docsUrl
required
string
requestId
string
Examplegenerated
{ "error": { "code": "example", "message": "example", "status": 1, "details": "example", "docsUrl": "example" }, "requestId": "example"}default
Section titled “default”Any other error, in the /v1 error envelope
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable code, e.g. quota_exceeded, no_route
string
message
required
string
status
required
integer
details
For invalid_request: the validation issues
docsUrl
required
string
requestId
string
Examplegenerated
{ "error": { "code": "example", "message": "example", "status": 1, "details": "example", "docsUrl": "example" }, "requestId": "example"}