Download OpenAPI specification:Download
Geopin HTTP API
Metadata Definitions are required for assigning a schema for the metadata
included in Features ingested into a specific Feature Collection.
{- "items": [
- {
- "name": "string",
- "properties": [
- {
- "key": "key",
- "description": "description",
- "type": "array",
- "item_type": "string"
}
], - "tags": [
- "string"
], - "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "sequential_id": 0
}
], - "total_count": 0,
- "current_count": 0,
- "links": {
- "next": "string",
- "first": "string"
}
}
Metadata Definitions support creating an arbitrary number of metadata properties to associate with Features, and support the following property types:
string
, number
, or boolean
epoch_millis
, epoch_seconds
, or iso8601
primitive
types listed aboveWhen a Metadata Definition is associated with a Feature Collection, a JSON schema is generated from the Metadata Definition properties and is applied to validate the metadata
object included in Feature ingest requests.
Additionally, all metadata
properties can be used as query criteria, with the following functionality:
string
equals
like
does_not_equal
number
equals
greater_than
greater_than_or_equal_to
less_than
less_than_or_equal_to
does_not_equal
boolean
equals
does_not_equal
equals
greater_than
greater_than_or_equal_to
less_than
less_than_or_equal_to
does_not_equal
contains
does_not_contain
name required | string [ 1 .. 255 ] characters |
required | Array of Root Type for MetadataDefinitionPropertyPrimative (object) or Root Type for MetadataDefinitionPropertyPrimative (object) or Root Type for MetadataDefinitionPropertyPrimative (object) (V1MetadataDefinitionProperty) non-empty |
tags | Array of strings |
{- "name": "string",
- "properties": [
- {
- "key": "key",
- "description": "description",
- "type": "array",
- "item_type": "string"
}
], - "tags": [
- "string"
]
}
{- "name": "string",
- "properties": [
- {
- "key": "key",
- "description": "description",
- "type": "array",
- "item_type": "string"
}
], - "tags": [
- "string"
], - "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "sequential_id": 0
}
uuid required | string Examples:
|
{- "name": "string",
- "properties": [
- {
- "key": "key",
- "description": "description",
- "type": "array",
- "item_type": "string"
}
], - "tags": [
- "string"
], - "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "sequential_id": 0
}
Feature Collections act as "databases" of Features. Every Feature ingested must belong to a Feature Collection.
{- "items": [
- {
- "active": true,
- "geography_type": "polygon",
- "name": "string",
- "metadata_definition_uuid": "string",
- "masked": true,
- "tags": [
- "string"
], - "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "sequential_id": 0
}
], - "total_count": 0,
- "current_count": 0,
- "links": {
- "next": "string",
- "first": "string"
}
}
Feature Collections can support one of the following two geography types: polygon
or point
.
Feature Collections can also (optionally) be associated with a Metadata Definition.
Feature Collections also support "masked mode", which when enabled prevents query results or fetch responses from including the geography of features. Masked mode effectively prevents you from ever seeing the location data of any Feature in the Feature Collection.
geography_type required | string Enum: "polygon" "point" |
name required | string [ 1 .. 255 ] characters |
metadata_definition_uuid | string |
masked | boolean Default: true |
tags | Array of strings |
{- "geography_type": "polygon",
- "name": "string",
- "metadata_definition_uuid": "string",
- "masked": true,
- "tags": [
- "string"
]
}
{- "active": true,
- "geography_type": "polygon",
- "name": "string",
- "metadata_definition_uuid": "string",
- "masked": true,
- "tags": [
- "string"
], - "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "sequential_id": 0
}
uuid required | string Examples:
|
{- "active": true,
- "geography_type": "polygon",
- "name": "string",
- "metadata_definition_uuid": "string",
- "masked": true,
- "tags": [
- "string"
], - "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "sequential_id": 0
}
uuid required | string Examples:
|
active required | boolean |
{- "active": true
}
{- "active": true,
- "geography_type": "polygon",
- "name": "string",
- "metadata_definition_uuid": "string",
- "masked": true,
- "tags": [
- "string"
], - "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "sequential_id": 0
}
Features are the core data ingested into Geopin, and may be Polygons or Points. Both geography types support metadata that can be defined by Metadata Definitions.
uuid required | string Examples:
|
external_identifier required | string |
include_geography | boolean Default: false |
{- "type": "polygon",
- "metadata": { },
- "external_identifier": "string",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z"
}
Delegate Tokens are short-lived authentication tokens that allow for ingesting Features into Geopin with constraints on metadata, Feature Collection, and (optionally) external identifiers. A common use case for Delegate Tokens is to bypass your application for Feature ingest, for example, a ride-sharing platform could issue a Delegate Token to it's driver apps to send driver location updates directly to Geopin.
feature_collection_uuid required | string (V1UUID) |
external_identifier | string [ 5 .. 255 ] characters |
expires_at | string <date-time> ISO-8601 the delegate token should expire, defaults to 30 days from now. Delegate tokens must expire at least 5 minutes from now and less than 90 days from now. |
object |
{- "feature_collection_uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "external_identifier": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "metadata": { }
}
{- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "feature_collection_uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "external_identifier": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "metadata": { },
- "token": "string"
}
The ingest endpoints support two modes of ingest: direct, using a Geopin account API Key, and delegate, using a Delegate Token.
uuid required | string Examples:
|
geography required | Array of numbers (V1Coordinates) >= 2 items Points in longitude, latitude order |
type required | string Value: "point" |
object | |
external_identifier required | string [ 5 .. 255 ] characters |
{- "geography": [
- 0,
- 0
], - "type": "point",
- "metadata": { },
- "external_identifier": "string"
}
deferred | boolean Default: false Ingests the Feature asynchronously |
geography required | Array of numbers (V1Coordinates) >= 2 items Points in longitude, latitude order |
metadata | object |
external_identifier | string [ 5 .. 255 ] characters |
{- "geography": [
- 0,
- 0
], - "metadata": { },
- "external_identifier": "string"
}
Geopin supports complex queries over Feature location and metadata. Additionally, it is possible to scroll through all results returned by a query.
include_geography | boolean Default: false Include the result Feature coordinates in the query results, only valid for geopoint features |
type required | string Value: "polygon_contains" |
target_feature_collection required | string (V1UUID) |
Array of V1QueryAnd (object) or V1QueryPropertyComparison (object) or V1QueryOr (object) (V1QueryElement) | |
required | object (V1FeatureReference) |
object |
{- "type": "polygon_contains",
- "target_feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "metadata_filters": [
- {
- "type": "and",
- "elements": [
- null
]
}
], - "source_feature": {
- "external_identifier": "string",
- "feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "type": "reference"
}, - "sort": {
- "field": "string",
- "order": "desc"
}
}
{- "links": {
- "next": "/api/v1/query/scroll?scroll_key=7cda8f57-223c-4cff-b798-9c76b5782f97"
}, - "items": [
- {
- "type": "polygon",
- "metadata": { },
- "external_identifier": "string",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z"
}
]
}
scroll_key required | string |
{- "links": {
- "next": "/api/v1/query/scroll?scroll_key=7cda8f57-223c-4cff-b798-9c76b5782f97"
}, - "items": [
- {
- "type": "polygon",
- "metadata": { },
- "external_identifier": "string",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z"
}
]
}
Geofences allow for near-realtime webhooks when a point is ingested that matches specific criteria. The supported criteria modes are Point-to-Point distance and Point-in-Polygon. The supported events are documented as follows:
enter
: A Point has entered a specific Polygon or is within the specified distance of another Point, when it was previously outsideexit
: A Point has exited a specific Polygon or is outside of the specified distance of another Point, when it was previously insideinside
: A Point is inside a specific Polygon or is within the specified distance of another Point, and there is no previous state for the Pointtype required | string Value: "point_in_polygon" |
required | object (V1FeatureReference) |
required | object (V1FeatureReference) |
event required | string Enum: "inside" "outside" "enter" "exit" |
{- "type": "point_in_polygon",
- "point": {
- "external_identifier": "string",
- "feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "type": "reference"
}, - "polygon": {
- "external_identifier": "string",
- "feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "type": "reference"
}, - "event": "inside"
}
{- "type": "point_in_polygon",
- "point": {
- "external_identifier": "string",
- "feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "type": "reference"
}, - "polygon": {
- "external_identifier": "string",
- "feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "type": "reference"
}, - "event": "inside",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z"
}
{- "type": "point_in_polygon",
- "point": {
- "external_identifier": "string",
- "feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "type": "reference"
}, - "polygon": {
- "external_identifier": "string",
- "feature_collection": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "type": "reference"
}, - "event": "inside",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z"
}
Webhooks will be sent on any of the following events: enter
, exit
, and inside
via an HTTP POST request with a application/json
request body.
For example, if a Feature with the external_identifier
vehicle_0001
entered a Geofence with the UUID 4d1695e5-85d2-4d81-8428-4dddc93b5d23
, the following request body would be sent:
{
"webhook_uuid": "2b946253-eccf-4015-a411-b9d806008147",
"geofence_uuid": "4d1695e5-85d2-4d81-8428-4dddc93b5d23",
"point_feature_collection": "0d9b7659-084c-4fc9-9be8-b66b01ada3a9",
"point_external_identifier": "vehicle_0001",
"event": "enter",
"ingested": "2021-07-12T05:40:50+00:00"
}
uuid required | string |
url required | string |
{- "url": "string"
}
{- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "url": "string"
}
{- "user": {
- "name": "string",
- "email": "string",
- "uuid": "string"
}, - "token": {
- "name": "string"
}
}
type required | string Value: "ip_address" |
ip_address required | string |
ip_address_type required | string Value: "ipv4" |
{- "type": "ip_address",
- "ip_address": "string",
- "ip_address_type": "ipv4"
}
{- "type": "raw_point",
- "geography": [
- 0,
- 0
]
}
Search all events for your account. Geofence matches, entity changes, and more are logged as events. This endpoint will return at max 100 items, use the before/after filters to scroll through the events.
before | string <date-time> |
after | string <date-time> |
primary_entity_uuid | string (V1UUID) Example: primary_entity_uuid=41699e18-4f02-48c1-b207-3b9003de1acf |
primary_entity_type | string |
event | string |
order | string Default: "desc" Enum: "desc" "asc" |
{- "total_count": 0,
- "current_count": 0,
- "filtered_count": 0,
- "items": [
- {
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "event": "string",
- "primary_entity": {
- "type": "string",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf"
}, - "request_uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "referenced_entities": [
- {
- "type": "string",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf"
}
], - "properties": { }
}
]
}
Fetch a specific event
uuid required | string (V1UUID) Example: 41699e18-4f02-48c1-b207-3b9003de1acf |
{- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "timestamp": "2019-08-24T14:15:22Z",
- "event": "string",
- "primary_entity": {
- "type": "string",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf"
}, - "request_uuid": "41699e18-4f02-48c1-b207-3b9003de1acf",
- "referenced_entities": [
- {
- "type": "string",
- "uuid": "41699e18-4f02-48c1-b207-3b9003de1acf"
}
], - "properties": { }
}