Luna events API (v.2.6.1)

Download OpenAPI specification:Download

VisionLabs Luna Events API.

Intoduction

This service is intended for searching events according to the specified filters and getting some statistics parameters of events. You can receive the following parameters:

1) event count, 2) average, max, min value numeric parameters.

Events can be grouped by the creation time. Grouping is possible in two ways: grouping by time intervals and the frequency grouping (by day of month).

The service store some fields in compressed state for query optimization and database size decrease.

Mapping ethnicities to ID:

Group name Group ID
african_american 1
indian 2
asian 3
caucasian 4

Mapping emotions to ID:

Group name Group ID
anger 1
disgust 2
fear 3
happiness 4
neutral 5
sadness 6
surprise 7

Mapping masks to ID:

Group name Group ID
missing 1
medical_mask 2
occluded 3

Mapping liveness to ID:

liveness value
spoof 0
real 1
unknown 2

OpenAPI specification is the only valid document providing up-to-date information about the service API.

The specification can be used:

  • By documentation generation tools to visualize the API.
  • By code generation tools.

All the documents and code generated using this specification can include inaccuracies and should be carefully checked.

OpenAPI specification can be received using the "/docs/spec" resource. The "Accept" header should be set to "application/x-yaml".

version

get version

get version of service

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "Version": {
    }
}

events

check event

check event existence by id.

path Parameters
event_id
required
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515

event id

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "error_code": 1,
  • "detail": "internal server error",
  • "desc": "internal server error"
}

get event

get event by id. If target is not set, reply will contain all event fields.

path Parameters
event_id
required
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515

event id

query Parameters
target
string
Enum: "account_id" "create_time" "end_time" "event_id" "handler_id" "external_id" "source" "top_match" "match_result" "face_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "liveness" "body_detections" "tags" "user_data" "location" "mask" "track_id"
Example: target=extract_result

Comma-separated list of event fields. If set, each event from result will contain only specified fields, otherwise, events with all fields will be returned.

account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "end_time": "2018-08-11T09:11:41.674Z",
  • "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "handler_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "external_id": "external id",
  • "source": "3rd Avenue",
  • "top_match": {
    },
  • "match_result": [
    ],
  • "face_detections": [
    ],
  • "body_detections": [
    ],
  • "face_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "attach_result": [
    ],
  • "gender": 0,
  • "age": 0,
  • "emotion": 1,
  • "mask": 1,
  • "ethnic_group": 1,
  • "liveness": 0,
  • "tags": [
    ],
  • "user_data": "",
  • "location": {
    },
  • "track_id": "useful_track_id_number_1"
}

patch event

update event by id.

path Parameters
event_id
required
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515

event id

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Content-Type
string
Enum: "application/json" "application/msgpack"

The response content type header.

Request Body schema:
object (face_attributes_json)

face attributes

object (body_attributes_json)

body attributes

Responses

Request samples

Content type
{
  • "face_attributes": {
    },
  • "body_attributes": {
    }
}

Response samples

Content type
application/json
Example
{
  • "error_code": 12022,
  • "desc": "Bad/incomplete input data",
  • "detail": "Failed to validate input json. Path: 'face_attributes', message: face_attributes must be object"
}

get events

Get events that satisfy filters.

Default filters for events:

  • create_time__lt - current datetime

  • create_time__gte - current datetime minus month

    Default filters are not used if any of the following parameters are defined:

    • list of event IDs (event_ids)
    • lower event ID boundary (event_id__gte)
    • upper event ID boundary (event_id__lt)
    • lower create time boundary (create_time__gte)
    • upper create time boundary (create_time__lt)

The target parameter determines field that will be shown for each event. If target is not set, the response will contain all the fields, except the descriptor data.

To count events, use "get statistics on events" request.

query Parameters
target
string
Enum: "account_id" "create_time" "end_time" "event_id" "handler_id" "external_id" "source" "top_match" "match_result" "face_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "liveness" "body_detections" "tags" "user_data" "location" "mask" "track_id"
Example: target=extract_result

Comma-separated list of event fields. If set, each event from result will contain only specified fields, otherwise, events with all fields will be returned.

account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

create_time__gte
string <date-time>
Example: create_time__gte=2018-08-11T09:11:41.674Z

The lower create time including boundary.

create_time__lt
string <date-time>
Example: create_time__lt=2018-08-11T09:11:41.674Z

upper bound for object create_time.

