sidebar_position | title | id |
---|---|---|
8 |
API Reference |
api |
import Alert from "../src/components/Alert";
Use Radar APIs as building blocks for location-based products and services like pickup and delivery tracking, location-triggered notifications, location verification, store locators, address autocomplete, and more. Or, use Radar APIs to manage your Radar data, including users, geofences, and events.
The API is RESTful, with predictable, resource-oriented URLs. All responses, including errors, return JSON. POST and PUT request body parameters may be sent as application/json
or application/x-www-form-urlencoded
.
All requests must be authenticated. Authenticate using your API keys, found on the Settings page. Include your API key in the Authorization
header.
API endpoints with authentication level Publishable
are safe to call client-side (e.g., from the SDK). You should use your publishable API keys to call these endpoints. Use your Test Publishable
key for testing and non-production environments. Use your Live Publishable
key for production environments.
API endpoints with authentication level Secret
are only safe to call server-side. You should use your secret API keys to call these endpoints. Use your Test Secret
key for testing and non-production environments. Use your Live Secret
key for production environments. Include your API key in the Authorization
header.
curl https://api.radar.io/v1/users \
-H "Authorization: prj_live_sk_..."
The API uses standard HTTP response codes.
200
: Success202
: Accepted400
: Bad request (missing or invalid params)401
: Unauthorized (invalid API key)402
: Payment required (organization disabled or usage exceeded)403
: Forbidden (insufficient permissions)404
: Not found409
: Conflict429
: Too many requests (rate limit exceeded, no state change, or selective throttling)451
: Unavailable for legal reasons (country blocklisted)500
: Internal server error503
: Service temporarily unavailable
{
"meta": {
"code": 400,
"param": "latitude",
"message": "latitude: Invalid latitude. Valid range: [-90, 90]."
}
}
Use these endpoints as building blocks for location-based products and services like delivery tracking, store locators, address autocomplete, location-based content and notifications, and more.
Tracks a location update. Returns the user and the events generated, depending on project settings.
On iOS and Android, use the SDK to track user locations in the foreground or in the background.
deviceId
is used to identify logged out users. userId
and deviceId
are used to identify logged in users. If a matching user already exists, it will be updated. If not, a new user will be created.
Do not send any PII, like names, email addresses, or publicly available IDs, for userId
. See privacy best practices for more information.
This endpoint is stateful. For anonymous or stateless context, call the context endpoint instead.
POST https://api.radar.io/v1/track
deviceId
(string, required): A device ID for the user. Used to identify logged out users.userId
(string, optional): A stable unique ID for the user. Used withdeviceId
to identify logged in users. Not required for logged out users.latitude
(number, required): The user's current latitude. A number between -90 and 90.longitude
(number, required): The user's current longitude. A number between -180 and 180.accuracy
(number, required): The accuracy of the user's current latitude and longitude, in meters. A number greater than 0.foreground
(boolean):true
if the client is in the foreground,false
if the client is in the background.stopped
(boolean):true
if the user is stopped,false
if the user is moving.description
(string, optional): An optional description for the user, displayed in the dashboard.metadata
(dictionary, optional): An optional dictionary of custom metadata for the user. Up to 16 keys and values of type string, boolean, or number.deviceType
(string, optional): The user's device type, one ofiOS
,Android
, orWeb
.updatedAt
(datetime, optional): The client timestamp or historical timestamp when the user's location was updated. Historical data must be upserted in chronological order. Optional, defaults to the current server timestamp if not provided or not in chronological order. A valid date or ISO date string.
Publishable
1 request per second per device, 180 requests per hour per device, and 1,000 requests per day per device
curl "https://api.radar.io/v1/track" \
-H "Authorization: prj_live_pk_..." \
-X POST \
-d "deviceId=C305F2DB-56DC-404F-B6C1-BC52F0B680D8" \
-d "userId=1" \
-d "latitude=40.78382" \
-d "longitude=-73.97536" \
-d "accuracy=65"
{
"meta": {
"code": 200
},
"events": [
{
"_id": "56db1f4613012711002229f6",
"type": "user.entered_geofence",
"createdAt": "2018-06-12T13:44:10.535Z",
"live": true,
"user": {
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
"metadata": {
"customId": "abc",
"customFlag": false
}
},
"geofence": {
"tag": "store",
"externalId": "123",
"description": "Store #123",
"metadata": {
"parking": false
}
},
"location": {
"type": "Point",
"coordinates": [
-73.977797,
40.783826
]
},
"locationAccuracy": 5,
"confidence": 3
},
{
"_id": "56db1f4613012711002229f7",
"type": "user.entered_place",
"createdAt": "2018-06-12T13:44:10.535Z",
"live": true,
"user": {
"_id": "56db1f4613012711002229f4",
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
"metadata": {
"customId": "abc",
"customFlag": false
}
},
"place": {
"name": "Starbucks",
"chain": {
"name": "Starbucks",
"slug": "starbucks",
"externalId": "123",
"metadata": {
"customFlag": true
}
},
"categories": [
"food-beverage",
"coffee-shop"
],
"location": {
"type": "Point",
"coordinates": [
-73.977797,
40.783826
]
}
},
"location": {
"type": "Point",
"coordinates": [
-73.977797,
40.783826
]
},
"locationAccuracy": 5,
"confidence": 2
}
],
"user": {
"_id": "56db1f4613012711002229f4",
"live": true,
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
"metadata": {
"customId": "abc",
"customFlag": false
},
"updatedAt": "2018-06-12T13:44:10.535Z",
"createdAt": "2018-06-10T11:23:58.741Z",
"location": {
"type": "Point",
"coordinates": [
-73.977797,
40.783826
]
},
"locationAccuracy": 5,
"stopped": true,
"foreground": false,
"deviceType": "iOS",
"ip": "173.14.0.1",
"geofences": [
{
"tag": "store",
"externalId": "123",
"description": "Store #123",
"metadata": {
"parking": false
}
}
],
"place": {
"name": "Starbucks",
"chain": {
"name": "Starbucks",
"slug": "starbucks"
},
"categories": [
"food-beverage",
"coffee-shop"
],
"location": {
"type": "Point",
"coordinates": [
-73.977797,
40.783826
]
}
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"state": {
"code": "MD",
"name": "Maryland"
},
"dma": {
"code": "26",
"name": "Baltimore"
},
"postalCode": {
"code": "21014",
"name": "21014"
},
"segments": [
{
"description": "Starbucks Visitors",
"externalId": "starbucks-visitors"
}
],
"topChains": [
{
"name": "Starbucks",
"slug": "starbucks",
"externalId": "123"
},
{
"name": "Walmart",
"slug": "walmart",
"externalId": "456"
}
],
"fraud": {
"proxy": false,
"mocked": false
}
}
}
Gets context for a location, depending on project settings, without sending device or user identifiers to the server.
This endpoint is stateless and anonymous. For stateful context, call the track endpoint instead.
GET https://api.radar.io/v1/context
coordinates
(string, required): The coordinates. A string in the formatlatitude,longitude
.
Publishable
10 requests per second
curl "https://api.radar.io/v1/context?coordinates=40.78382,-73.97536" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"context": {
"geofences": [
{
"tag": "store",
"externalId": "123",
"description": "Store #123",
"metadata": {
"parking": false
}
}
],
"place": {
"name": "Starbucks",
"chain": {
"name": "Starbucks",
"slug": "starbucks"
},
"categories": [
"food-beverage",
"coffee-shop"
],
"location": {
"type": "Point",
"coordinates": [
-73.977797,
40.783826
]
}
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"state": {
"code": "MD",
"name": "Maryland"
},
"dma": {
"code": "26",
"name": "Baltimore"
},
"postalCode": {
"code": "21014"
}
}
}
Geocodes an address, converting address to coordinates.
This endpoint is best for complete addresses. For partial addresses or place names, call the autocomplete endpoint instead.
GET https://api.radar.io/v1/geocode/forward
query
(string, required): The address to geocode.layers
(string, optional): Optional layer filters. A string, comma-separated, including one or more ofplace
,address
,intersection
,street
,neighborhood
,postalCode
,locality
,county
,state
,country
,coarse
, andfine
. Note thatcoarse
includes all ofneighborhood
,postalCode
,locality
,county
,state
, andcountry
, whereasfine
includes all ofplace
,address
,intersection
, andstreet
. If not provided, results from all layers will be returned.country
(string, optional): An optional countries filter. A string of comma separated countries, the unique 2-letter country code.
Publishable
10 requests per second
curl "https://api.radar.io/v1/geocode/forward?query=20+jay+st+brooklyn+ny" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"addresses": [
{
"latitude": 40.70390,
"longitude": -73.98670,
"geometry": {
"type": "Point",
"coordinates": [-73.98670, 40.70390]
},
"addressLabel": "20 Jay Street",
"formattedAddress": "20 Jay Street, Brooklyn, New York, NY 11201 USA",
"country": "United States",
"countryCode": "US",
"countryFlag": "🇺🇸",
"state": "New York",
"stateCode": "NY",
"postalCode": "11201",
"city": "New York",
"borough": "Brooklyn",
"county": "Kings County",
"neighborhood": "DUMBO",
"number": "20",
"confidence": "exact",
"layer": "address"
}
]
}
Reverse geocodes a location, converting coordinates to address.
GET https://api.radar.io/v1/geocode/reverse
coordinates
(string, required): The coordinates to reverse geocode. A string in the formatlatitude,longitude
.layers
(string, optional): Optional layer filters. A string, comma-separated, including one or more ofplace
,address
,intersection
,street
,neighborhood
,locality
,county
,state
,country
,coarse
, andfine
. Note thatcoarse
includes all ofneighborhood
,locality
,county
,state
, andcountry
, whereasfine
includes all ofplace
,address
,intersection
, andstreet
. If not provided, results from all layers will be returned. If not provided, results from all layers will be returned.
Publishable
10 requests per second
curl "https://api.radar.io/v1/geocode/reverse?coordinates=40.70390,-73.98670" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"addresses": [
{
"latitude": 40.70390,
"longitude": -73.98670,
"geometry": {
"type": "Point",
"coordinates": [-73.98670, 40.70390]
},
"addressLabel": "20 Jay Street",
"formattedAddress": "20 Jay Street, Brooklyn, New York, NY 11201 USA",
"country": "United States",
"countryCode": "US",
"countryFlag": "🇺🇸",
"state": "New York",
"stateCode": "NY",
"postalCode": "11201",
"city": "New York",
"borough": "Brooklyn",
"county": "Kings County",
"neighborhood": "DUMBO",
"number": "20",
"distance": 5,
"layer": "address"
}
]
}
Geocodes an IP address, converting IP address to city, state, and country.
GET https://api.radar.io/v1/geocode/ip
ip
(string, optional): The IP address to geocode. Defaults to the request IP address.
Publishable
10 requests per second
curl "https://api.radar.io/v1/geocode/ip?ip=107.77.199.117" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"address": {
"latitude": 40.70390,
"longitude": -73.98670,
"geometry": {
"type": "Point",
"coordinates": [-73.98670, 40.70390]
},
"country": "United States",
"countryCode": "US",
"countryFlag": "🇺🇸",
"state": "New York",
"stateCode": "NY",
"postalCode": "11201",
"city": "New York"
},
"proxy": false,
"ip": "107.77.199.117"
}
Autocompletes partial addresses and place names, sorted by relevance.
GET https://api.radar.io/v1/search/autocomplete
query
(string, required): The partial address or place name to autocomplete.near
(string, optional): The location to search. A string in the formatlatitude,longitude
. If not provided, the request IP address will be used to anchor the search.layers
(string, optional): Optional layer filters. A string, comma-separated, including one or more ofplace
,address
,intersection
,street
,neighborhood
,postalCode
,locality
,county
,state
,country
,coarse
, andfine
. Note thatcoarse
includes all ofneighborhood
,postalCode
,locality
,county
,state
, andcountry
, whereasfine
includes all ofplace
,address
,intersection
, andstreet
. If not provided, results from all layers will be returned.limit
(number, optional): The max number of addresses to return. A number between 1 and 100. Defaults to 10.country
(string, optional): An optional countries filter. A string of comma separated countries, the unique 2-letter country code.
Publishable
10 requests per second
curl "https://api.radar.io/v1/search/autocomplete?query=brooklyn+roasting&near=40.70390,-73.98670" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"addresses": [
{
"latitude": 40.70390,
"longitude": -73.98670,
"geometry": {
"type": "Point",
"coordinates": [-73.98670, 40.70390]
},
"placeLabel": "Brooklyn Roasting Company",
"addressLabel": "25 Jay Street",
"formattedAddress": "25 Jay Street, Brooklyn, New York, NY 11201 USA",
"country": "United States",
"countryCode": "US",
"countryFlag": "🇺🇸",
"state": "New York",
"stateCode": "NY",
"postalCode": "11201",
"city": "New York",
"borough": "Brooklyn",
"county": "Kings County",
"neighborhood": "DUMBO",
"number": "25",
"distance": 5,
"layer": "place"
}
]
}
Searches for users near a location, sorted by distance.
GET https://api.radar.io/v1/search/users
near
(string, required): A location for the search. A string in the formatlatitude,longitude
.radius
(number, optional): The radius to search, in meters. A number between 100 and 10000. Defaults to 1000. Ifmode
is specified, theradius
is the travel duration in minutes.mode
(string, optional): The travel mode. A string with a value offoot
,bike
, orcar
.metadata[key]
(string, optional): Optional metadata filters. Values may be of type string. Type will be automatically inferred. For example, to match onworking == true
, use&metadata[working]=true
.limit
(number, optional): The max number of users to return. A number between 1 and 100. Defaults to 10.
Secret
10 requests per second
curl "https://api.radar.io/v1/search/users?near=40.78382,-73.97536&radius=1000&limit=10" \
-H "Authorization: prj_live_sk_..."
{
"meta": {
"code": 200
},
"users": [
{
"_id": "56db1f4613012711002229f4",
"live": true,
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
...
},
...
]
}
Searches for geofences near a location, sorted by distance.
GET https://api.radar.io/v1/search/geofences
tags
(string, optional): Optional tag filters. A string, comma-separated.metadata[key]
(string, optional): Optional metadata filters. Values may be of type string. Type will be automatically inferred. For example, to match onoffers == true
, use&metadata[offers]=true
.near
(string, required): A location for the search. A string in the formatlatitude,longitude
.radius
(number, optional): The radius to search, in meters. A number between 100 and 10000. Defaults to 1000.limit
(number, optional): The max number of geofences to return. A number between 1 and 100. Defaults to 10.
Publishable
10 requests per second
curl "https://api.radar.io/v1/search/geofences?tags=store&metadata[offers]=true&near=40.783826,-73.975363&radius=1000&limit=10" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"geofences": [
{
"_id": "56db1f4613012711002229f5",
"createdAt": "2016-06-10T13:44:10.535Z",
"live": true,
"tag": "store",
"externalId": "123",
"description": "Store #123",
"metadata": {
"rating": "4.5"
},
"geometryCenter": {
"type": "Point",
"coordinates": [-73.97536, 40.78382]
},
...
},
...
]
}
Searches for places near a location, sorted by distance.
GET https://api.radar.io/v1/search/places
chains
(string, optional): Chain slug filters. A string, comma-separated. If your project has a chain mapping, the mapped ID can be used in place of the chain slug. If not provided, one ofcategories
orgroups
must be provided.categories
(string, optional): Category filters. A string, comma-separated. If not provided, one ofchains
orgroups
must be provided.groups
(string, optional): Group filters. A string, comma-separated. If not provided, one ofchains
orcategories
must be provided.chainMetadata[key]
(optional): Optional chain metadata filters. Values may be of type string, boolean, or number. Type will be automatically inferred. For example, to match onoffers == true
, use&chainMetadata[offers]=true
.near
(string, required): A location for the search. A string in the formatlatitude,longitude
.radius
(number, optional): The radius to search, in meters. A number between 100 and 10000. Defaults to 1000.limit
(number, optional): The max number of places to return. A number between 1 and 100. Defaults to 10.
Publishable
10 requests per second
curl "https://api.radar.io/v1/search/places?chains=starbucks&near=40.78382,-73.97779&radius=1000&limit=10" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"places": [
{
"name": "Starbucks",
"chain": {
"name": "Starbucks",
"slug": "starbucks",
"externalId": "123",
"metadata": {
"customFlag": true
}
},
"categories": [
"food-beverage",
"coffee-shop"
],
"location": {
"type": "Point",
"coordinates": [
-73.97779,
40.78382
]
}
},
...
]
}
Calculates the travel distance and duration between an origin and a destination.
GET https://api.radar.io/v1/route/distance
origin
(string, required): The origin. A string in the formatlatitude,longitude
.destination
(string, required): The destination. A string in the formatlatitude,longitude
.modes
(string, required): The travel modes. A string, comma-separated, including one or more offoot
,bike
, andcar
.units
(string, required): The distance units. A string,metric
orimperial
.
Publishable
10 requests per second
curl "https://api.radar.io/v1/route/distance?origin=40.78382,-73.97536&destination=40.70390,-73.98690&modes=foot,car&units=imperial" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"routes": {
"geodesic": {
"distance": {
"value": 29333.03,
"text": "5.6 mi"
}
},
"foot": {
"distance": {
"value": 54596.46,
"text": "10.3 mi",
},
"duration": {
"value": 98.48,
"text": "1 hr 38 min"
}
},
"car": {
"distance": {
"value": 42480.31,
"text": "8.0 mi"
},
"duration": {
"value": 19.9,
"text": "20 mins"
}
}
}
}
Calculates the travel distances and durations between multiple origins and destinations for up to 25 routes.
GET https://api.radar.io/v1/route/matrix
origins
(string, required): A list of origins. A pipe-delimited string in the formatlatitude0,longitude0|latitude1,longitude1|...
.destinations
(string, required): A list of destinations. A pipe-delimited string in the formatlatitude0,longitude0|latitude1,longitude1|...
.mode
(string, required): The travel mode. A string, one offoot
,bike
, orcar
.units
(string, required): The distance units. A string,metric
orimperial
.
Publishable
10 requests per second
curl "https://api.radar.io/v1/route/matrix?origins=40.78382,-73.97536&destinations=40.70390,-73.98690|40.73237,-73.94884&mode=car&units=imperial" \
-H "Authorization: prj_live_pk_..."
{
"meta": {
"code": 200
},
"origins": [
{
"latitude": 40.78382,
"longitude": -73.97536
}
],
"destinations": [
{
"latitude": 40.70390,
"longitude": -73.98670
},
{
"latitude": 40.73237,
"longitude": -73.94884
}
],
"matrix": [
[
{
"distance": {
"value": 42480.31,
"text": "8.0 mi"
},
"duration": {
"value": 19.9,
"text": "20 mins"
},
"originIndex": 0,
"destinationIndex": 0
},
{
"distance": {
"value": 31108.92,
"text": "5.8 mi"
},
"duration": {
"value": 17.13,
"text": "17 mins"
},
"originIndex": 0,
"destinationIndex": 1
}
]
]
}
Use these endpoints to manage your Radar data, including users, geofences, and events.
A user represents a user tracked in your project. Users can be referenced by Radar _id
, userId
, or deviceId
.
_id
(string): A unique ID for the user, provided by Radar. An alphanumeric string.live
(boolean):true
if the user was created with yourlive
API key,false
if the user was created with yourtest
API key.userId
(string): A stable unique ID for the user.deviceId
(string): A device ID for the user.description
(string): An optional description for the user.metadata
(dictionary): An optional dictionary of custom metadata for the user.location
(point): The user's current location, aPoint
in GeoJSON format.locationAccuracy
(number): The accuracy of the user's current location in meters.foreground
(boolean):true
if the user's current was updated in the foreground,false
if the user's current location was updated in the background.stopped
(boolean):true
if the user's current location was updated while stopped,false
if the user's current location was updated while moving.deviceType
(string): The user's device type, one ofiOS
,Android
, orWeb
.createdAt
(datetime): The datetime when the user was created.updatedAt
(datetime): The datetime when the user's location was last updated.geofences
(array): An array of the user's current geofences.trip
(dictionary): When a Trip has been started, the user's current trip. Present when the trip has astatus
ofstarted
,approaching
, orarrived
.place
(dictionary): When Places is enabled, the user's current place.country
(dictionary): When Regions is enabled, the user's current country.state
(dictionary): When Regions is enabled, the user's current state. US-only.dma
(dictionary): When Regions is enabled, the user's current DMA (market area). US-only.postalCode
(dictionary): When Regions is enabled, the user's current postal code. US-only.
{
"_id": "56db1f4613012711002229f4",
"live": true,
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
"metadata": {
"customId": "123",
"customFlag": false
},
"location": {
"type": "Point",
"coordinates": [-73.97536, 40.78382]
},
"locationAccuracy": 5,
"foreground": true,
"stopped": true,
"deviceType": "iOS",
"updatedAt": "2016-06-10T13:44:10.535Z",
"geofences": [
{
"_id": "56db1f4613012711002229f5",
"tag": "neighborhood",
"externalId": "1",
"description": "Upper West Side",
...
},
...
],
"trip:": {
"_id": "5f3e50491c2b7d005c81f5d9",
"live": true,
"status": "started",
"externalId": "299",
"metadata": {
"Customer Name": "Jacob Pena",
"Car Model": "Green Honda Civic"
},
"mode": "car",
"destinationGeofenceTag": "store",
"destinationGeofenceExternalId": "123",
"destinationLocation": {
"coordinates": [
-105.061198,
39.779366
],
"type": "Point"
},
"eta": {
"duration": 5.5,
"distance": 1331
},
...
},
"place": {
"_id": "56db1f4613012711002229f7",
"facebookId": "37965424481",
"name": "Starbucks",
"categories": [
"food-beverage",
"cafe",
"coffee-shop"
],
"chain": {
"name": "Starbucks",
"slug": "starbucks"
}
},
"country": {
"name": "United States",
"code": "US"
},
"state": {
"name": "New Jersey",
"code": "NJ"
},
"dma": {
"name": "New York",
"code": "501"
},
"postalCode": {
"code": "07302"
}
}
To create a user, call the track endpoint.
On iOS and Android, use the SDK to track users.
Lists users. Users are sorted descending by updatedAt
.
GET https://api.radar.io/v1/users
limit
(number, optional): The max number of users to return. A number between 1 and 1000. Defaults to 100.updatedBefore
(datetime, optional): A cursor for use in pagination. Retrieves users updated before the specified datetime. A date or valid ISO date string.updatedAfter
(datetime, optional): A cursor for use in pagination. Retrieves users updated after the specified datetime. A date or valid ISO date string.
10 requests per second
Secret
curl "https://api.radar.io/v1/users" \
-H "Authorization: prj_live_sk_..."
{
"meta": {
"code": 200,
"hasMore": true
},
"users": [
{
"_id": "56db1f4613012711002229f4",
"live": true,
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
...
},
...
]
}
Gets a user. The user can be referenced by Radar _id
, userId
, or deviceId
.
GET https://api.radar.io/v1/users/:id
10 requests per second
Secret
curl "https://api.radar.io/v1/users/56db1f4613012711002229f4" \
-H "Authorization: prj_live_sk_..."
{
"meta": {
"code": 200
},
"user": {
"_id": "56db1f4613012711002229f4",
"live": true,
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
...
}
}
Deletes a user. The user can be referenced by Radar _id
, userId
, or deviceId
.
DELETE https://api.radar.io/v1/users/:id
10 requests per second
Secret
curl "https://api.radar.io/v1/users/56db1f4613012711002229f4" \
-H "Authorization: prj_live_sk_..." \
-X DELETE
{
"meta": {
"code": 200
}
}
A trip is a sequence of location updates with metadata and a unique ID, optionally with an ETA to a destination geofence. Depending on your use case, a trip may represent a pickup, a delivery, or something else.
_id
(string): The unique ID for the trip, provided by Radar. An alphanumeric string.live
(boolean):true
if the user was created with yourlive
API key,false
if the user was created with yourtest
API key.externalId
(string): A stable unique ID for the trip. Depending on your use case, may represent an order ID, a delivery ID, or something else.metadata
(dictionary): An optional set of custom key-value pairs for the trip, displayed in the trip tracking dashboard.mode
(string): The travel mode for the trip. A string, one offoot
,bike
, andcar
.destinationGeofenceTag
(string): For trips with a destination, the tag of the destination geofence.destinationGeofenceExternalId
(string): For trips with a destination, the external ID of the destination geofence.destinationLocation
(point): For trips with a destination, the location of the destination geofence.eta
(dictionary): For trips with a destination, the ETA to the destination geofence based on the travel mode for the trip, includingduration
in minutes anddistance
in meters.approachingThreshold
(number): For trips with a destination, the trip approaching threshold setting for the trip (in minutes). Overrides the geofence-level and project-level trip approaching threshold settings.createdAt
(datetime): The datetime when the trip was started.updatedAt
(datetime): The datetime when the trip's location was last updated.scheduledArrivalAt
(datetime): Required for the Olo order firing integration, the backstop datetime when the order associated with the trip should be fired.orderFiredAt
(datetime): From the Olo integration, the datetime when the order associated with the trip was fired.arrivedAt
(datetime): For trips with a destination, the datetime when the user arrived at the trip destination (entered the destination geofence).completedAt
(datetime): The datetime when the trip was stopped.status
(string): The status of the trip, one ofpending
,started
,approaching
,arrived
,expired
,completed
, orcanceled
.user
(dictionary): The user for which the trip is being tracked.locations
(array): The location updates tracked while the trip was active. An array ofPoint
s in GeoJSON format.
{
"_id": "5f3e50491c2b7d005c81f5d9",
"live": true,
"status": "started",
"externalId": "299",
"metadata": {
"Customer Name": "Jacob Pena",
"Car Model": "Green Honda Civic"
},
"mode": "car",
"destinationGeofenceTag": "store",
"destinationGeofenceExternalId": "123",
"destinationLocation": {
"coordinates": [
-105.061198,
39.779366
],
"type": "Point"
},
"approachingThreshold": 3,
"eta": {
"duration": 5.5,
"distance": 1331
},
"createdAt": "2020-08-20T10:27:55.830Z",
"updatedAt": "2020-08-20T10:30:55.837Z",
"user": {
"_id": "56db1f4613012711002229f4",
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8"
},
"locations": [
{
"type": "Point",
"coordinates": [
-105.062645,
39.766059819860864
],
"updatedAt": "2020-08-20T10:29:55.897Z"
},
{
"type": "Point",
"coordinates": [
-105.06267319809022,
39.769057068070715
],
"updatedAt": "2020-08-20T10:30:55.837Z"
}
]
}
Gets a trip. The trip can be referenced by Radar _id
or externalId
.
GET https://api.radar.io/v1/trips/:id
10 requests per second
curl "https://api.radar.io/v1/trips/299" \
-H "Authorization: prj_live_sk_..."
Secret
{
"_id": "5f3e50491c2b7d005c81f5d9",
"live": true,
"status": "started",
"externalId": "299",
"metadata": {
"Customer Name": "Jacob Pena",
"Car Model": "Green Honda Civic"
},
"mode": "car",
"destinationGeofenceTag": "store",
"destinationGeofenceExternalId": "123",
"destinationLocation": {
"coordinates": [
-105.061198,
39.779366
],
"type": "Point"
},
"eta": {
"duration": 5.5,
"distance": 1331
},
...
}
Lists trips. Trips are sorted descending by eta
.
GET https://api.radar.io/v1/trips
status
(string, optional): Retrieves trips by status. A string, comma-separated including one or more ofpending
,started
,approaching
,arrived
,completed
,canceled
,expired
.destinationGeofenceTag
(string, optional): Retrieves trips with the destination geofence tag.destinationGeofenceExternalId
(string, optional): Retrieves trips with the destination geofence external ID.
10 requests per second
curl "https://api.radar.io/v1/trips?status=started&destinationGeofenceTag=store&destinationGeofenceExternalId=123" \
-H "Authorization: prj_live_sk_..."
Secret
{
"meta": {
"code": 200
},
"trips": [
{
"_id": "5f3e50491c2b7d005c81f5d9",
"live": true,
"status": "started",
"externalId": "299",
"metadata": {
"Customer Name": "Jacob Pena",
"Car Model": "Green Honda Civic"
},
"mode": "car",
"destinationGeofenceTag": "store",
"destinationGeofenceExternalId": "123",
"destinationLocation": {
"coordinates": [
-105.06119826017914,
39.7793665
],
"type": "Point"
},
"eta": {
"duration": 5.5,
"distance": 1331
},
"createdAt": "2020-08-20T10:27:55.830Z",
"updatedAt": "2020-08-20T10:30:55.837Z",
...
},
...
]
}
Use the SDK to start trips and track users.
If a trip needs to be created outside of the SDK implementation, you can update a trip with status = pending
and then use the SDK to start a matching trip and initiate tracking.
Updates the status of a trip. The trip can be referenced by Radar _id
or externalId
.
On iOS and Android, use the SDK to stop trips.
PATCH https://api.radar.io/v1/trips/:id
status
(string, required): The new status of the trip, one ofpending
,started
,approaching
,arrived
,completed
, orcanceled
.approachingThreshold
(number, optional): For trips with a destination, the trip approaching threshold setting for the trip (in minutes). Overrides the geofence-level and project-level trip approaching threshold settings.
10 requests per second
curl "https://api.radar.io/v1/trips/299" \
-H "Authorization: prj_live_sk_..."
-X PATCH
-d "status=completed"
Publishable
{
"meta": {
"code": 200
}
}
A geofence represents a custom region or place monitored in your project. Geofences can be uniquely referenced by Radar _id
or by tag
and externalId
.
_id
(string): The unique ID for the geofence, provided by Radar. An alphanumeric string.createdAt
(datetime): The datetime when the geofence was created.updatedAt
(datetime): The datetime when the geofence was last updated.live
(boolean):true
if the geofence was created with yourlive
API key,false
if the user was created with yourtest
API key.tag
(string): A group for the geofence.externalId
(string): An external ID for the geofence that maps to your internal database.description
(string): A description for the geofence.type
(string): The type of geofence geometry, one ofcircle
,polygon
, orisochrone
.geometry
(polygon): The geometry of the geofence. Coordinates for typepolygon
. A calculated polygon approximation for typecircle
andisochrone
. APolygon
in GeoJSON format.geometryCenter
(point): The center for typecircle
. The calculated centroid of the polygon for typepolygon
. The destination for typeisochrone
. APoint
in GeoJSON format.geometryRadius
(number): The radius in meters for typecircle
. The calculated approximate radius of the polygon for typepolygon
. The travel duration in minutes for typeisochrone
.mode
(string): The travel mode for typeisochrone
.metadata
(dictionary): An optional set of custom key-value pairs for the geofence.userId
(string): An optional user restriction for the geofence. If set, the geofence will only generate events for the specified user. If not set, the geofence will generate events for all users.tripApproachingThreshold
(number): The trip approaching threshold setting for the geofence (in minutes). Overrides the project-level trip approaching threshold setting.dwellThreshold
(number): An optional field to trigger dwell events. If set anduser.dwelled_in_geofence
is enabled in settings, an event is triggered when a user dwells in the geofence longer than the threshold (in minutes).enabled
(boolean): Iftrue
, the geofence will generate events. Iffalse
, the geofence will not generate events. Defaults totrue
.
{
"_id": "56db1f4613012711002229f5",
"createdAt": "2016-06-10T13:44:10.535Z",
"updatedAt": "2016-06-10T14:40:10.535Z",
"live": true,
"tag": "venue",
"externalId": "2",
"description": "Coffee Shop",
"type": "circle",
"geometry": {
"type": "Polygon",
"coordinates": [[...]]
},
"geometryCenter": {
"type": "Point",
"coordinates": [-73.97536, 40.78382]
},
"geometryRadius": 50,
"metadata": {
...
},
"enabled": true
}
Lists geofences. Geofences are sorted descending by updatedAt
.
GET https://api.radar.io/v1/geofences
limit
(number, optional): The max number of geofences to return. A number between 1 and 1000. Defaults to 100.createdBefore
(datetime, optional): Retrieves geofences created before the specified datetime. A date or valid ISO date string.createdAfter
(datetime, optional): Retrieves geofences created after the specified datetime. A date or valid ISO date string.updatedBefore
(datetime, optional): A cursor for use in pagination. Retrieves geofences updated before the specified datetime. A date or valid ISO date string.updatedAfter
(datetime, optional): A cursor for use in pagination. Retrieves geofences updated after the specified datetime. A date or valid ISO date string.tag
(string, optional): Retrieves geofences with the specifiedtag
.externalId
(string, optional): Retrieves geofences with the specifiedexternalId
.
10 requests per second
curl "https://api.radar.io/v1/geofences" \
-H "Authorization: prj_live_sk_..."
Secret
{
"meta": {
"code": 200,
"hasMore": true
},
"geofences": [
{
"_id": "56db1f4613012711002229f5",
"createdAt": "2016-06-10T13:44:10.535Z",
"live": true,
"tag": "venue",
"externalId": "2",
"description": "Coffee Shop",
"type": "circle",
...
},
...
]
}
Gets a geofence. The geofence can be uniquely referenced by Radar _id
or by tag
and externalId
.
GET https://api.radar.io/v1/geofences/:id
GET https://api.radar.io/v1/geofences/:tag/:externalId
10 requests per second
Secret
curl "https://api.radar.io/v1/geofences/56db1f4613012711002229f5" \
-H "Authorization: prj_live_sk_..."
{
"meta": {
"code": 200
},
"geofence": {
"_id": "56db1f4613012711002229f5",
"createdAt": "2016-06-10T13:44:10.535Z",
"live": true,
"tag": "venue",
"externalId": "2",
"description": "Coffee Shop",
"type": "circle",
...
}
}
Upserts a geofence. The geofence can be uniquely referenced by tag
and externalId
or by the Radar _id
. If a geofence with the specified tag
and externalId
already exists, it will be updated. If not, it will be created.
PUT https://api.radar.io/v1/geofences/:tag/:externalId
PUT https://api.radar.io/v1/geofences/:id
description
(string, required): A description for the geofence.type
(string, required): The type of geofence geometry. A string, one ofcircle
,polygon
, orisochrone
.coordinates
(array, required ifaddress
andplaceId
are not included): An array or JSON string representing a center for typecircle
or a destination for typeisochrone
in the format[longitude,latitude]
. A two-dimensional array or JSON string representing a closed ring of between 4 and 2,000 coordinates in the format[[longitude0, latitude0],[longitude1,latitude1],[longitude2,latitude2],...,[longitude0,latitude0]]
for typepolygon
. Note that longitude comes before latitude, a GeoJSON convention.address
(string, required ifcoordinates
andplaceId
are not included): An address to search for, and if found, will represent the center for typecircle
orisochrone
. Ifaddress
andcoordinates
are both provided, they must be nearby, andcoordinates
will take precedent. Ignored for typepolygon
.radius
(number, required for typecircle
andisochrone
): The radius in meters for typecircle
, a number between10
and10000
. The travel duration in minutes for typeisochrone
. Ignored for typepolygon
.metadata
(dictionary, optional): An optional set of custom key-value pairs for the geofence. A dictionary or JSON string with up to 16 keys and values of type string, boolean, or number.userId
(string, optional): An optional user restriction for the geofence. If set, the geofence will only generate events for the specified user. If not set, the geofence will generate events for all users.enabled
(boolean, optional): Iftrue
, the geofence will generate events. Iffalse
, the geofence will not generate events. Defaults totrue
.disableAfter
(datetime, optional): Use to create temporary geofences. If set, the geofence will be disabled after the specified datetime. A date or valid ISO date string.deleteAfter
(datetime, optional): Use to create temporary geofences. If set, the geofence will be deleted after the specified datetime. A date or valid ISO date string.stopDetection
(boolean, optional): The stop detection setting for the geofence. Overrides the project-level stop detection setting.mode
(string, required for typeisochrone
): The travel mode for typeisochrone
.tripApproachingThreshold
(number, optional): The trip approaching threshold setting for the geofence (in minutes). Overrides the project-level trip approaching threshold setting.dwellThreshold
(number, optional): An optional field to trigger dwell events. If set anduser.dwelled_in_geofence
is enabled in settings, an event is triggered when a user dwells in the geofence longer than the threshold (in minutes).placeId
(string, required ifcoordinates
andaddress
are not included): For place matching, an optionalid
of the Radar place to match to the geofence. If provided and found, the place centroid will overridecoordinates
andaddress
.
10 requests per second
Secret
curl "https://api.radar.io/v1/geofences/venue/2" \
-H "Authorization: prj_live_sk_..." \
-X PUT \
-d "description=Coffee Shop" \
-d "type=circle" \
-d "coordinates=[-73.97536,40.78382]" \
-d "radius=50"
{
"meta": {
"code": 200
},
"geofence": {
"_id": "56db1f4613012711002229f5",
"createdAt": "2016-06-10T13:44:10.535Z",
"live": true,
"tag": "venue",
"externalId": "2",
"description": "Coffee Shop",
"type": "circle",
...
}
}
Deletes a geofence. The geofence can be uniquely referenced by Radar _id
or by tag
and externalId
.
DELETE https://api.radar.io/v1/geofences/:id
DELETE https://api.radar.io/v1/geofences/:tag/:externalId
10 requests per second
Secret
curl "https://api.radar.io/v1/geofences/56db1f4613012711002229f5" \
-H "Authorization: prj_live_sk_..." \
-X DELETE
{
"meta": {
"code": 200
}
}
Gets users currently in a geofence.
GET https://api.radar.io/v1/geofences/:tag/:externalId/users
10 requests per second
Secret
curl "https://api.radar.io/v1/geofences/venue/2/users" \
-H "Authorization: prj_live_sk_..."
{
"meta": {
"code": 200,
"hasMore": false
},
"users": [
{
"_id": "611ace2eb08f300047c904e9",
"location": {
"type": "Point",
"coordinates": [
73.97536,
40.78382
]
},
...
}
...
]
}
An event represents a change in user state. Events can be uniquely referenced by Radar _id
.
_id
(string): The unique ID for the event, provided by Radar. An alphanumeric string.createdAt
(datetime): The datetime when the event was created on the mobile client.actualCreatedAt
(datetime): The datetime when the event was created on the server. Mobile operating systems can deliver location updates on a delay, resulting in a delta between this field andcreatedAt
.live
(boolean):true
if the event was generated for a user and geofence created with yourlive
API key,false
if the event was generated for a user and geofence created with yourtest
API key.type
(string): The type of event. By default, events are generated when a user enters a geofence (typeuser.entered_geofence
) or exits a geofence (typeuser.exited_geofence
). Places and Regions also generate events.user
(dictionary): The user for which the event was generated.geofence
(dictionary): Foruser.entered_geofence
anduser.exited_geofence
events, the geofence for which the event was generated, includingdescription
,tag
, andexternalId
.place
(dictionary): Foruser.entered_place
anduser.exited_place
events, the place for which the event was generated, includingname
,categories
,chain
, andfacebookId
.alternatePlaces
(array): Foruser.entered_place
events, alternate place candidates.verifiedPlace
(dictionary): For verifieduser.entered_place
events, the verified place.location
(point): The location of the user at the time of the event, aPoint
in GeoJSON format.locationAccuracy
(number): The accuracy of the user's location at the time of the event in meters.confidence
(number): The confidence level of the event, one of3
(high),2
(medium), or1
(low).duration
(number): On exit events, the duration between entry and exit events, in minutes.
{
"_id": "56db1f4613012711002229f6",
"createdAt": "2016-06-10T13:44:10.535Z",
"live": true,
"type": "user.exited_geofence",
"location": {
"type": "Point",
"coordinates": [-73.97779, 40.78382]
},
"locationAccuracy": 5,
"confidence": 3,
"duration": 48.38920,
"user": {
"_id": "56db1f4613012711002229f4",
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
...
},
"geofence": {
"_id": "56db1f4613012711002229f5",
"tag": "venue",
"externalId": "2",
"description": "Coffee Shop",
...
}
}
To generate an entry or exit event, call the track endpoint to trigger an event. For example, specify a latitude
and longitude
to enter a geofence that you have created.
On iOS and Android, use the SDK to track users.
Custom events are available on the {` `} Enterprise plan .Sends a custom event to analyze alongside other location activity in your app. This can represent anything from a conversion or purchase to engagement with an in-app feature.
POST https://api.radar.io/v1/events
type
(string, required): The type of the custom event. Should be named generically (e.g.,in_app_purchase
). Only alphanumeric characters and underscores are supported.metadata
(dictionary, optional): The metadata of the custom event. This data cannot contain any sensitive or personally identifiable information.userId
(string, required): The stable unique ID for the user. Used to identify logged in users.deviceId
(string, optional): A device ID for the user. Used to identify logged out users.createdAt
(string, optional): The datetime when the event occurred.
Publishable
10 requests per second
curl "https://api.radar.io/v1/events" \
-H "Authorization: prj_live_pk_..." \
-X POST \
-d "type=conversion" \
-d "userId=user123"
{
"meta": {
"code": 200
},
"event": {
"_id": "56db1f4613012711002229f6",
"createdAt": "2016-06-10T13:44:10.535Z",
"live": true,
"type": "conversion",
"confidence": 3,
"user": {
"_id": "56db1f4613012711002229f4",
"userId": "user123",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
...
}
}
}
A beacon represents a Bluetooth beacon monotired in your project. Beacons can be uniquely referenced by Radar _id
or by tag
and externalId
.
_id
(string): A unique ID for the beacon, provided by Radar. An alphanumeric string.createdAt
(datetime): The datetime when the beacon was created.updatedAt
(datetime): The datetime when the beacon was last updated.live
(boolean):true
if the beacon was created with yourlive
API key,false
if the beacon was created with yourtest
API key.description
(string): A display name for the beacon.tag
(string): A group for the beacon.externalId
(string): An external ID for the beacon.type
(string, required): The type of beacon, one ofibeacon
(supported on iOS and Android) oreddystone
(supported on Android only).uuid
(string, required foribeacon
): For iBeacons, the UUID of the beacon.major
(string, required foribeacon
): For iBeacons, the major ID of the beacon.minor
(string, required foribeacon
): For iBeacons, the minor ID of the beacon.uid
(string, required foreddystone
): For Eddystone beacons, the UID of the beacon.instance
(string, required foreddystone
): For Eddystone beacons, the instance ID of the beacon.geometry
(point): The approximate location of the beacon, used to sync nearby beacons (within 1 kilometer) to the SDK. Coordinates for typepoint
in[longitude,latitude]
format.enabled
(boolean): If true, the beacon will generate events. If false, the beacon will not generate events.metadata
(dictionary): A set of custom key-value pairs for the beacon. A JSON string representing a dictionary with up to 16 keys and values of type string, boolean, or number.
{
"_id": "60f6da60cf4cc0a72a6c070b",
"createdAt": "2021-07-20T14:27:22.283Z",
"updatedAt": "2021-07-20T14:27:22.283Z",
"live": false,
"description": "Store #123 - Register #1",
"tag": "store-register",
"externalId": "123-1",
"type": "ibeacon",
"uuid": "b9407f30-f5f8-466e-aff9-25556b57fe6d",
"major": "100",
"minor": "1",
"geometry": {
"type": "Point",
"coordinates": [
-73.975384,
40.783747
]
},
"enabled": true,
"metadata": {
"supportsContactlessPayments": true
}
}
Lists beacons. Beacons are sorted descending by createdAt
.
GET https://api.radar.io/v1/beacons
limit
(number, optional): The max number of beacons to return. A number between 1 and 1000. Defaults to 100.createdBefore
(datetime, optional): A cursor for use in pagination. Retrieves beacons updated before the specified datetime. A date or valid ISO date string.createdAfter
(datetime, optional): A cursor for use in pagination. Retrieves beacons updated after the specified datetime. A date or valid ISO date string.tag
(string, optional): Retrieves beacons with the specifiedtag
.externalId
(string, optional): Retrieves beacons with the specifiedexternalId
.
10 requests per second
Secret
curl "https://api.radar.io/v1/beacons" \
-H "Authorization: prj_live_sk_..."
{
"meta": {
"code": 200,
"hasMore": true
},
"beacons": [
{
"_id": "6109a4b16dbfe3de2cb03924",
"createdAt": "2021-08-03T20:18:57.888Z",
"updatedAt": "2021-08-03T20:18:57.888Z",
"live": true,
"description": "Store #123 - Register #1",
...
},
...
]
}
Gets a beacon. The beacon can be uniquely referenced by Radar _id
or by tag
and externalId
.
GET https://api.radar.io/v1/beacons/:id
GET https://api.radar.io/v1/beacons/:tag/:externalId
10 requests per second
Secret
curl "https://api.radar.io/v1/beacons/6109a4b16dbfe3de2cb03924" \
-H "Authorization: prj_live_sk_..."
{
"meta": {
"code": 200
},
"beacon": {
"_id": "6109a4b16dbfe3de2cb03924",
"createdAt": "2021-08-03T20:18:57.888Z",
"updatedAt": "2021-08-03T20:18:57.888Z",
"live": true,
"description": "Store #123 - Register #1",
"tag": "store-register",
"externalId": "123-1",
...
}
}
Creates a beacon.
POST https://api.radar.io/v1/beacons
description
(string, required): A display name for the beacon.tag
(string, required): A group for the beacon.externalId
(string, required): An external ID for the beacon.type
(string, required): The type of beacon, one ofibeacon
(supported on iOS and Android) oreddystone
(supported on Android only).uuid
(string, required foribeacon
): For iBeacons, the UUID of the beacon.major
(string, required foribeacon
): For iBeacons, the major ID of the beacon.minor
(string, required foribeacon
): For iBeacons, the minor ID of the beacon.uid
(string, required foreddystone
): For Eddystone beacons, the UID of the beacon.instance
(string, required foreddystone
): For Eddystone beacons, the instance ID of the beacon.coordinates
(point, required): The approximate location of the beacon, used to sync nearby beacons (within 1 kilometer) to the SDK. Coordinates in[longitude,latitude]
format.enabled
(boolean, optional): If true, the beacon will generate events. If false, the beacon will not generate events.metadata
(dictionary, optional): A set of custom key-value pairs for the beacon. A JSON string representing a dictionary with up to 16 keys and values of type string, boolean, or number.
10 requests per second
Secret
curl "https://api.radar.io/v1/beacons" \
-H "Authorization: prj_live_sk_..." \
-X POST \
-d "description=Store #123 - Register #1" \
-d "tag=store-register" \
-d "tag=123-1" \
-d "type=ibeacon" \
-d "uuid=b9407f30-f5f8-466e-aff9-25556b57fe6d" \
-d "major=100" \
-d "minor=1"
-d "coordinates=[-105.94653744704361,35.70654086799666]" \
-d "enabled=true"
{
"meta": {
"code": 200
},
"beacon": {
"_id": "6116d947049aee0089a682a2",
"createdAt": "2021-08-13T20:42:47.711Z",
"updatedAt": "2021-08-13T20:42:47.711Z",
"live": true,
"description": "Store #123 - Register #1",
"tag": "store-register",
"externalId": "123-1",
...
}
}
Upserts a beacon. The beacon can be uniquely referenced by Radar _id
or by tag
and externalId
. If a beacon with the specified tag
and externalId
already exists, it will be updated. If not, it will be created.
PUT https://api.radar.io/v1/beacons/:id
PUT https://api.radar.io/v1/beacons/:tag/:externalId
description
(string, required): A display name for the beacon.type
(string, required): The type of beacon, one ofibeacon
(supported on iOS and Android) oreddystone
(supported on Android only).uuid
(string, required foribeacon
): For iBeacons, the UUID of the beacon.major
(string, required foribeacon
): For iBeacons, the major ID of the beacon.minor
(string, required foribeacon
): For iBeacons, the minor ID of the beacon.uid
(string, required foreddystone
): For Eddystone beacons, the UID of the beacon.instance
(string, required foreddystone
): For Eddystone beacons, the instance ID of the beacon.coordinates
(point, required): The approximate location of the beacon, used to sync nearby beacons (within 1 kilometer) to the SDK. Coordinates in[longitude,latitude]
format.metadata
(dictionary, optional): An optional set of custom key-value pairs for the beacon. A JSON string representing a dictionary with up to 16 keys and values of type string, boolean, or number.enabled
(boolean, optional): Iftrue
, the beacon will generate events. Iffalse
, the beacon will not generate events. Defaults totrue
.
10 requests per second
Secret
curl "https://api.radar.io/v1/beacons/store-register/123-1" \
-H "Authorization: prj_live_sk_..." \
-X PUT \
-d "description=Store #123 - Register #1" \
-d "tag=store-register" \
-d "externalId=123-1" \
-d "type=ibeacon" \
-d "uuid=b9407f30-f5f8-466e-aff9-25556b57fe6d" \
-d "major=100" \
-d "minor=1" \
-d "coordinates=[-105.94653744704361,35.70654086799666]" \
-d "enabled=true"
{
"meta": {
"code": 200
},
"beacon": {
"_id": "6116d947049aee0089a682a2",
"createdAt": "2021-08-13T20:42:47.711Z",
"updatedAt": "2021-08-13T20:42:47.711Z",
"live": true,
"description": "Store #123 - Register #1",
"tag": "store-register",
"externalId": "123-1",
...
}
}
Deletes a beacon. The beacon can be uniquely referenced by Radar _id
or by tag
and externalId
.
DELETE https://api.radar.io/v1/beacons/:id
DELETE https://api.radar.io/v1/beacons/:tag/:externalId
10 requests per second
Secret
curl "https://api.radar.io/v1/beacons/56db1f4613012711002229f4" \
-H "Authorization: prj_live_sk_..." \
-X DELETE
{
"meta": {
"code": 200
}
}
Places settings represents your current project settings for Places.
chainMetadata
(dictionary): Current metadata associated with each Radar chain.chainMappings
(dictionary): Current mapping associated with each Radar chain.placeFilters
(dictionary): Current chains and category filtering for place entry and exit event generation.
Gets your current Places settings.
GET https://api.radar.io/v1/settings
10 requests per second
Secret
curl "https://api.radar.io/v1/settings" \
-H "Authorization: prj_live_sk_..." \
-X GET
{
"meta": {
"code": 200
},
"chainMetadata": {
"mcdonalds": {
"availableDeals": true,
},
"starbucks": {
"availableDeals": true,
}
},
"chainMappings": {
"mcdonalds": "retailer1",
"starbucks": "retailer2"
},
"placeFilters": {
"chain": [
"mcdonalds",
"starbucks"
],
"category": [
"restaurant"
]
}
}
Updates your Places settings.
PATCH https://api.radar.io/v1/settings
10 requests per second
Secret
curl "https://api.radar.io/v1/settings" \
-H "Authorization: prj_live_sk_..." \
-H "Content-Type: application/json" \
-X PATCH \
-d '{"chainMetadata":{"mcdonalds":{"availableDeals":false}},"chainMappings":{"mcdonalds":"retailer1"},"placeFilters":{"chain":["mcdonalds"]}}'
{
"meta": {
"code": 200
},
"chainMetadata": {
"mcdonalds": {
"availableDeals": false
}
},
"chainMappings": {
"mcdonalds": "retailer1"
},
"placeFilters": {
"chain": [
"mcdonalds"
]
}
}