end_time__gte
string <date-time>
Example: end_time__gte=2018-08-11T09:11:41.674Z

The lower end time including boundary.

end_time__lt
string <date-time>
Example: end_time__lt=2018-08-11T09:11:41.674Z

upper bound for object end_time.

sources
string
Example: sources=cam1,cam2

Comma-separated list of sources. Each event from result will contain one of the given sources.

top_matching_candidates_label
string
Example: top_matching_candidates_label=matching_label

Top matching candidates label. Each event from result will contain the given label.

top_similar_object_ids
Array of strings <uuid> (uuid)
Example: top_similar_object_ids=557d54ec-29ad-4f3c-93b4-c9092ef12515

Comma-separated list of top similar object ids. Each event from result will contain one of the given top similar object ids.

top_similar_external_ids
Array of strings (external_id)
Example: top_similar_external_ids=external id

Comma-separated list of top similar external ids. Each event from result will contain one of the given top similar external ids.

top_similar_object_similarity__gte
number
Example: top_similar_object_similarity__gte=0.5

Top similar object similarity lower included bound.

top_similar_object_similarity__lt
number
Example: top_similar_object_similarity__lt=0.5

Top similar object similarity upper excluded bound.

age__lt
integer [ 0 .. 100 ]
Example: age__lt=50

age upper excluded bound.

age__gte
integer [ 0 .. 100 ]
Example: age__gte=50

age lower included bound.

gender
integer
Enum: 0 1
Example: gender=1

Gender. 1 - male, 0 - female.

emotions
string <list of integer (1, 2, 3, 4, 5, 6, 7)>
Example: emotions=1,2,3

comma-separated list of predominant emotions. Each event from result will contain one of the given emotions.

emotions value
anger 1
disgust 2
fear 3
happiness 4
neutral 5
sadness 6
surprise 7
masks
string <list of integer (1, 2, 3)>
Example: masks=1,2,3

comma-separated list of predominant masks. Each event from result will contain one of the given mask state.

mask value
missing 1
medical_mask 2
occluded 3
ethnic_groups
string <list of integer (1, 2, 3, 4)>
Example: ethnic_groups=1,2

comma-separated list of dominant ethnic group. Each event from result will contain one of the given ethnic groups.

ethnicity value
African american 1
Indian 2
Asian 3
Caucasian 4
liveness
string <list of integer (0, 1 ,2)>
Example: liveness=1,2

comma-separated list of dominant liveness. Each event from result will contain one of the given liveness.

liveness value
spoof 0
real 1
unknown 2
face_ids
string <list of uuid>
Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

list of comma-separated face ids.

event_ids
string <list of uuid.>
Example: event_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

a list of comma-separated event ids.

event_id__gte
string <uuid.>
Example: event_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb

lower including event id boundary.

event_id__lt
string <uuid.>
Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc38

upper excluding event id boundary.

handler_ids
string <list of uuid.>
Example: handler_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

a list of comma-separated handler ids.

external_ids
string <list of strings.>
Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

a list of comma-separated external ids.

user_data
string
Example: user_data=user_data

find all objects with user_data that is similar to this parameter.

tags
Array of strings (tag) >= 0 items
Example: tags=tag_1,tag_2

A comma-separated list of tags. Each event from result will contain all of the given tags.

cities
string
Example: cities=moscow,New-York

Comma-separated list of cities. Each event from result will contain one of the given cities in location.

areas
string
Example: areas=CAO,central park

Comma-separated list of areas. Each event from result will contain one of the given areas in location.

districts
string
Example: districts=mitino,central park

Comma-separated list of districts. Each event from result will contain one of the given districts in location.

streets
string
Example: streets=arbat,schepkina

Comma-separated list of streets. Each event from result will contain one of the given streets in location.

house_numbers
string
Example: house_numbers=1,1/2str3

Comma-separated list of house numbers. Each event from result will contain one of the given house numbers in location.

origin_longitude
number (longitude) [ -180 .. 180 ]
Example: origin_longitude=36.616

longitude origin in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set.

origin_latitude
number (latitude) [ -90 .. 90 ]
Example: origin_latitude=55.752

latitude origin in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set.

longitude_delta
number [ 0 .. 90 ]
Default: 0.01
Example: longitude_delta=0.01

longitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and longitude_delta is not set - default is applied. WARNING: boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. Box edges more than 180 degrees long are not allowed. Boundaries of valid range are exclusive. NOTE: highly recommended for citywide use only.

latitude_delta
number [ 0 .. 90 ]
Default: 0.01
Example: latitude_delta=0.01

latitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and latitude_delta is not set - default is applied. WARNING: boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. Box edges more than 180 degrees long are not allowed. Boundaries of valid range are exclusive. NOTE: highly recommended for citywide use only.

track_ids
string <list of track ids>
Example: track_ids=track_id1,track_id_2

a list of comma-separated track ids.

order
string
Enum: "asc" "desc"

the sort order.

By default, the results will be sorted by event creation time. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first.

But if some event ID range filtres specified (event_id__gte or event_id__lt), the results will be sorted by event ID.

page
integer >= 1
Default: 1

a page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

the number of items on page.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "events": [
    ]
}

create new events

creates new events.

query Parameters
wait_events_saving
integer (int01)
Default: 0
Enum: 0 1

whether to wait for events saving.

If "0" is specified, the 202 status code will be expected in response to a successful request. This status code is returned after events are validated and added to the buffer. The system does not wait until the events are saved to the database. The events will be stored in the database after the response is sent.

If "1" is specified, the 204 status code will be expected in response to a successful request. This status code is returned only after events are stored in the database.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Content-Type
string
Enum: "application/json" "application/msgpack"

The response content type header.

Request Body schema:
Array ()
account_id
required
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...

account id.

create_time
required
string <date-time>

event creation time.

end_time
string <date-time>

event end time, if it was not set, the system will set it by the time of creation.

event_id
required
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...

event id.

handler_id
required
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...

id of the handler, which gave birth to the event.

external_id
string <= 36 characters Nullable ^[^\x00]*$
Default: ""

user-defined external id for face

user_data
string <= 128 characters Nullable ^[^\x00]*$

user data.

source
string Nullable ^[^\x00]*$

additional information that user provides with event.

track_id
string Nullable ^[a-zA-Z0-9_\-]{1,36}$

event track id

tags
Array of strings Nullable

tag array.

object Nullable

face object

Array of match_candidates_new_event_faces (object) or match_candidates_new_event_events (object) (match_candidates_new_event) Nullable

matches list

Array of objects

detection list

object (location)

information about a place where event is incidented

object

aggregated estimations

object (face_attributes_json)

face attributes

object (body_attributes_json)

body attributes

Responses

Request samples

Content type
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "error_code": 12022,
  • "desc": "Bad/incomplete input data",
  • "detail": "[0].create_time, message: 'incorrect time format'"
}

delete events

delete oldest 10000 events that satisfy filters.

query Parameters
target
Array of strings
Default: ["face_samples","body_samples","image_origins"]
Items Enum: "face_samples" "body_samples" "image_origins"
Example: target=image_origins

Comma-separated list of event deletion info attributes. If set, each item from the result will contain only specified attributes in addition to the event ID, otherwise, all the deletion info attributes will be returned. If empty value set, each item from the result will contain only event ID.

account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

handler_id
string <uuid.>
Example: handler_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

handler id.

create_time__gte
string <date-time>
Example: create_time__gte=2018-08-11T09:11:41.674Z

The lower create time including boundary.

create_time__lt
string <date-time>
Example: create_time__lt=2018-08-11T09:11:41.674Z

upper bound for object create_time.

insert_time__gte
string <date-time>
Example: insert_time__gte=2018-08-11T09:11:41.674Z

The lower insert time including boundary.

insert_time__lt
string <date-time>
Example: insert_time__lt=2018-08-11T09:11:41.674Z

The upper insert time excluding boundary.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

administration

get events with missing attributes

Get events with samples and with missing attributes that satisfy filters.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

kind
required
string
Enum: "basic_attributes" "face_descriptor" "body_descriptor"
Example: kind=basic_attributes

kind of missing attributes to look for.

Only 1 value at time is supported because the response doesn't contain information required to distinguish kinds of the events.

insert_time__gte
string <date-time>
Example: insert_time__gte=2018-08-11T09:11:41.674Z

The lower insert time including boundary.

insert_time__lt
string <date-time>
Example: insert_time__lt=2018-08-11T09:11:41.674Z

The upper insert time excluding boundary.

event_id__gte
string <uuid.>
Example: event_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb

lower including event id boundary.

event_id__lt
string <uuid.>
Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc38

upper excluding event id boundary.

handler_id
string <uuid.>
Example: handler_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

handler id.

missing_version
integer
Example: missing_version=56

event descriptor version. By default used the platform default descriptor version.

page
integer >= 1
Default: 1

a page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

the number of items on page.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "events": [
    ]
}

get count of events with missing attributes

Get count of events with samples and with missing attributes that satisfy filters.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

kind
required
string
Enum: "basic_attributes" "face_descriptor" "body_descriptor"
Example: kind=basic_attributes

kind of missing attributes to look for.

Only 1 value at time is supported because the response doesn't contain information required to distinguish kinds of the events.

insert_time__gte
string <date-time>
Example: insert_time__gte=2018-08-11T09:11:41.674Z

The lower insert time including boundary.

insert_time__lt
string <date-time>
Example: insert_time__lt=2018-08-11T09:11:41.674Z

The upper insert time excluding boundary.

event_id__gte
string <uuid.>
Example: event_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb

lower including event id boundary.

event_id__lt
string <uuid.>
Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc38

upper excluding event id boundary.

handler_id
string <uuid.>
Example: handler_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

handler id.

missing_version
integer
Example: missing_version=56

event descriptor version. By default used the platform default descriptor version.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "events_count": 55
}

delete events descriptors

Delete 10000 event descriptors that satisfy filters.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

event_id__gte
string <uuid.>
Example: event_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb

lower including event id boundary.

event_id__lt
string <uuid.>
Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc38

upper excluding event id boundary.

version
required
integer [ 0 .. 1000 ]
Example: version=56

event descriptor version.

descriptor_type
required
string
Enum: "face" "body"
Example: descriptor_type=face

The type of the event's descriptor.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "event_ids": [
    ]
}

event descriptor

get event descriptor

Get event descriptor that corresponds to the specified parameters.

path Parameters
event_id
required
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515

event id

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

descriptor_version
integer [ 0 .. 110 ]
Example: descriptor_version=56

event descriptor version. By default used the platform default descriptor version.

descriptor_type
string
Enum: "face" "body"
Example: descriptor_type=face

The type of the event's descriptor.

header Parameters
Accept
string
Example: application/x-sdk-descriptor

content type which is acceptable for the response. If 'application/x-sdk-descriptor' is specified, the binary descriptor will be returned in the response body, otherwise 'application/json' content type will be applied.

Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
{
  • "descriptor": "string",
  • "descriptor_version": 52
}

events stats

get statistics on events

Get event statistics by target(s) with applied filters.

Event fields and/or functions (count, min, etc.) can be set as targets for aggregation of events.

Grouping by frequency or grouping by time intervals is available.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Content-Type
string
Value: "application/json"

content type is application/json.

Request Body schema: application/json
Array of objects (targets) non-empty
Default: [{"column":"event_id","aggregator":"count"}]

Fields and functions to aggregate.

Allowed usage of aggregators is:

Column Aggregator
count max min avg group_by
event_id + - - - +
external_id + - - - +
handler_id + - - - +
source + - - - +
top_similar_object_id + - - - +
top_similar_external_id + - - - +
top_matching_candidates_label + - - - +
create_time + + + - -
end_time + + + - -
top_similar_object_similarity + + + + -
face_id + - - - +
gender + + + + +
age + + + + +
emotion + + + + +
mask + + + + +
ethnic_group + + + + +
liveness + + + + +
user_data + - - - +
tags + + + - -
city + - - - +
area + - - - +
district + - - - +
street + - - - +
house_number + - - - +
geo_position + - - - -
track_id + - - - +
Array of objects (filters) >= 0 items

Set of filters for sample restriction.

Allowed usage of filters is:

Filter Operator
like, nlike in, nin eq, neq gt, gte, lt, lte covered
tags + - - - -
source - + + - -
user_data - + + - -
account_id - + + + -
event_id - + + + -
external_id - + + + -
handler_id - + + + -
top_similar_object_id - + + + -
top_similar_external_id - + + + -
top_matching_candidates_label - + + - -
top_similar_object_similarity - - - + -
face_id - + + + -
gender - + + + -
age - + + + -
emotion - + + + -
mask - + + + -
ethnic_group - + + + -
liveness - + + + -
city - + + - -
area - + + - -
district - + + - -
street - + + - -
house_number - + + - -
geo_position - - - - +
track_id - + + - -

Warning: must be at least one aggregator different with 'group_by' in request

Array of objects (periods) >= 0 items

it is possible to set start and end of period.

group_by
string (group_by)

event for grouping by creation time.

Grouping is possible in two ways

1) Grouping by time intervals - number and dimension

The parameter value Description
1m one minute
2h two hours
7d seven days
5w five weeks
3M three months
10y ten years

2) The frequency grouping - one of the following

The parameter value Description
monthOfYear by month of year
weekOfYear by week of year
dayOfYear by day of year
dayOfMonth by day of month
dayOfWeek by day of week
hourOfDay by hours of day
minuteOfHour by minutes of hour

Responses

Request samples

Content type
application/json
{
  • "targets": [
    ],
  • "filters": [
    ],
  • "period": [
    ],
  • "group_by": "dayOfWeek"
}

Response samples

Content type
application/json
{
  • "fields": [
    ],
  • "stats": [
    ]
}

events match

match events

Match events that satisfy filters.

Default filters for match events:

  • create_time__lt - current datetime

  • create_time__gte - current datetime minus month

    Default filters are not used if any of the following parameters are defined:

    • list of event IDs (event_ids)
    • lower event ID boundary (event_id__gte)
    • upper event ID boundary (event_id__lt)
    • lower create time boundary (create_time__gte)
    • upper create time boundary (create_time__lt)

If target is not set, the response will contain events with "event_id" and "similarity" fields only.

To count events, use "get statistics on events" request.

query Parameters
target
string
Enum: "account_id" "create_time" "end_time" "event_id" "handler_id" "external_id" "source" "top_match" "match_result" "extract_result" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "liveness" "tags" "user_data" "location" "similarity" "mask" "track_id"
Example: target=extract_result,similarity

Comma-separated list of event fields. If set, each event from result will contain only specified fields, otherwise, events with the "event_id" and "similarity" fields will be returned.

account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

account id

create_time__gte
string <date-time>
Example: create_time__gte=2018-08-11T09:11:41.674Z

The lower create time including boundary.

create_time__lt
string <date-time>
Example: create_time__lt=2018-08-11T09:11:41.674Z

upper bound for object create_time.

end_time__gte
string <date-time>
Example: end_time__gte=2018-08-11T09:11:41.674Z

The lower end time including boundary.

end_time__lt
string <date-time>
Example: end_time__lt=2018-08-11T09:11:41.674Z

upper bound for object end_time.

sources
string
Example: sources=cam1,cam2

Comma-separated list of sources. Each event from result will contain one of the given sources.

top_matching_candidates_label
string
Example: top_matching_candidates_label=matching_label

Top matching candidates label. Each event from result will contain the given label.

top_similar_object_ids
Array of strings <uuid> (uuid)
Example: top_similar_object_ids=557d54ec-29ad-4f3c-93b4-c9092ef12515

Comma-separated list of top similar object ids. Each event from result will contain one of the given top similar object ids.

top_similar_external_ids
Array of strings (external_id)
Example: top_similar_external_ids=external id

Comma-separated list of top similar external ids. Each event from result will contain one of the given top similar external ids.

top_similar_object_similarity__gte
number
Example: top_similar_object_similarity__gte=0.5

Top similar object similarity lower included bound.

top_similar_object_similarity__lt
number
Example: top_similar_object_similarity__lt=0.5

Top similar object similarity upper excluded bound.

age__lt
integer [ 0 .. 100 ]
Example: age__lt=50

age upper excluded bound.

age__gte
integer [ 0 .. 100 ]
Example: age__gte=50

age lower included bound.

gender
integer
Enum: 0 1
Example: gender=1

Gender. 1 - male, 0 - female.

emotions
string <list of integer (1, 2, 3, 4, 5, 6, 7)>
Example: emotions=1,2,3

comma-separated list of predominant emotions. Each event from result will contain one of the given emotions.

emotions value
anger 1
disgust 2
fear 3
happiness 4
neutral 5
sadness 6
surprise 7
masks
string <list of integer (1, 2, 3)>
Example: masks=1,2,3

comma-separated list of predominant masks. Each event from result will contain one of the given mask state.

mask value
missing 1
medical_mask 2
occluded 3
ethnic_groups
string <list of integer (1, 2, 3, 4)>
Example: ethnic_groups=1,2

comma-separated list of dominant ethnic group. Each event from result will contain one of the given ethnic groups.

ethnicity value
African american 1
Indian 2
Asian 3
Caucasian 4
liveness
string <list of integer (0, 1 ,2)>
Example: liveness=1,2

comma-separated list of dominant liveness. Each event from result will contain one of the given liveness.

liveness value
spoof 0
real 1
unknown 2
face_ids
string <list of uuid>
Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

list of comma-separated face ids.

event_ids
string <list of uuid.>
Example: event_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

a list of comma-separated event ids.

event_id__gte
string <uuid.>
Example: event_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb

lower including event id boundary.

event_id__lt
string <uuid.>
Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc38

upper excluding event id boundary.

handler_ids
string <list of uuid.>
Example: handler_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

a list of comma-separated handler ids.

external_ids
string <list of strings.>
Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38

a list of comma-separated external ids.

user_data
string
Example: user_data=user_data

find all objects with user_data that is similar to this parameter.

tags
Array of strings (tag) >= 0 items
Example: tags=tag_1,tag_2

A comma-separated list of tags. Each event from result will contain all of the given tags.

cities
string
Example: cities=moscow,New-York

Comma-separated list of cities. Each event from result will contain one of the given cities in location.

areas
string
Example: areas=CAO,central park

Comma-separated list of areas. Each event from result will contain one of the given areas in location.

districts
string
Example: districts=mitino,central park

Comma-separated list of districts. Each event from result will contain one of the given districts in location.

streets
string
Example: streets=arbat,schepkina

Comma-separated list of streets. Each event from result will contain one of the given streets in location.

house_numbers
string
Example: house_numbers=1,1/2str3

Comma-separated list of house numbers. Each event from result will contain one of the given house numbers in location.

origin_longitude
number (longitude) [ -180 .. 180 ]
Example: origin_longitude=36.616

longitude origin in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set.

origin_latitude
number (latitude) [ -90 .. 90 ]
Example: origin_latitude=55.752

latitude origin in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set.

longitude_delta
number [ 0 .. 90 ]
Default: 0.01
Example: longitude_delta=0.01

longitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and longitude_delta is not set - default is applied. WARNING: boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. Box edges more than 180 degrees long are not allowed. Boundaries of valid range are exclusive. NOTE: highly recommended for citywide use only.

latitude_delta
number [ 0 .. 90 ]
Default: 0.01
Example: latitude_delta=0.01

latitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and latitude_delta is not set - default is applied. WARNING: boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. Box edges more than 180 degrees long are not allowed. Boundaries of valid range are exclusive. NOTE: highly recommended for citywide use only.

track_ids
string <list of track ids>
Example: track_ids=track_id1,track_id_2

a list of comma-separated track ids.

order
string
Enum: "asc" "desc"

the sort order. If "desc" is set, the most similar events will be shown first. If "asc" is set, the least similar events will be shown first.

threshold
number [ 0 .. 1 ]
Default: 0

the event similarity threshold in a match response - events with a similarity lower than this parameter will not be returned

limit
integer [ 1 .. 1000000 ]
Default: 5

the event limit in a match response

descriptor_type
string
Enum: "face" "body"
Example: descriptor_type=face

The type of the event's descriptor.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Request Body schema:
descriptor
required
string <base64>

raw descriptor bytes encoded in base64

descriptor_version
required
integer

descriptor version

Responses

Request samples

Content type
{
  • "descriptor": "string",
  • "descriptor_version": 52
}

Response samples

Content type
application/json
{
  • "events": [
    ]
}

documents

get openapi documentation

Get service OpenApi documentation. If Accept request header is of type application/x-yaml, returns documentation in yaml format or returns html documentation, if Accept-Type is text/html

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Accept
required
string (accept_docs_handler)
Enum: "application/x-yaml" "text/html"

acceptable type of receiving data

Responses

Response samples

Content type
application/json
{
  • "error_code": 12024,
  • "detail": "Bad/incomplete input data",
  • "desc": "Unsupported media type"
}

get development manual

Get sphinx documentation - Development Manual. After the request you will be redirected to the page /docs/dev/index.html

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "error_code": 1,
  • "detail": "internal server error",
  • "desc": "internal server error"
}

config

get service configuration

Get service configuration. Passwords and tokens will be hidden in the response.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Accept
string
Enum: "application/json" "text/plain"

acceptable type of receiving data

Responses

Response samples

Content type
{
  • "INFLUX_MONITORING": {
    }
}

health

get health

get health of service

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "execution_time": 0.123
}