LUNA PLATFORM 5 API (v.6.40.0)

Download OpenAPI specification:Download

VisionLabs Luna Platform 5 API. The API version is 6.

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 versions of services.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{
  • "LUNA PLATFORM": {
    },
  • "luna-api": {
    },
  • "luna-events": {
    },
  • "luna-faces": {
    },
  • "luna-image-store-bodies-samples": {
    },
  • "luna-image-store-faces-samples": {
    },
  • "luna-image-store-images": {
    },
  • "luna-handlers": {
    },
  • "luna-tasks": {
    },
  • "luna-matcher-proxy": {
    },
  • "luna-remote-sdk": {
    },
  • "luna-lambda": {
    }
}

version options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

accounts

get accounts

Get accounts.

Authorizations:
BasicAuthLunaAccountIdAuthBearerAuth
query Parameters
page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

login
string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$
Example: login=user@visionlabs.ru

Account login.

account_type
string (account_type)
Enum: "advanced_user" "user" "admin"
Example: account_type=user

Account type.

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

Upper bound for object create_time.

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

Lower included bound for object create_time.

targets
string
Default: ["account_id","login","account_type","description","create_time","last_update_time"]
Enum: "account_id" "login" "account_type" "description" "create_time" "last_update_time"
Example: targets=login

Comma-separated list of account target fields.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

url = f"{baseUri}/accounts"
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "accounts": [
    ],
  • "total_count": 50
}

create account

Create an account.

Authorizations:
BasicAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID for new account creation.

Request Body schema: application/json
login
required
string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$

Account email.

password
required
string (password) [ 3 .. 128 ] characters ^.{3,128}$

Account password.

account_type
required
string (account_type_for_creation)
Enum: "advanced_user" "user"

Specified user account type:

  • user - allows to interact with its own data

  • advanced_user - allows to interact with its own data and view other accounts data

description
string (account_description) <= 128 characters
Default: ""

Account description.

Responses

Request samples

Content type
application/json
{
  • "login": "mylogin@gmail.com",
  • "password": "string",
  • "account_type": "advanced_user",
  • "description": "main admin account"
}

Response samples

Content type
application/json
{}

accounts options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

account

get account

Get account.

Authorizations:
BasicAuthLunaAccountIdAuthBearerAuth
query Parameters
targets
string
Default: ["account_id","login","account_type","description","create_time","last_update_time"]
Enum: "account_id" "login" "account_type" "description" "create_time" "last_update_time"
Example: targets=login

Comma-separated list of account target fields.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

url = f"{baseUri}/account"
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
  • "login": "mylogin@gmail.com",
  • "account_type": "advanced_user",
  • "description": "main admin account",
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "last_update_time": "2018-08-11T09:11:41.674Z"
}

patch account

Patch account. At least one field must be specified.

Authorizations:
BasicAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
non-empty
login
string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$

Account email.

password
string (password) [ 3 .. 128 ] characters ^.{3,128}$

Account password.

account_type
string (account_type_for_creation)
Enum: "advanced_user" "user"

Specified user account type:

  • user - allows to interact with its own data

  • advanced_user - allows to interact with its own data and view other accounts data

description
string (account_description) <= 128 characters
Default: ""

Account description.

Responses

Request samples

Content type
application/json
{
  • "login": "mylogin@gmail.com",
  • "password": "string",
  • "account_type": "advanced_user",
  • "description": "main admin account"
}

Response samples

Content type
application/json
Example
{
  • "error_code": 12022,
  • "desc": "Bad/incomplete input data",
  • "detail": "Failed to validate input json. Path: 'extra_field', message: 'extra fields not permitted'"
}

accounts options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

tokens

create token

Create a token.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
grant_all_permissions
integer
Default: 0
Enum: 0 1

Grant all permissions to token. 1 - give, 0 - do not give. If value is 1 then permissions field is not required.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Any of
required
object

Token permissions.

* It is possible to use custom fields for permissions besides those given here.

Custom fields must have 3-16 characters (lowercase letters, _) with possible permissions: "creation", "view", "modification", "deletion"

"creation" — Allows POST requests.

"view" — Allows GET requests.

"modification" — Allows PUT and PATCH requests.

"deletion" — Allows DELETE requests.

description
string (token_description) <= 128 characters
Default: ""

Token description.

expiration_time
required
string or null <date-time>

Token expiration time in RFC 3339 format. null means token will never expired.

visibility_area
string (visibility_area)
Default: "all"
Enum: "account" "all"

Specifies data visible for the token.

For accounts with type user the default value is account.

account — Only data related to this account can be received using GET requests.

all — Data of all existing accounts can be received using GET requests. This value can be set for advanced_user account. This option does not work for user account.

Responses

Request samples

Content type
application/json
{
  • "description": "main account token",
  • "expiration_time": "2050-11-11T11:11:11.111+03:00",
  • "permissions": {
    },
  • "visibility_area": "all"
}

Response samples

Content type
application/json
{
  • "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k",
  • "token_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
  • "url": "/6/tokens/557d54ec-29ad-4f3c-93b4-c9092ef12515",
}

get tokens

Get tokens.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Upper bound for object create_time.

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

Lower included bound for object create_time.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create token
url = f"{baseUri}/tokens"
headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
payload = {"permissions": {"face": ["view"]}, "description": "description"}
requests.post(url, json=payload, headers=headers)

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}
url = f"{baseUri}/tokens"
response = requests.get(url, headers=headers, params={"page": 1, "page_size": 10})

print(response.status_code)
print(response.json())

Response samples

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

tokens options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

replace token

Update token. You cannot update a part of the token, so you should specify all the fields for your token.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
token_id
required
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 8950722f-3fd4-4223-b48f-03f95f0e8dfb

Token ID.

query Parameters
grant_all_permissions
integer
Default: 0
Enum: 0 1

Grant all permissions to token. 1 - give, 0 - do not give. If value is 1 then permissions field is not required.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Any of
required
object

Token permissions.

* It is possible to use custom fields for permissions besides those given here.

Custom fields must have 3-16 characters (lowercase letters, _) with possible permissions: "creation", "view", "modification", "deletion"

"creation" — Allows POST requests.

"view" — Allows GET requests.

"modification" — Allows PUT and PATCH requests.

"deletion" — Allows DELETE requests.

description
string (token_description) <= 128 characters
Default: ""

Token description.

expiration_time
required
string or null <date-time>

Token expiration time in RFC 3339 format. null means token will never expired.

visibility_area
string (visibility_area)
Default: "all"
Enum: "account" "all"

Specifies data visible for the token.

For accounts with type user the default value is account.

account — Only data related to this account can be received using GET requests.

all — Data of all existing accounts can be received using GET requests. This value can be set for advanced_user account. This option does not work for user account.

Responses

Request samples

Content type
application/json
Example
{
  • "permissions": {
    },
  • "description": "main account token",
  • "expiration_time": "2050-11-11T11:11:11.111+03:00",
  • "visibility_area": "account"
}

Response samples

Content type
application/json
{
  • "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k",
  • "token_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
  • "url": "/6/tokens/557d54ec-29ad-4f3c-93b4-c9092ef12515",
}

get token

Get token by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
token_id
required
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 8950722f-3fd4-4223-b48f-03f95f0e8dfb

Token ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library
import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}
url = f"{baseUri}/tokens"
payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None}
tokenId = requests.post(url, json=payload, headers=headers).json()["token_id"]

url = f"{baseUri}/tokens/{tokenId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "permissions": {
    },
  • "description": "main account token",
  • "expiration_time": "2050-11-11T11:11:11.111+03:00",
  • "visibility_area": "account",
  • "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k",
  • "token_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
  • "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "last_update_time": "2018-08-11T09:11:41.674Z"
}

delete token

Delete token by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
token_id
required
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: 8950722f-3fd4-4223-b48f-03f95f0e8dfb

Token ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library
import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}
url = f"{baseUri}/tokens"
payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None}
tokenId = requests.post(url, json=payload, headers=headers).json()["token_id"]

url = f"{baseUri}/tokens/{tokenId}"
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
{}

token options

Get options for the resource.

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

Token ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

credentials verifier

verify credentials

Verify account or login with password or token.

  • In the case of success account id verification, account_type will be returned
  • In the case of success login/password verification, account_id and account_type will be returned
  • In the case of success token verification, account_type and token permissions will be returned
  • In the case of failure verification, error will be returned
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
One of
login
required
string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$

Account email.

password
required
string (password) [ 3 .. 128 ] characters ^.{3,128}$

Account password.

Responses

Request samples

Content type
application/json
Example
{
  • "login": "mylogin@gmail.com",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "account_type": "advanced_user",
  • "permissions": {
    },
  • "account_id": "string"
}

credentials verifier options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

sdk

sdk resource

Detect faces and/or human bodies and estimate attributes on the input images. After the request is performed, the received data is not saved to the database or Image Store, it is only returned in the response.

The order of input images corresponds to the order of the elements in the output JSON.

If an input image is corrupted, an error is returned for the image. The processing of the other images continues in normal mode.

Notes for incoming data:

  • face or body bounding boxes passed with face or body warped image will be ignored.
Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
image_type
integer
Default: 0
Enum: 0 1 2

Type of input image. 0 - raw image, 1 - face warped image, 2 - body warped image.

estimate_people_count
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate people count on the image.

âš  People counter licensing feature is required to be enabled to perform estimation.

people_count_coordinates
integer
Default: 1
Enum: 0 1

Whether to return people coordinates with people count estimation.

multiface_policy
integer (multiface_policy)
Default: 1
Enum: 0 1 2

Multiple face detection policy:

  • 0 - do not process images with several detected faces.

    If detect_body is enabled, the system will attempt to detect a human body related to the detected face. If a human body is detected, its detection will be associated with the same event as the face.

    If there is no face detected in the image, no human body detections will be returned. Thus there will be no human body detection returned if detect_face is disabled.

  • 1 - process images with several detected faces and/or human bodies.

    If detect_body is enabled, all the detections of human bodies will be returned. Face detection and human body detection of the same person will be associated with the same event.

    The detections of human bodies are returned even if there were no faces found.

  • 2 - get the best face detection from the image. A single face of the best quality is detected in the image.

    If detect_body is enabled, the system will attempt to detect a human body related to the detected face. If a human body is detected, its detection will be associated with the same event as the face.

    If there is no face detected in the image, no human body detections will be returned. Thus there will be no human body detection returned if detect_face is disabled.

detect_face
integer (detect_face)
Default: 0
Enum: 0 1

Whether to detect faces on the image.

detect_body
integer (detect_body)
Default: 0
Enum: 0 1

Whether to detect human bodies on the image.

estimate_head_pose
integer (estimate_head_pose)
Default: 0
Enum: 0 1

Whether to estimate head pose in the image. The head pose is represented by pitch, yaw and roll angles.

Not supported with warped images (see warped_image or image_type parameter).

estimate_emotions
integer (estimate_emotions)
Default: 0
Enum: 0 1

Whether to estimate emotions in the image. The probability of the following emotions is estimated: "anger", "disgust", "fear", "happiness", "sadness", "surprise", "neutral".

estimate_mask
integer (estimate_mask)
Default: 0
Enum: 0 1

Whether to estimate mask in the image. The probability of the following masks states is estimated: "medical_mask", "missing", "occluded".

The estimated probability with the highest score is returned in the "predominant mask" parameter.

estimate_glasses
integer (estimate_glasses)
Default: 0
Enum: 0 1

Whether to estimate glasses in the image. One of the following parameters is returned: "eyeglasses", "sunglasses", "no_glasses".

estimate_liveness
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate liveness in the image. The "quality" and "score" probabilities are estimated. Based on these probabilities, the following result is returned: "real", "spoof", "unknown".

Liveness is utilized for this estimation. See "Administrator’s manual" for details about Liveness requirements.

âš  Webcam or selfie photos are required. Otherwise the result may be incorrect.

âš  Liveness licensing feature is required to be enabled to perform liveness estimation.

Liveness estimation is not supported for samples (warped images). The image_type parameter should be set to "0".

estimate_deepfake
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate deepfake feature on the image.

âš  Deepfake licensing feature is required to be enabled to perform deepfake estimation.

Not supported with warped images (see warped_image parameter).

estimate_landmarks68
integer (detect_landmarks68)
Default: 0
Enum: 0 1

Whether to detect basic 68-point facial landmarks in the image.

Not supported with warped images (see warped_image or image_type parameter).

estimate_landmarks5
integer (detect_landmarks5)
Default: 0
Enum: 0 1

Whether to detect basic 5-point facial landmarks in the image.

Not supported with warped images (see warped_image or image_type parameter).

estimate_quality
integer (estimate_quality)
Default: 0
Enum: 0 1

Whether to estimate input face image quality. Each of the following probabilities is estimated: "darkness", "light", "blurriness", "illumination", "specularity".

The quality factor is estimated for each probability. It's value is in the range [0..1] where 0 corresponds to low quality and 1 to high quality.

Note. Face recognition is not greatly affected by uneven illumination or high specularity.

estimate_gaze
integer (estimate_gaze)
Default: 0
Enum: 0 1

Whether to estimate gaze in the image. The gaze is represented by yaw angle and pitch angle for both eyes at once.

Not supported with warped images (see warped_image or image_type parameter).

estimate_eyes_attributes
integer (estimate_eyes_attributes)
Default: 0
Enum: 0 1

Whether to estimate eye attributes in the image. The "right_eye" and "left_eye" parameters are estimated, which contain the "state" (opened, closed or occluded) and "iris_landmarks" parameters.

estimate_mouth_attributes
integer (estimate_mouth_attributes)
Default: 0
Enum: 0 1

Whether to estimate mouth attributes in the image. Each of the following probabilities is estimated: "opened", "occluded", "smile", "score".

estimate_face_descriptor
integer (extract_descriptor)
Default: 1
Enum: 0 1
Example: estimate_face_descriptor=1

Whether to estimate face descriptor(s).

estimate_basic_attributes
integer (extract_basic_attributes)
Default: 0
Enum: 0 1

Whether to estimate face basic attributes (gender, age, ethnicity).

estimate_body_descriptor
integer (extract_descriptor)
Default: 1
Enum: 0 1
Example: estimate_body_descriptor=1

Whether to create human body descriptor(s).

estimate_upper_body
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate human upper body on the image (headwear, clothing color, sleeve length).

estimate_lower_body
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate human lower body on the image (lower garment, shoes).

estimate_accessories
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate human body accessories on the image (backpack presence).

estimate_face_occlusion
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate face occlusion on the image.

estimate_body_basic_attributes
integer (int01)
Default: 0
Enum: 0 1

Whether to estimate human body basic attributes on the image (age, gender).

estimate_body_warp
integer (estimate_body_warp)
Default: 0
Enum: 0 1

Whether to create a human body warped image in the Base64 format.

estimate_face_warp
integer (estimate_face_warp)
Default: 0
Enum: 0 1

Whether to create the face warped image in the Base64 format.

aggregate_attributes
integer (aggregate_attributes)

Whether to aggregate the following parameters:

  • face descriptor
  • body descriptor
  • face basic attributes (age, gender)
  • body basic attributes (apparent age, apparent gender)
  • mask states
  • emotions
  • liveness
  • deepfake
  • upper body attributes
  • lower body attributes
  • accessories

Aggregation will be performed only if the appropriate parameters for estimating the listed above parameters are enabled.

If set, all estimated parameters from each image will be aggregated and displayed in the aggregate_estimations field of the response body as single objects for all images.

Otherwise, all estimated parameters from each image will be displayed in the estimations field of the response body as separate objects for corresponding images.

pitch_threshold
integer (pitch_threshold) [ 0 .. 180 ]
Example: pitch_threshold=180

Maximum deviation pitch angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

Remove this parameter from the query, or set the parameter value to 180 if pitch angle filtration is not required.

When the value is set to "0", all the images are filtered.

roll_threshold
integer (roll_threshold) [ 0 .. 180 ]
Example: roll_threshold=180

Maximum deviation roll angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

Remove this parameter from the query, or set the parameter value to 180 if roll angle filtration is not required.

When the value is set to "0", all the images are filtered.

yaw_threshold
integer (yaw_threshold) [ 0 .. 180 ]
Example: yaw_threshold=180

Maximum deviation yaw angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

Remove this parameter from the query, or set the parameter value to 180 if yaw angle filtration is not required.

When the value is set to "0", all the images are filtered.

score_threshold
number (score_threshold) [ 0 .. 1 ]
Default: 0
Example: score_threshold=0.7

Descriptor quality score threshold. The higher the quality score for the image, the better the extraction results.

All the attributes with a quality score below the threshold will be ignored (and not stored in the DB). The function will proceed as usual with all the remaining descriptors (if left).

Consult VisionLabs about the recommended value of this parameter.

Note! This parameter is not related to the image quality estimated in the detect request (estimate_quality request parameter).

face_occlusion_states
Array of strings (face_occlusion_states) non-empty
Items Enum: "face" "forehead" "eye" "nose" "mouth" "lower_face"
Example: face_occlusion_states=face

List of face area which must not be occluded. If any area are occluded on face then face will be filtered. face means that face_occlusion_score must be lower than corresponding threshold.

mask_states
Array of integers (mask_states) non-empty
Items Enum: 1 2 3
Example: mask_states=2&mask_states=3

Filter by mask states.

mask state value
missing 1
medical_mask 2
occluded 3
liveness_states
Array of integers (liveness_states) non-empty
Items Enum: 0 1 2
Example: liveness_states=1

Filter by liveness states.

liveness state value
spoof 0
real 1
unknown 2
deepfake_states
Array of integers (deepfake_states) non-empty
Items Enum: 0 1
Example: deepfake_states=1

Filter by deepfake states.

deepfake state value
fake 0
real 1
use_exif_info
integer
Default: 1
Enum: 0 1
Example: use_exif_info=1

Whether to try to auto orient image based on EXIF data.

The processed image should have EXIF data, otherwise auto orientation will not be performed.

Has no effect with tiff images (they're always auto oriented).

Ignored with warped images (see warped_image or image_type parameter).

extract_exif
integer (extract_exif)
Default: 0
Enum: 0 1

Whether to extract EXIF meta information from input JPEG images.

Exact output will vary since there are no mandatory requirements for both authoring software and digital cameras how to write the data.

This function will only parse the tags and output their names and values as they are. Please refer to JEITA CP-3451 EXIF specification for details.

header Parameters
Accept
string
Enum: "application/json" "application/msgpack"

Accept request header.

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Enum: "application/json" "multipart/form-data" "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64"
Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema:
string <binary>

Responses

Request samples

Content type
No sample

Response samples

Content type
Example
{
  • "images_estimations": [
    ]
}

sdk options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

videosdk

video analytics [beta]

Request for video analysis based on the specified analytics parameters eg facial estimations.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"
Request Body schema: application/json
required
object

Video URL.

required
Array of any

A list of parameters for comprehensive video analytics.

Responses

Request samples

Content type
application/json
{
  • "video": {
    },
  • "analytics": [
    ]
}

Response samples

Content type
{
  • "video_data": {
    },
  • "analytics": [
    ]
}

videosdk options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

iso

iso resource

The resource performs a visual examination of frontal type images based on ISO/IEC 19794-5 standard. This means that the images that have passed the validation are standardized and attributes of the person's face meet the established requirements. For more information on the requirements for face attributes in the image, see ISO/IEC 19794-5 Clauses 7-10.

The output JSON contains the result of the check for each estimator. The image check is considered successful if the set of these results complies with the ISO standard.

The order of input images is corresponding to elements order in output JSON. If an image is broken, the resource will return an error for this image and other images will be correctly processed.

Notes for incoming data:

  • face or body bounding boxes passed with face or body warped image will be ignored.
Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
image_type
integer
Default: 0
Enum: 0 1

Image type of input image. 0 - raw image, 1 - face warped image.

multiface_policy
integer (iso_multiface_policy)
Default: 0
Enum: 0 1 2

multiple face detection policy:

  • 0 - multiple face detection not allowed

  • 1 - multiple face detection allowed

  • 2 - get only best face detection from the image

extract_exif
integer (extract_exif)
Default: 0
Enum: 0 1

Whether to extract EXIF meta information from input JPEG images.

Exact output will vary since there are no mandatory requirements for both authoring software and digital cameras how to write the data.

This function will only parse the tags and output their names and values as they are. Please refer to JEITA CP-3451 EXIF specification for details.

header Parameters
Accept
string
Enum: "application/json" "application/msgpack"

Accept request header.

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Enum: "application/json" "multipart/form-data" "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64"
Request Body schema:
string <binary>

Responses

Request samples

Content type
No sample

Response samples

Content type
Example
{
  • "images": [
    ]
}

iso options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

samples

detect faces

Detect faces in input images, create samples, and estimate face properties.

Detections can be filtered out by head pose. The pose is defined by yaw, pitch and roll angles. To specify a filtering threshold per-angle, use corresponding query parameters (yaw_threshold, pitch_threshold and roll_threshold). By default no filtering is applied.

The estimated face properties are not saved to the Faces database. They are only returned in the response.

Samples are saved in the storage without the ability to disable saving. You can disable the saving of samples only using the handlers.

Notes for incoming data:

  • face or body bounding boxes passed with face or body warped image will be ignored.
Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
multiface_policy
integer (multiface_policy)
Default: 1
Enum: 0 1 2

Multiple face detection policy:

  • 0 - multiple face detection not allowed;

  • 1 - multiple face detection allowed;

  • 2 - get only best face detection from the image.

estimate_head_pose
integer (estimate_head_pose)
Default: 0
Enum: 0 1

Whether to estimate head pose in the image. The head pose is represented by pitch, yaw and roll angles.

Not supported with warped images (see warped_image or image_type parameter).

estimate_emotions
integer (estimate_emotions)
Default: 0
Enum: 0 1

Whether to estimate emotions in the image. The probability of the following emotions is estimated: "anger", "disgust", "fear", "happiness", "sadness", "surprise", "neutral".

estimate_mask
integer (estimate_mask)
Default: 0
Enum: 0 1

Whether to estimate mask in the image. The probability of the following masks states is estimated: "medical_mask", "missing", "occluded".

The estimated probability with the highest score is returned in the "predominant mask" parameter.

detect_landmarks68
integer (detect_landmarks68)
Default: 0
Enum: 0 1

Whether to detect basic 68-point facial landmarks in the image. Not supported with warped images (see warped_image parameter).

extract_exif
integer (extract_exif)
Default: 0
Enum: 0 1

Whether to extract EXIF meta information from input JPEG images.

Exact output will vary since there are no mandatory requirements for both authoring software and digital cameras how to write the data.

This function will only parse the tags and output their names and values as they are. Please refer to JEITA CP-3451 EXIF specification for details.

estimate_quality
integer (estimate_quality)
Default: 0
Enum: 0 1

Whether to estimate input face image quality. Each of the following probabilities is estimated: "darkness", "light", "blurriness", "illumination", "specularity".

The quality factor is estimated for each probability. It's value is in the range [0..1] where 0 corresponds to low quality and 1 to high quality.

Note. Face recognition is not greatly affected by uneven illumination or high specularity.

estimate_gaze
integer (estimate_gaze)
Default: 0
Enum: 0 1

Whether to estimate gaze in the image. The gaze is represented by yaw angle and pitch angle for both eyes at once.

Not supported with warped images (see warped_image or image_type parameter).

estimate_eyes_attributes
integer (estimate_eyes_attributes)
Default: 0
Enum: 0 1

Whether to estimate eye attributes in the image. The "right_eye" and "left_eye" parameters are estimated, which contain the "state" (opened, closed or occluded) and "iris_landmarks" parameters.

estimate_mouth_attributes
integer (estimate_mouth_attributes)
Default: 0
Enum: 0 1

Whether to estimate mouth attributes in the image. Each of the following probabilities is estimated: "opened", "occluded", "smile", "score".

pitch_threshold
integer (pitch_threshold) [ 0 .. 180 ]
Example: pitch_threshold=180

Maximum deviation pitch angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

Remove this parameter from the query, or set the parameter value to 180 if pitch angle filtration is not required.

When the value is set to "0", all the images are filtered.

roll_threshold
integer (roll_threshold) [ 0 .. 180 ]
Example: roll_threshold=180

Maximum deviation roll angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

Remove this parameter from the query, or set the parameter value to 180 if roll angle filtration is not required.

When the value is set to "0", all the images are filtered.

yaw_threshold
integer (yaw_threshold) [ 0 .. 180 ]
Example: yaw_threshold=180

Maximum deviation yaw angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

Remove this parameter from the query, or set the parameter value to 180 if yaw angle filtration is not required.

When the value is set to "0", all the images are filtered.

warped_image
integer (warped_image)
Default: 0
Enum: 0 1

Whether an input image is a sample or not.

use_exif_info
integer
Default: 1
Enum: 0 1
Example: use_exif_info=1

Whether to try to auto orient image based on EXIF data.

The processed image should have EXIF data, otherwise auto orientation will not be performed.

Has no effect with tiff images (they're always auto oriented).

Ignored with warped images (see warped_image or image_type parameter).

estimate_face_quality
integer
Default: 0
Enum: 0 1

Whether to estimate face quality.

It enables you to perform various face quality checks by thresholds which similar to ISO standard. For more information on the requirements for face attributes in the image, see ISO/IEC 19794-5 Clauses 7-10.

âš  ISO licensing feature is required to be enabled to perform face quality estimation.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64"
Request Body schema:
string <binary>

Responses

Request samples

Content type
No sample

Response samples

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

detector options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

save face/body sample

Save face or body sample to the storage.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
samples_type
required
string
Enum: "faces" "bodies"

Samples type.

query Parameters
ttl
integer
Enum: 1 2 3 4 5 6 7 14 30 60 90 180 365 -1
Example: ttl=1

Lifetime for object, in days. By default, parent bucket lifetime configuration applied. For object to be retained indefinitely, setup ttl=-1.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/tiff" "image/x-portable-pixmap"
Request Body schema:
One of
string <binary> (face_sample)

Image generated by VisionLabs algorithms.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/samples/faces"
response = requests.post(url, data=image, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "sample_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
  • "url": "/6/samples/bodies/b5d6fd45-fcca-453d-ac05-3e594054b813"
}

face/body samples options

Get options for the resource.

path Parameters
samples_type
required
string
Enum: "faces" "bodies"

Samples type.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get face/body sample

Get face or body sample by ID. Returns its lifetime in X-Luna-Expiry-Date header.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
samples_type
required
string
Enum: "faces" "bodies"

Samples type.

sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/samples/faces"
sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

# get sample
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/samples/faces/{sampleId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
Example
{}

check if face/body sample exists

Check if face or body sample with sample_id exists. Returns its lifetime in X-Luna-Expiry-Date header.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
samples_type
required
string
Enum: "faces" "bodies"

Samples type.

sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/samples/faces"
sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

# get sample
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/samples/faces/{sampleId}"
response = requests.head(url, headers=headers)

print(response.status_code)

remove face/body sample

Remove face or body sample by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
samples_type
required
string
Enum: "faces" "bodies"

Samples type.

sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/samples/faces"
sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

# get sample
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/samples/faces/{sampleId}"
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

face/body sample options

Get options for the resource.

path Parameters
samples_type
required
string
Enum: "faces" "bodies"

Samples type.

sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get sample | previous version Deprecated

Get sample by ID using previous API version. Returns its lifetime in X-Luna-Expiry-Date header.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Response samples

Content type
application/json
Example
{}

check if sample exists | previous version Deprecated

Check if face or body sample with sample_id exists using previous API version. Returns its lifetime in X-Luna-Expiry-Date header.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

remove sample | previous version Deprecated

Remove sample by ID using previous API version.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Response samples

Content type
application/json
Example
{}

sample options | previous version Deprecated

Get options for the resource using previous API version.

path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get sample | legacy Deprecated

Get a face sample by ID. Returns its lifetime in X-Luna-Expiry-Date header.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Response samples

Content type
application/json
Example
{}

check if face sample exists | legacy Deprecated

Check if face sample with sample_id exists. Returns its lifetime in X-Luna-Expiry-Date header.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

remove face sample | legacy Deprecated

Remove sample by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Response samples

Content type
application/json
Example
{}

face sample options | legacy Deprecated

Get options for the resource.

path Parameters
sample_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
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

images

create images

Save images with unique ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
ttl
integer
Enum: 1 2 3 4 5 6 7 14 30 60 90 180 365 -1
Example: ttl=1

Lifetime for object, in days. By default, parent bucket lifetime configuration applied. For object to be retained indefinitely, setup ttl=-1.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/tiff" "image/x-portable-pixmap"

Type of transferring image.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

* (X-Luna-Meta-<user_defined_key>)
string
Example: <user_defined_value>

User-defined image metadata key-value. To store metadata values for multiple keys, the multiple headers should be defined.

Request Body schema:
string <binary> (binary_image)

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/images"
response = requests.post(url, data=image, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{}

images options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

check if image exists

Check if image with image_id exists. Returns its lifetime in X-Luna-Expiry-Date header.

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

Image ID.

query Parameters
with_meta
integer
Default: 0
Enum: 0 1
Example: with_meta=1

Whether to retrieve user-defined image metadata.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/images"
imageId = requests.post(url, data=image, headers=headers).json()["image_id"]

# get image
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/images/{imageId}"
response = requests.head(url, headers=headers)

print(response.status_code)

delete image

Delete an image.

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

Image ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/images"
imageId = requests.post(url, data=image, headers=headers).json()["image_id"]

# get image
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/images/{imageId}"
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

get image

Receive an origin image. Returns its lifetime in X-Luna-Expiry-Date header.

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

Image ID.

query Parameters
with_meta
integer
Default: 0
Enum: 0 1
Example: with_meta=1

Whether to retrieve user-defined image metadata.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("face_warp.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/images"
imageId = requests.post(url, data=image, headers=headers).json()["image_id"]

# get image
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/images/{imageId}"
response = requests.get(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

image options

Get options for the resource.

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

Image ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

objects

create objects

Save object with unique ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
ttl
integer
Enum: 1 2 3 4 5 6 7 14 30 60 90 180 365 -1
Example: ttl=1

Lifetime for object, in days. By default, parent bucket lifetime configuration applied. For object to be retained indefinitely, setup ttl=-1.

header Parameters
Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
required
string

Type of transferring information.

WARNING A value of this header will be used as a Content-Type header value for requests "GET object" and will be use for a mime type calculation.

Request Body schema: */*
string <binary>

Some user defined bytes. The service saves the bytes as is.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "text/plain",
}

url = f"{baseUri}/objects"
response = requests.post(url, data="example", headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{}

objects options

Get options for the resource.

header Parameters
Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get object

Receiving objects. Returns its lifetime in X-Luna-Expiry-Date header.

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

Object ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create objects
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "text/plain",
}

url = f"{baseUri}/objects"
objectId = requests.post(url, data="example", headers=headers).json()["object_id"]

# get object
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/objects/{objectId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.text)

Response samples

Content type
application/json
{}

check if object exists

Check if object with object_id exists. Returns its lifetime in X-Luna-Expiry-Date header.

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

Object ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create object
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "text/plain",
}

url = f"{baseUri}/objects"
objectId = requests.post(url, data="example", headers=headers).json()["object_id"]

# check objects
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/objects/{objectId}"
response = requests.head(url, headers=headers)

print(response.status_code)

delete object

Delete object

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

Object ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create object
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "text/plain",
}

url = f"{baseUri}/objects"
objectId = requests.post(url, data="example", headers=headers).json()["object_id"]

# get object
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/objects/{objectId}"
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

object options

Get options for the resource.

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

Object ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

attributes

extract attributes

Extract descriptors and basic attributes from samples.

All the extracted attributes are temporary.

Temporary attributes have a TTL (time to live) and will be removed from the database after the specified period.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
score_threshold
number (score_threshold) [ 0 .. 1 ]
Default: 0
Example: score_threshold=0.7

Descriptor quality score threshold. The higher the quality score for the image, the better the extraction results.

All the attributes with a quality score below the threshold will be ignored (and not stored in the DB). The function will proceed as usual with all the remaining descriptors (if left).

Consult VisionLabs about the recommended value of this parameter.

Note! This parameter is not related to the image quality estimated in the detect request (estimate_quality request parameter).

extract_descriptor
integer (extract_descriptor)
Default: 1
Enum: 0 1
Example: extract_descriptor=1

Whether to extract face descriptor(s).

extract_basic_attributes
integer (extract_basic_attributes)
Default: 0
Enum: 0 1

Whether to extract basic attributes (gender, age, ethnicity).

aggregate_attributes
integer (aggregate_attributes)

Whether to aggregate face attributes (descriptor and basic attributes). Aggregation will only be performed together with the extract_descriptor and/or extract_basic_attributes parameters.

If set, all extracted attributes from each image will be aggregated and stored as single objects.

Otherwise, all extracted attributes from each image will be stored for each sample as separate objects.

ttl
integer [ 1 .. 86400 ]
Default: 300

Lifetime for temporary attribute (seconds).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Array ([ 1 .. 8 ] items)
string <uuid> (sample_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...

Sample ID.

Responses

Request samples

Content type
application/json
[
  • "f9f03668-27e3-4e23-9b55-681e5927905e",
  • "4967ccb7-b521-43b5-93ba-a0d266631bb2",
  • "dd98cf9c-ddf3-4962-a3c5-e8bd540a4fc7"
]

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    },
  • {
    }
]

extractor options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

create temporary attribute

New temporary attributes creation.

Note. Use this request when you need to add basic attributes or descriptors from external storage. Otherwise, use the extract attributes request.

All the extracted attributes are temporary.

Temporary attributes have a TTL (time to live) and will be removed from the database after the specified period.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
ttl
integer [ 1 .. 86400 ]
Default: 300

Lifetime for temporary attribute (seconds).

header Parameters
Content-Type
string
Enum: "application/json" "multipart/form-data"

Content type is application/json or multipart/form-data.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Request Body schema:
One of
required
Array of descriptor_data (object) or sdk_descriptor (string) (face_descriptors) non-empty

List of descriptors with versions. Each descriptor is aggregated from the provided samples.

face_descriptor_samples
Array of strings <uuid> (attributes_samples) >= 0 items unique
Default: []

List of uniqie sample IDs which are resources for the estimated attributes.

WARNING: if the user does not set any attributes samples, faces with such attributes will be skipped during the process of updating attributes using new estimation algorithm.

required
object (basic_attributes_without_defaults)

Basic attributes.

basic_attributes_samples
Array of strings <uuid> (attributes_samples) >= 0 items unique
Default: []

List of uniqie sample IDs which are resources for the estimated attributes.

WARNING: if the user does not set any attributes samples, faces with such attributes will be skipped during the process of updating attributes using new estimation algorithm.

Responses

Request samples

Content type
Example
{
  • "face_descriptors": [
    ],
  • "face_descriptor_samples": [
    ],
  • "basic_attributes": {
    },
  • "basic_attributes_samples": [
    ]
}

Response samples

Content type
application/json
{}

get temporary attributes

Get temporary attributes by IDs.

For each attribute:

  • If the attribute TTL has not expired, the attribute data is returned.

  • If the TTL has expired, no data is returned for this attribute in the response.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
attribute_ids
required
string <list of uuid>

Comma-separated list of attribute IDs.

account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

targets
string <comma-separated items>
Default: "create_time, attribute_id, account_id, face_descriptor_samples, basic_attributes_samples, face_descriptor, basic_attributes_samples"
Example: targets=basic_attributes,basic_attributes_samples,account_id

Comma-separated list of temporary attributes targets. All targets are available by default.

descriptor_version
integer (descriptor_version)
Enum: 46 52 54 56 57 58 59 60 62 64
Example: descriptor_version=56

Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create attribute
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 0,
        "ethnicity": 3,
    },
}

url = f"{baseUri}/attributes"
attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

# get attributes
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

params = {
    "attribute_ids": [
        attributeId,
    ],
    "targets": "basic_attributes,basic_attributes_samples,account_id",
}

url = f"{baseUri}/attributes"
response = requests.get(
    url, headers=headers, params=params
)

print(response.status_code)
print(response.json())

Response samples

Content type
{
  • "attributes": [
    ]
}

temporary attributes options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get temporary attribute

Get temporary attribute by ID.

If the attribute TTL has not expired, the attribute data is returned.

Otherwise, the "Attributes not found" error is returned.

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

ID of the temporary attribute.

query Parameters
descriptor_version
integer (descriptor_version)
Enum: 46 52 54 56 57 58 59 60 62 64
Example: descriptor_version=56

Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used.

targets
string <comma-separated items>
Default: "create_time, attribute_id, account_id, face_descriptor_samples, basic_attributes_samples, face_descriptor, basic_attributes_samples"
Example: targets=basic_attributes,basic_attributes_samples,account_id

Comma-separated list of temporary attributes targets. All targets are available by default.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create attribute
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 1,
        "ethnicity": 3,
    },
}

url = f"{baseUri}/attributes"
attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

# get attributes
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/attributes/{attributeId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
Example
{
  • "create_time": "2021-08-11T14:57:18.416928+03:00",
  • "attribute_id": "7fdf9225-3c06-4c21-b774-8bea99bcce20",
  • "account_id": "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c",
  • "face_descriptor_samples": [
    ],
  • "basic_attributes_samples": [
    ],
  • "face_descriptor": "2xQ2gprbMUePw1s9gw9fvA==",
  • "basic_attributes": {
    }
}

check temporary attribute

Check if temporary attribute with attribute_id exists.

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

ID of the temporary attribute.

query Parameters
descriptor_version
integer (descriptor_version)
Enum: 46 52 54 56 57 58 59 60 62 64
Example: descriptor_version=56

Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used.

targets
string <comma-separated items>
Default: "create_time, attribute_id, account_id, face_descriptor_samples, basic_attributes_samples, face_descriptor, basic_attributes_samples"
Example: targets=basic_attributes,basic_attributes_samples,account_id

Comma-separated list of temporary attributes targets. All targets are available by default.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create attribute
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 1,
        "ethnicity": 3,
    },
}

url = f"{baseUri}/attributes"
attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

# get attributes
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/attributes/{attributeId}"
response = requests.head(url, headers=headers)

print(response.status_code)

delete attribute

Delete the attribute by its ID.

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

ID of the temporary attribute.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

# create attribute
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 1,
        "ethnicity": 3,
    },
}

url = "http://127.0.0.1:5000/6/attributes"
attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

# get attributes
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"http://127.0.0.1:5000/6/attributes/{attributeId}"
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

temporary attributes attribute options

Get options for the resource.

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

ID of the temporary attribute.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get temporary attribute samples

Get all the temporary attribute samples by the attribute ID.

If the attribute TTL has not expired, the attribute data is returned.

Otherwise, the "Attributes not found" error is returned.

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

ID of the temporary attribute.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("image.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/detector"
sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

# exreact attr
# create attribute
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 1,
        "ethnicity": 3,
    },
    "basic_attributes_samples": [
        sampleId,
    ],
}

url = f"{baseUri}/attributes"
attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

# get attributes by id
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/attributes/{attributeId}/samples"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

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

temporary attribute samples options

Get options for the resource.

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

ID of the temporary attribute.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

faces

create face

Create a face.

The face can be attached to one or several lists.

You can create new face using a temporary attribute ID or using external attribute data (descriptors and/or basic attributes).

You can also create the face without any attributes specified.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

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

Format of a request body data.

Request Body schema:
attribute_set_by_attribute_id (object) or (attribute_no_account (attribute_with_descriptors_and_basic_attributes_no_account (object) or attribute_with_basic_attributes_no_account (object) or attribute_with_descriptors_no_account (object))) (face_attribute)

Face attributes.

You can specify attributes for the face using one of several ways:

  • by specifying the attribute ID of a temporary attribute

  • by specifying descriptors and basic attributes (with or without samples)

  • by specifying descriptors (with or without samples)

  • by specifying basic attributes (with or without samples)

The last three ways are used when you need to create the face using data stored in external storage.

external_id
string (face_external_id) <= 36 characters
Default: ""

User-defined external ID for the face. External ID can be used to link several faces which belong to one person.

user_data
string (face_user_data) <= 128 characters
Default: ""

User data associated with face.

avatar
string <uri-reference> (avatar) <= 256 characters
Default: ""

Avatar is a visual representation of the face.

The avatar can be used in the user interface.

You can use a sample or an external image as the avatar.

lists
Array of strings <uuid> (list_id) non-empty

Lists for linking face with them.

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

The event ID associated with the face creation.

Responses

Request samples

Content type
Example
{}

Response samples

Content type
application/json
{}

get faces

Get faces according to filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

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

Upper bound for object create_time.

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

Lower included bound for object create_time.

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

Event ID associated with the face creation.

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

Face ID upper excluded bound. Faces in response will be sorted by their ids. If neither face_id__lt or face_id__gte is specified, the faces will be sorted by creation time.

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

Face ID lower included bound. Faces in response will be sorted by their ids. If neither face_id__lt or face_id__gte is specified, the faces will be sorted by creation time.

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

Comma-separated list of face IDs.

external_ids
string
Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381

Comma-separated list of external IDs.

user_data
string
Example: user_data=user_data_text

Find all objects with user_data similar to this parameter. You can specify only part of the user_data value for this filter.

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

List ID that contains faces.

targets
Array of strings (faces_targets)
Items Enum: "face_id" "account_id" "event_id" "user_data" "create_time" "external_id" "avatar" "lists"
Example: targets=face_id,user_data

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

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces"
params = {
    "create_time__gte": "2018-08-11T09:11:41.674Z",
    "user_data": "face",
    "targets": "face_id,account_id,event_id,user_data,create_time",
}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

delete faces

Delete several faces by IDs.

When the faces are removed, attributes (descriptors and basic attributes) linked to the faces are deleted. Samples linked to the faces are not deleted.

If you need to delete faces according to some filters and with all samples, you can use the "garbage collection task" with target = faces and remove_samples flag enabled.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
ignore
integer (int01)
Default: 0
Enum: 0 1

Whether to ignore the error if the face to be deleted does not exist.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
face_ids
required
Array of strings <uuid> (face_id) non-empty

Comma-separated list of face IDs for removal.

Responses

Request samples

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

Response samples

Content type
application/json
{}

faces options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get face count

Count faces according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Upper bound for object create_time.

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

Lower included bound for object create_time.

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

Comma-separated list of face IDs.

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

Face ID upper excluded bound.

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

Face ID lower included bound.

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

Event ID associated with the face creation.

external_ids
string
Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381

Comma-separated list of external IDs.

user_data
string
Example: user_data=user_data_text

Find all objects with user_data similar to this parameter. You can specify only part of the user_data value for this filter.

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

List ID that contains faces.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces/count"
params = {
    "create_time__gte": "2018-08-11T09:11:41.674Z",
    "user_data": "face",
}
response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "faces_count": 7
}

faces count options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get count of faces with attributes

Count faces with attributes.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces/attributes/count"

response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "faces_count": 7
}

get count of faces with attributes options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get face

Get face by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

query Parameters
targets
Array of strings (faces_targets)
Items Enum: "face_id" "account_id" "event_id" "user_data" "create_time" "external_id" "avatar" "lists"
Example: targets=face_id,user_data

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

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces"
faceId = requests.post(url, headers=headers).json()["face_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/faces/{faceId}"
response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
  • "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "event_id": "f9687459-986b-406d-9c1f-0d6289be5256",
  • "user_data": "fox1991",
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
  • "lists": [
    ]
}

patch face

Update face fields: user_data, external_id, event_id, avatar.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
external_id
string <= 36 characters

User-defined external ID for the face.

event_id
string or null <uuid> (event_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...

Event ID.

user_data
string <= 128 characters

User data associated with face.

avatar
string <uri-reference> (avatar) <= 256 characters
Default: ""

Avatar is a visual representation of the face.

The avatar can be used in the user interface.

You can use a sample or an external image as the avatar.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

remove face

Remove face by ID.

When the face is removed, attributes (descriptors and basic attributes) linked to the face are deleted. Samples linked to the face are not deleted. If there are a small number of samples for face, then you can use the resources "get face attribute samples" > "remove face/body sample" > "delete face" (this resource). If you need to delete faces according to some filters and with all samples, you can use the "garbage collection task" with target = faces and remove_samples flag enabled.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
url = f"{baseUri}/faces"
faceId = requests.post(
    url,
    headers=headers,
).json()["face_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces/{faceId}"
response = requests.delete(
    url,
    headers=headers,
)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

check if face exists

Check if face with face_id exists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

query Parameters
targets
Array of strings (faces_targets)
Items Enum: "face_id" "account_id" "event_id" "user_data" "create_time" "external_id" "avatar" "lists"
Example: targets=face_id,user_data

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

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces"
faceId = requests.post(
    url,
    headers=headers,
).json()["face_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces/{faceId}"
response = requests.head(
    url,
    headers=headers,
)

print(response.status_code)

face options

Get options for the resource.

path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

face attributes

put face attribute

Put face attribute.

This request changes all the attribute data corresponding to the specified face.

The attribute can be specified by temporary attribute ID or using external attribute data (descriptors and/or basic attributes).

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

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

Attribute ID. This ID links the descriptor, basic attributes, and samples extracted from a single image.

Responses

Request samples

Content type
Example
{
  • "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}

Response samples

Content type
application/json
Example
{}

get face attribute

Get face attribute by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

query Parameters
descriptor_format
integer
Default: "raw"
Enum: "raw" "sdk"

Output descriptor format.

Note that raw format is deprecated

targets
string <comma-separated items>
Default: "create_time,basic_attributes,basic_attributes_samples,face_descriptor,face_descriptor_samples"

Comma-separated list of temporary attributes targets. Available targets: create_time, basic_attributes, basic_attributes_samples, face_descriptor, face_descriptor_samples.

descriptor_version
integer (descriptor_version)
Enum: 46 52 54 56 57 58 59 60 62 64
Example: descriptor_version=56

Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import base64

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("image.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/detector"
sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

# create attribute
with open("descriptor56", "rb") as file:
    descriptor = base64.b64encode(file.read()).decode()

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
params = {
    "ttl": 600,
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 0,
        "ethnicity": 3,
    },
    "basic_attributes_samples": [
        sampleId,
    ],
    "face_descriptor_samples": [
        sampleId,
    ],
    "face_descriptors": [
        {"descriptor": descriptor, "version": 56},
    ],
}
url = f"{baseUri}/attributes"
attributeId = requests.post(
    url, json=payload, headers=headers, params=params
).json()["attribute_id"]

# create face
payload = {
    "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
    "attribute": {"attribute_id": attributeId},
}
headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
url = f"{baseUri}/faces"
faceId = requests.post(
    url,
    headers=headers,
    json=payload,
).json()["face_id"]

# get face attribute by ID
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces/{faceId}/attributes"
response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

Content type
{
  • "attributes": {
    }
}

delete face attribute

Remove face attribute by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import base64

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}
with open("image.jpg", "rb") as image_file:
    image = image_file.read()
url = f"{baseUri}/detector"
sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

# create attribute
with open("descriptor56", "rb") as file:
    descriptor = base64.b64encode(file.read()).decode()

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
params = {
    "ttl": 600,
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 0,
        "ethnicity": 3,
    },
    "basic_attributes_samples": [
        sampleId,
    ],
    "face_descriptor_samples": [
        sampleId,
    ],
    "face_descriptors": [
        {"descriptor": descriptor, "version": 56},
    ],
}
url = f"{baseUri}/attributes"
attributeId = requests.post(
    url, json=payload, headers=headers, params=params
).json()["attribute_id"]

payload = {
    "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
    "attribute": {"attribute_id": attributeId},
}

# create face
headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
url = f"{baseUri}/faces"
faceId = requests.post(
    url,
    headers=headers,
    json=payload,
).json()["face_id"]

# get face attribute by ID
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces/{faceId}/attributes"
response = requests.delete(
    url,
    headers=headers,
)

print(response.status_code)

Response samples

Content type
application/json
{}

faces attributes options

Get options for the resource.

path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get face attribute samples

Get face attribute samples by face ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import base64

baseUri = "http://127.0.0.1:5000/6"

# create sample
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
}

with open("image.jpg", "rb") as image_file:
    image = image_file.read()

url = f"{baseUri}/detector"
sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

# create attribute
with open("descriptor56", "rb") as file:
    descriptor = base64.b64encode(file.read()).decode()

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
params = {
    "ttl": 600,
}
payload = {
    "basic_attributes": {
        "age": 29,
        "gender": 0,
        "ethnicity": 3,
    },
    "basic_attributes_samples": [
        sampleId,
    ],
    "face_descriptor_samples": [
        sampleId,
    ],
    "face_descriptors": [
        {"descriptor": descriptor, "version": 56},
    ],
}
url = f"{baseUri}/attributes"
attributeId = requests.post(
    url, json=payload, headers=headers, params=params
).json()["attribute_id"]

# create face
payload = {
    "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
    "attribute": {"attribute_id": attributeId},
}
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces"
faceId = requests.post(
    url,
    headers=headers,
    json=payload,
).json()["face_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/faces/{faceId}/attributes/samples"
response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

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

faces attributes samples options

Get options for the resource.

path Parameters
face_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

ID of the face (face_id received in the "create face" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

lists

create list

Create a list.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
user_data
string (list_user_data) <= 128 characters
Default: ""

User data associated with list.

Responses

Request samples

Content type
application/json
{
  • "user_data": "list of good persons"
}

Response samples

Content type
application/json
{}

get lists

Get lists according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Upper bound for list create_time.

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

Lower included bound for list create_time.

last_update_time__lt
string <date-time> (time)
Example: last_update_time__lt=2018-08-11T09:11:41.674Z

Upper excluded bound for list last_update_time.

last_update_time__gte
string <date-time> (time)
Example: last_update_time__gte=2018-08-11T09:11:41.674Z

Lower included bound for list last_update_time.

user_data
string
Example: user_data=user_data_text

Find all objects with user_data similar to this parameter. You can specify only part of the user_data value for this filter.

user_data__eq
string
Example: user_data__eq=user_data_text

Find all objects with same user_data.

list_ids
string <list of uuid>

Comma-separated list of list IDs.

list_id__lt
string <uuid>

List ID upper excluding boundary.

list_id__gte
string <uuid>

List ID lower including boundary.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

params = {
    "user_data": "good",
    "page_size": 20,
    "create_time__gte": "2020-10-10T09:11:41.674Z",
}
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/lists"
response = requests.get(url, params=params, headers=headers)

print(response.status_code)
print(response.json())

Response samples

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

delete lists

Delete several lists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
with_faces
integer (int01)
Default: 0
Enum: 0 1

Whether to delete list with all its faces.

header Parameters
Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
list_ids
required
Array of strings <uuid> (list_id) non-empty

Comma-separated list of list IDs for removal.

Responses

Request samples

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

Response samples

Content type
application/json
{}

lists options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get list count

Count lists according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

user_data
string
Example: user_data=user_data_text

Find all objects with user_data similar to this parameter. You can specify only part of the user_data value for this filter.

user_data__eq
string
Example: user_data__eq=user_data_text

Find all objects with same user_data.

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

Upper bound for list create_time.

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

Lower included bound for list create_time.

last_update_time__lt
string <date-time> (time)
Example: last_update_time__lt=2018-08-11T09:11:41.674Z

Upper excluded bound for list last_update_time.

last_update_time__gte
string <date-time> (time)
Example: last_update_time__gte=2018-08-11T09:11:41.674Z

Lower included bound for list last_update_time.

list_ids
string <list of uuid>

Comma-separated list of list IDs.

list_id__lt
string <uuid>

List ID upper excluding boundary.

list_id__gte
string <uuid>

List ID lower including boundary.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# get list according to the filters
params = {
    "user_data": "good",
    "create_time__gte": "2020-10-10T09:11:41.674Z",
    "last_update_time__gte": "2020-10-10T09:11:41.674Z",
}
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/lists/count"
response = requests.get(url, params=params, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "lists_count": 3
}

lists count options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get list

Get list by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
list_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

List ID (list_id received in the "create list" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create list
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/lists"
listId = requests.post(url, headers=headers).json()["list_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/lists/{listId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "list_id": "c004aae2-f191-4a1a-9d2a-e5894f8cecbf",
  • "user_data": "good guys",
  • "account_id": "c004aae2-f191-4a1a-9d2a-e5894f8cecbf",
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "last_update_time": "2018-08-11T09:11:41.674Z"
}

check if list exists

Check if list with list_id exists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
list_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

List ID (list_id received in the "create list" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create list
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/lists"
listId = requests.post(url, headers=headers).json()["list_id"]

# check list
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/lists/{listId}"
response = requests.head(url, headers=headers)

print(response.status_code)
print(response.json())

update list

Update the user_data field of the list.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
list_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

List ID (list_id received in the "create list" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
user_data
string <= 128 characters

User data associated with list.

Responses

Request samples

Content type
application/json
{
  • "user_data": "list of good persons"
}

Response samples

Content type
application/json
Example
{}

delete list

Delete list by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
list_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

List ID (list_id received in the "create list" request).

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

Whether to delete list with all its faces.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create list
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/lists"
listId = requests.post(url, headers=headers).json()["list_id"]

# delete list
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
params = {"with_faces": 1}
url = f"{baseUri}/lists/{listId}"
response = requests.delete(url, params=params, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

list options

Get options for the resource.

path Parameters
list_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

List ID (list_id received in the "create list" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

attach/detach faces to the list

Attach or detach faces to the list.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
list_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

List ID (list_id received in the "create list" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
action
required
string
Enum: "attach" "detach"

Expected action with list and faces.

face_ids
required
Array of strings <uuid> (face_id) [ 1 .. 1000 ] items

Faces to attach or detach to/from list. It is preferable to use up to 100 face IDs per request to reduce the load on the system.

Responses

Request samples

Content type
application/json
{
  • "action": "attach",
  • "face_ids": [
    ]
}

Response samples

Content type
application/json
Example
{}

link options

Get options for the resource.

path Parameters
list_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

List ID (list_id received in the "create list" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

matcher

matching faces

Performs matching of given references with given candidates.

Note! Descriptors must be extracted for reference(s) and candidate(s). Objects without descriptors cannot be matched.

The sources for candidates are faces, attributes and events. See the "compare two faces using their IDs", "compare two events using their IDs", and "compare events using filters" examples.

You can specify the "list_id" filter of the "faces" candidate to perform matching by the specified list. See the "search by list and creation time" examples.

The sources for references are faces, events, attributes, external IDs of faces, or descriptors (raw, SDK format, or binary XPK format).

Matching results are returned for the candidates that correspond to the specified filters. If none of the candidates corresponds to the filters (for example, a non-existent ID is set in the "event_ids" field or the "face_ids" field), there will be no matching result and no error returned. The result field will be empty. See the "nonexistent references errors" examples.

If a non-existent reference is set (for example, a non-existent ID is set in the "event_id" field or the "face_id" field), the corresponding error is returned. See the "no ID for reference face found" response example.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Format of a request body data.

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Accept
string
Default: application/json
Enum: "application/json" "application/msgpack"

Determines response mime-type which client to expect.

Request Body schema:
required
Array of candidate_face (object) or candidate_event (object) or candidate_attribute (object) [ 0 .. 30 ] items

Candidates for matching.

required
Array of any [ 1 .. 30 ] items

References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types.

Responses

Request samples

Content type
Example
{
  • "candidates": [
    ],
  • "references": [
    ]
}

Response samples

Content type
Example
[
  • {
    }
]

matcher options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

human body matching

Matcher API allows to submit tasks to a service that searches for human bodies similar to a given reference(s) by matching them. A body attribute descriptor should be extracted for reference(s) and candidate(s).

The sources for references are events or binary descriptor. The sources for candidates is events.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Format of a request body data.

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Accept
string
Default: application/json
Enum: "application/json" "application/msgpack"

Determines response mime-type which client to expect.

Request Body schema:
required
Array of any [ 1 .. 30 ] items

References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types.

required
Array of objects (candidate_event) [ 1 .. 30 ] items

Candidates for matching.

Responses

Request samples

Content type
{
  • "references": [
    ],
  • "candidates": [
    ]
}

Response samples

Content type
Example
[
  • {
    },
  • {
    }
]

matcher options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

raw matching

Matcher raw API allows to do similarity calculations for input descriptors.

Authorizations:
BasicAuthLunaAccountIdAuth
header Parameters
Content-Type
string
Enum: "application/json" "application/msgpack"

Format of a request body data.

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Accept
string
Default: application/json
Enum: "application/json" "application/msgpack"

Determines response mime-type which client to expect.

Request Body schema:
required
Array of xpk_file_entity (object) or sdk_descriptor_entity (object) or raw_descriptor_entity (object) non-empty

Reference list for matching.

required
Array of xpk_file_entity (object) or sdk_descriptor_entity (object) or raw_descriptor_entity (object) non-empty

Candidates for matching.

Responses

Request samples

Content type
{
  • "references": [
    ],
  • "candidates": [
    ]
}

Response samples

Content type
{
  • "matches": [
    ]
}

matcher raw options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

handlers

create handler

Create a handler.

The handler determines the list of rules (policies) for processing of input images.

Handlers can be static, dynamic or lambda.

When the handler is static, you specify its policies and then you specify the created handler ID during the event creation.

When the handler is dynamic, you create it without predefined policies and then you specify them during event creation. You can create the dynamic handler by setting "handler_type" field to 1.

Some parameters from the storage_policy are enabled by default (for example, face_sample_policy > store_sample). Don't forget to disable saving the necessary objects to avoid overflowing the storage.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
description
string <= 128 characters

Description of the handler. Use it to distinguish the handler from other created handlers and filter handlers using "get handlers" and "get handler count" requests.

object (Policies)

The set of rules, which determine input images processing. The absence of policies indicates that the handler is dynamic.

handler_type
integer (handler_type)
Default: 0
Enum: 0 1 2

Whether to get only non-dynamic (0), dynamic (1) or lambda (2) handlers.

If type is non-dynamic:

  • Handler will use policies what assigned to it.

If type is dynamic:

  • Handler will use given policies for each event generation request.

If type is lambda:

  • All requests will be sent to lambda handler using lambda_id.
  • The format of the request and response body may not match what is specified for canonical handlers.
  • Logic of the request behavior completely depends on the lambda, written by the user.
  • For a description, see documentation of the lambda.
is_dynamic
boolean (is_dynamic)
Deprecated
Default: false

Dynamic handler flag. If the value is set to "true", the handler is created without predefined policies.

Use this flag to specify policies for each event created using resource "/handlers/{handler_id}/event". Use the request body schema "multipart/form-data" to specify policies.

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

Lambda ID.

Responses

Request samples

Content type
application/json
Example
{
  • "description": "Full handler example",
  • "policies": {
    },
  • "handler_type": 0
}

Response samples

Content type
application/json
{}

get handlers

Get handlers by filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

handler_type
integer
Enum: 0 1 2

Whether to get only handler with specific type (0 - static, 1 - dynamic, 2 - lambda).

If not specified handlers of any type will be received.

If handler_type specified, the deprecated is_dynamic parameter will be ignored.

is_dynamic
integer
Deprecated
Enum: 0 1

Whether to get only dynamic (1) or non-dynamic (0) handlers. If not specified handlers of both type will received.

description
string

Records with descriptions similar to this parameter will be processed.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

params = {
    "description": "handler",
    "handler_type": 1,
    "page": 1,
}

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/handlers"

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

handlers options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get handler count

Count handlers.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
description
string

Find all the handlers with description similar to this parameter.

account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

handler_type
integer
Enum: 0 1 2

Whether to get only handler with specific type (0 - static, 1 - dynamic, 2 - lambda).

If not specified handlers of any type will be received.

If handler_type specified, the deprecated is_dynamic parameter will be ignored.

is_dynamic
integer
Deprecated
Enum: 0 1

Whether to get only dynamic (1) or non-dynamic (0) handlers. If not specified handlers of both type will received.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

params = {
    "description": "handler",
    "handler_type": 0,
}

url = f"{baseUri}/handlers/count"

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "handlers_count": 5
}

handler count options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

validate handler policies

Validate handler policies before using them to create or update a handler.

Authorizations:
BasicAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
required
object (Policies)

The set of rules, which determine input images processing. The absence of policies indicates that the handler is dynamic.

Responses

Request samples

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

Response samples

Content type
application/json
Example
{}

handler policies validator options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get handler

Get handler by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

import requests

baseUri = "http://127.0.0.1:5000/6"

# create handler
headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
url = f"{baseUri}/handlers"
payload = {"handler_type": 1}
dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

# get handler
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}
url = f"{baseUri}/handlers/{dynamicHandlerId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "handler_id": "de0846a8-09b2-4c6f-8175-99cfae98cf6b",
  • "account_id": "3c3a83c2-c21e-4855-91b5-34e6b63fb12d",
  • "description": "first handler",
  • "policies": {
    },
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "last_update_time": "2018-08-11T09:11:41.674Z",
  • "handler_type": 0
}

replace handler

Update handler. You cannot update a part of the handler, so you should specify all the fields for your handler.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
description
string <= 128 characters

Description of the handler. Use it to distinguish the handler from other created handlers and filter handlers using "get handlers" and "get handler count" requests.

object (Policies)

The set of rules, which determine input images processing. The absence of policies indicates that the handler is dynamic.

handler_type
integer (handler_type)
Default: 0
Enum: 0 1 2

Whether to get only non-dynamic (0), dynamic (1) or lambda (2) handlers.

If type is non-dynamic:

  • Handler will use policies what assigned to it.

If type is dynamic:

  • Handler will use given policies for each event generation request.

If type is lambda:

  • All requests will be sent to lambda handler using lambda_id.
  • The format of the request and response body may not match what is specified for canonical handlers.
  • Logic of the request behavior completely depends on the lambda, written by the user.
  • For a description, see documentation of the lambda.
is_dynamic
boolean (is_dynamic)
Deprecated
Default: false

Dynamic handler flag. If the value is set to "true", the handler is created without predefined policies.

Use this flag to specify policies for each event created using resource "/handlers/{handler_id}/event". Use the request body schema "multipart/form-data" to specify policies.

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

Lambda ID.

Responses

Request samples

Content type
application/json
{
  • "description": "Handler example",
  • "policies": {
    },
  • "handler_type": 0,
  • "is_dynamic": false,
  • "lambda_id": "string"
}

Response samples

Content type
application/json
Example
{}

check if handler exists

Check if handler with handler_id exists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/handlers"

payload = {"handler_type": 1}
dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/handlers/{dynamicHandlerId}"
response = requests.head(url, headers=headers)

print(response.status_code)

remove handler

Remove handler by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/handlers"

payload = {"handler_type": 1}
dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/handlers/{dynamicHandlerId}"
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

handler options

Get options for the resource.

path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

events

generate events

Process images and/or raw descriptors using the specified handler and generate events.

Specify the multipart/form-data schema if you need to specify the dynamic handler policies.

If the Events service support is disabled on the server, events will not be saved to the database.

Notes for incoming data:

  • set the image detection time, if necessary, otherwise it will be equal to the request time.
  • face or body bounding boxes passed with face or body warped image will presented as sample detection rect in generated event.

Objects to be processed must belong to the user account making the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
handler_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

Handler ID.

query Parameters
city
string (location_str) <= 36 characters
Example: city=New York

City where an event occurred.

area
string (location_str) <= 36 characters
Example: area=Manhattan

Area where an event occurred.

district
string (location_str) <= 36 characters
Example: district=Midtown

District where an event occurred.

street
string (location_str) <= 36 characters
Example: street=West 48th street

Street where an event occurred.

house_number
string (location_str) <= 36 characters
Example: house_number=220

House number where an event occurred.

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

Longitude in degrees, a part of composite geo position. Geo position is considered as properly specified if both longitude and latitude are set.

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

Latitude in degrees, a part of composite geo position. Geo position is considered as properly specified if both longitude and latitude are set.

external_id
string (event_external_id) <= 36 characters
Default: ""
Example: external_id=14159261415926

External ID for created events and faces (if store_face is enabled in handler).

When Unicode symbols (for example, the "+" symbol) are used in "external_id", the string should be encoded. Otherwise, the Unicode symbols will be lost. The "luna3" client library provides the encoding example

user_data
string (face_user_data) <= 128 characters
Default: ""
Example: user_data=face of person

User data for created events and faces (if store_face is enabled in handler).

image_type
integer
Default: 0
Enum: 0 1 2

Type of input image. 0 - raw image, 1 - face warped image, 2 - body warped image.

aggregate_attributes
integer (aggregate_attributes)

Whether to aggregate the following parameters:

  • face descriptor (not displayed in the response body)
  • body descriptor (not displayed in the response body)
  • face basic attributes (age, gender)
  • body basic attributes (apparent age, apparent gender)
  • mask states
  • emotions
  • liveness
  • deepfake
  • upper body
  • accessories

Aggregation will be performed only if the appropriate parameters for estimating the listed above parameters are enabled in the handler.

If set, all estimated parameters from each image will be aggregated and stored in the event as single objects for all images. In the response body, the aggregated face basic attributes of all images will be displayed in the face_attributes > basic_attributes field, and the other aggregated parameters will be displayed in the aggregate_estimations field.

Otherwise, all estimated parameters from each image will be stored in the event as separate objects. In the response body, the face basic attributes will be displayed in the face_attributes > basic_attributes field of the corresponding image, and the other parameters will be displayed in the detections > samples > face/body > detection > attributes field of the corresponding image.

source
string (source) <= 128 characters
Example: source=3rd Avenue

Additional information provided by user along with event.

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

Stream ID.

tags
Array of strings (tag) >= 0 items [ items <= 36 characters ]
Example: tags=tag_1,tag_2

Comma-separated list of tags. Each event from result will contain all of given tags. Each tag can be at most 36 characters.

track_id
string (track_id) ^[a-zA-Z0-9_\-]{1,36}$
Example: track_id=useful_track_id_number_1

Event track ID.

use_exif_info
integer
Default: 1
Enum: 0 1
Example: use_exif_info=1

Whether to try to auto orient image based on EXIF data.

The processed image should have EXIF data, otherwise auto orientation will not be performed.

Has no effect with tiff images (they're always auto oriented).

Ignored with warped images (see warped_image or image_type parameter).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Luna-Event-Time
string <date-time> (time)
Examples:
  • 2018-12-16T15:29:59.300275-08:00 - time with timezone with an offset of -08:00 from UTC (Pacific Standard Time).
  • 2018-12-16T15:29:59.300275Z - utc time. The "Z" suffix denotes a UTC offset of 00:00 (Zulu).

User defined event time. All events will be saved with this time as "create_time".

Format of time is rfc3339. Any other format is ignored.

Luna-Event-End-Time
string <date-time> (time)
Examples:
  • 2018-12-16T15:29:59.300275-08:00 - time with timezone with an offset of -08:00 from UTC (Pacific Standard Time).
  • 2018-12-16T15:29:59.300275Z - utc time. The "Z" suffix denotes a UTC offset of 00:00 (Zulu).

User defined event end time. All events will be saved with this time as "end_time".

Format of time is rfc3339. All other format is ignored.

Content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" "application/x-sdk-descriptor" "application/x-vl-xpk" "application/x-sdk-descriptor-base64" "applicaition/x-vl-xpk-base64"
Request Body schema:
string <binary>

Responses

Request samples

Content type
No sample

Response samples

Content type
application/json
Example
{
  • "images": [
    ],
  • "events": [
    ],
  • "filtered_detections": {
    }
}

generate events options

Get options for the resource.

path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

generate stream events (beta)

WARNING Experimental resource. Backwards compatibility is not guaranteed.

Process images using the specified handler and generate stream events.

If the Events service support is disabled on the server, events will not be saved to the database.

Notes for incoming data:

  • set the image detection time, if necessary, otherwise it will be equal to the request time.
  • face or body bounding boxes passed with face or body warped image will presented as sample detection rect in generated event.

Objects to be processed must belong to the user account making the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/msgpack"

Format of a request body data.

Request Body schema: application/msgpack
aggregate_attributes
required
integer (aggregate_attributes)

Whether to aggregate attributes.

If the value is set to "0", a descriptor and basic attributes are extracted for each sample.

If the value is set to "1", you can create an aggregated descriptor, receive aggregated basic attributes, or both. The behavior depends on the extract_basic_attributes and extract_descriptor parameters:

  • If extract_descriptor is enabled, all the samples in the request will be used to create a single descriptor. An aggregated descriptor gives you more accurate results upon descriptors comparison.

  • If extract_basic_attributes is enabled, all the samples in the request will be used to extract basic attributes. Age, gender and ethnicity values received from several samples are more precise.

Make sure that all the samples in the request belong to the same person.

If there are several faces in the input image, an error occurs.

required
Array of any (event_sources_non_aggregated) non-empty
use_exif_info
integer (use_exif_info)
Default: 1
Enum: 0 1

Whether to try to auto orient image based on exif data

Has no effect with tiff images (they're always auto oriented).

Ignored with warped images (see warped_image or image_type parameter).

Responses

Request samples

Content type
application/msgpack
Example
{
  "aggregate_attributes": 0,
  "sources": [
    {
      "detect_time": "2023-11-29T10:48:14.741Z",
      "filename": "filename_267.jpg",
      "source": [
        {
          "body": {
            "origin_bounding_box": {
              "height": 468,
              "width": 96,
              "x": 1824,
              "y": 294
            },
            "warp": "image_bytes"
          },
          "source_data": {
            "event_end_time": "2023-11-29T10:48:14.741Z",
            "event_time": "2023-11-29T10:48:14.741Z",
            "location": {
              "area": "Central",
              "city": "Moscow",
              "district": "Basmanny",
              "geo_position": {
                "latitude": 55.752,
                "longitude": 36.616
              },
              "house_number": "23 bldg.3",
              "street": "Podsosensky lane"
            },
            "source": "Source 0",
            "stream_id": "319d711e-6148-4c55-9eed-094b7e535fe7",
            "track_id": "8d57654a-3905-4326-8db6-dcf8000000a3",
            "user_data": ""
          },
          "trusted_detections": 1
        }
      ],
      "source_type": "detections"
    }
  ],
  "use_exif_info": 1
}

Response samples

Content type
application/json
Example
{
  • "images": [
    ],
  • "events": [
    ],
  • "filtered_detections": {
    }
}

generate stream events options

Get options for the resource.

path Parameters
handler_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

Handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

save event

Save event which was generated by the user. The event structure is similar to an event from handler response. Input events will send to the Sender also and to plugins. Therefore, these events are the same events except that events were generated an external handler. Handler ID must belong to a dynamic handler.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
handler_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

Dynamic handler ID.

query Parameters
wait_saving
integer
Default: 1
Enum: 0 1

Whether to wait for raw event saving.

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

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

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Array of objects <= 100 items

List of body & face related detections.

source
string (source) <= 128 characters

Additional information that user provides with event.

stream_id
string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...

Stream ID.

object (input_event_location)

Information about place where an event occurred.

external_id
string (event_external_id) <= 36 characters
Default: ""

User-defined external ID for the event.

user_data
string (event_user_data) <= 128 characters
Default: ""

User data associated with event.

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

Event track ID.

object (input_event_face)

Face associated with event.

Array of objects or null <= 30 items

Sorted list with match result for the event.

object or null (input_event_face_attribute)

User extracted event face attributes.

object or null (input_event_body_attribute)

User extracted event body attributes.

object (input_event_aggregate_estimations)

Aggregated attributes estimated from samples.

tags
Array of strings [ 0 .. 1000 ] items [ items <= 36 characters ]

List of tags.

create_time
string <date-time>

Time of the event creation.

end_time
string <date-time>

The end time of the event.

object (event_meta_common)

User defined metadata (JSON object). Size shouldn't exceed 2MB.

To be able to further search for meta using GET requests, JSON must have a valid format without spaces in field names. Use only latin letters, numbers, and single underscores in field names.

Responses

Request samples

Content type
application/json
{
  • "detections": [
    ],
  • "source": "3rd Avenue",
  • "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "location": {
    },
  • "external_id": "14159261415926",
  • "user_data": "some event",
  • "track_id": "useful_track_id_number_1",
  • "face": {
    },
  • "matches": [
    ],
  • "face_attributes": {
    },
  • "body_attributes": {
    },
  • "aggregate_estimations": {
    },
  • "tags": [
    ],
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "end_time": "2018-08-11T09:11:41.674Z",
  • "meta": {
    }
}

Response samples

Content type
application/json
{}

save event options

Get options for the resource.

path Parameters
handler_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

Dynamic handler ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

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.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Array of objects (targets) >= 0 items
Default: [{"column":"event_id","aggregator":"count"}]

You can specify one or several event fields and functions for them for data aggregation.

The table includes event fields and available functions for them:

Column Aggregator
count max min avg group_by
event_id + - - - +
external_id + - - - +
handler_id + - - - +
stream_id + - - - +
source + - - - +
top_matching_candidates_label + - - - +
top_similar_object_id + - - - +
top_similar_external_id + - - - +
top_similar_object_similarity + + + + -
create_time + + + - -
end_time + + + - -
face_id + - - - +
gender + + + + +
age + + + + +
emotion + + + + +
mask + + + + +
ethnic_group + + + + +
liveness + + + + +
deepfake + + + + +
user_data + - - - +
tags + + + - -
city + - - - +
area + - - - +
district + - - - +
street + - - - +
house_number + - - - +
geo_position + - - - -
track_id + - - - +
apparent_age + + + + +
apparent_gender + + + + +
sleeve_length + - - - +
headwear_state + + + + +
headwear_apparent_color + - - - +
upper_clothing_colors + - - - -
lower_garment_colors + - - - -
lower_garment_type + - - - +
shoes_apparent_color + - - - +
backpack_state + + + + +
meta.* + + + + -

Note! There must be at least one function different from group_by in the targets, otherwise an error occurs.

Array of objects (filters) >= 0 items

Specifies filters for events.

Operators available for each filter:

Filter Operator
like, nlike in, nin eq, neq gt, gte, lt, lte covered eq null
tags + - - - - -
source - + + - - +
stream_id - + + - - +
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 - + + + - +
deepfake - + + + - +
city - + + - - +
area - + + - - +
district - + + - - +
street - + + - - +
house_number - + + - - +
geo_position - - - - + +
track_id - + + - - +
apparent_age - + + + - +
apparent_gender - + + + - +
sleeve_length - + + - - +
headwear_state - + + + - +
upper_clothing_colors - + - - - +
backpack_state - + + + - +
lower_garment_colors - + - - - +
headwear_apparent_color - + + - - +
lower_garment_type - + + - - +
shoes_apparent_color - + + - - +
meta.* + + + + - +
Array of objects (periods) >= 0 items

Specifies the period of event creation. All the events created during this period will be included in the statistics.

You can set the start and end of the period or only one of the bounds.

Note! You can specify only one period!

group_by
string (group_by)

Enables you to group events by creation time according to one of two ways:

  1. Grouping by time intervals - number and dimension
Parameter value Description
1m one minute
2h two hours
7d seven days
5w five weeks
3M three months
10y ten years
  1. The frequency grouping - one of the following
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 statistics options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get events

Get events that satisfy filters.

Default filters for events:

  • create_time__lt - current date and time
  • create_time__gte - current date and time 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.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

target
Array of strings (events_targets)
Items Enum: "event_id" "account_id" "create_time" "end_time" "external_id" "handler_id" "stream_id" "source" "top_match" "match_result" "face_detections" "body_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "tags" "user_data" "location" "mask" "liveness" "deepfake" "track_id" "body_basic_attributes" "upper_body" "lower_body" "accessories" "meta"
Example: target=create_time,event_id,face_detections

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.

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

Lower included bound for object create_time.

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

Upper bound for object create_time.

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

Lower included bound for object end_time.

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

Upper bound for object end_time.

sources
string
Example: sources=cam1,cam2,null

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

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

Comma-separated list of stream IDs or null.

cities
string
Example: cities=Moscow,New York,null

Comma-separated list of cities or null. Each event from result will contain one of given cities in "location" parameter.

areas
string
Example: areas=CAD,Manhattan,null

Comma-separated list of areas or null. Each event from result will contain one of given areas in "location" parameter.

districts
string
Example: districts=Mitino,Midtown,null

Comma-separated list of districts or null. Each event from result will contain one of given districts in "location" parameter.

streets
string
Example: streets=Arbat,West 48th street,null

Comma-separated list of streets or null. Each event from result will contain one of given streets in "location" parameter.

house_numbers
string
Example: house_numbers=1,220,null

Comma-separated list of house numbers or null. Each event from result will contain one of given house numbers in "location" parameter.

longitude (number) or null_filter (string)
Example: origin_longitude=36.616

Longitude origin in degrees, a part of composite geo position filter or null for undefined geo position. 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. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set.

latitude (number) or null_filter (string)
Example: origin_latitude=55.752

Latitude origin in degrees, a part of composite geo position filter or null for undefined geo position. 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. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set.

longitude_delta
number (longitude_delta) [ 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 - the default value is applied.

WARNING: Bounding 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.

NOTE: highly recommended for citywide use only.

latitude_delta
number (latitude_delta) [ 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 - the default value is applied.

WARNING: Bounding 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.

NOTE: highly recommended for citywide use only.

top_matching_candidates_label
string
Example: top_matching_candidates_label=matching_label

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

top_similar_object_ids
Array of strings (external_id) [ items <= 36 characters ]
Example: top_similar_object_ids=14159261415926

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

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

Comma-separated list of top similar external IDs. Each event from result will contain one of 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
Example: age__lt=50

Age upper excluded bound.

age__gte
integer
Example: age__gte=50

Age lower included bound.

integer or null_filter (string)
Example: gender=1

Gender. 1 - male, 0 - female, "null" - null value.

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

Comma-separated list of predominant emotions or null. 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
not set null
masks
string <list of integer and null (1, 2, 3, null)>
Example: masks=1,2,3,null

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

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

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

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

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

liveness value
spoof 0
real 1
unknown 2
not set null
deepfake
string <list of integer and null (0, 1, null)>
Example: deepfake=0,null

Comma-separated list of dominant deepfakes or null. Each event from result will contain one of the given deepfake.

deepfake value
fake 0
real 1
not set null
Array of integers or null_filter (string)
Example: apparent_gender=1

Comma-separated list of apparent gender: 0 - female, 1 - male, 2 - undefined, "null" - null value. Each event from result will contain one of the given states.

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

Apparent age lower included bound.

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

Apparent age upper excluded bound.

Array of integers or null_filter (string)
Example: headwear_states=1

Comma-separated list of headwear states: 0 - absent, 1 - present, 2 - undefined, "null" - null value. Each event from result will contain one of the given states.

Array of headwear_color (string) or null_filter (string)
Example: headwear_apparent_colors=white,undefined,null

Comma-separated list of headwear apparent colors or null value. Each event from result will contain one of the given states.

sleeve_lengths
Array of strings
Items Enum: "short" "long" "undefined" null
Example: sleeve_lengths=short,null

Comma-separated list of sleeve length states or null value. Each event from result will contain one of the given states.

Array of clothing_color (strings) or null_filter (string)
Example: upper_clothing_colors=black,white

Comma-separated list of upper clothing colors or null for not specified colors. Each event from result will contain at least one of the given clothing colors.

Array of clothing_color (strings) or null_filter (string)
Example: lower_garment_colors=black,white

Comma-separated list of lower garment colors. Each event from result will contain at least one of the given clothing colors.

lower_garment_types
Array of strings
Items Enum: "undefined" "trousers" "shorts" "skirt"
Example: lower_garment_types=trousers,undefined,null

Comma-separated list of lower garment types. Each event from result will contain one of the given types.

Array of shoes_color (string) or null_filter (string)
Example: shoes_apparent_colors=white,undefined,null

Comma-separated list of shoes apparent colors or null value. Each event from result will contain one of the given states.

Array of integers or null_filter (string)
Example: backpack_states=1
face_ids
string <list of uuid>
Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381

Comma-separated list of face IDs.

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

Comma-separated list of event IDs.

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

Event ID lower included bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time.

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

Event ID upper excluded bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time.

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

Comma-separated list of handler IDs.

external_ids
string
Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381

Comma-separated list of external IDs.

user_data
string
Example: user_data=user_data_text

Find all objects with user_data similar to this parameter. You can specify only part of the user_data value for this filter.

tags
Array of strings (tag) >= 0 items [ items <= 36 characters ]
Example: tags=tag_1,tag_2

Comma-separated list of tags. Each event from result will contain all of given tags. Each tag can be at most 36 characters.

string or null_filter (string)
Example: track_ids=track_id_number_1,track_id_number_2,null

Comma-separated list of track IDs. Each event from result will contain one of given track IDs. Each track ID can be at most 36 characters.

string or null_filter (string)
Example: meta.field_1__gt:numeric=36.6&meta.field_2.field_3__in=value,none&meta.field_4:integer=5

User-defined event meta's filters.

Parameter name pattern: meta.<path.to.field>__<operator>:<type>

Path to field is a dotted event meta's json field path.

Field comparison operator is optional one of eq (default), neq, like, nlike, in, nin, gt, gte, lt, lte.

Field data type is optional one of string (default), integer, numeric.

Allowed usage of filters is:

operator type
null string integer numeric
eq + + + +
neq + + + +
like - + - -
nlike - + - -
in + + + +
nin + + + +
gt - + + +
gte - + + +
lt - + + +
lte - + + +
order
string
Default: "desc"
Enum: "asc" "desc"

Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

params = {
    "age__lt": 90,
    "cities": "New York,Moscow",
    "track_ids": "There_and_Back_Again,Around_the_World",
    "emotions": "3,4,5,6,7",
}

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/events"

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

events options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get event

Get event by ID.

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

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
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
Array of strings (events_targets)
Items Enum: "event_id" "account_id" "create_time" "end_time" "external_id" "handler_id" "stream_id" "source" "top_match" "match_result" "face_detections" "body_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "tags" "user_data" "location" "mask" "liveness" "deepfake" "track_id" "body_basic_attributes" "upper_body" "lower_body" "accessories" "meta"
Example: target=create_time,event_id,face_detections

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

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/handlers"
payload = {
    "description": "non_dynamic_handler",
    "policies": {},
    "handler_type": 0,
}
handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

with open("image.jpg", "rb") as image_file:
    image = image_file.read()

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
    "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
}
url = f"{baseUri}/handlers/{handlerId}/events"

eventId = requests.post(
    url,
    headers=headers,
    data=image,
).json()["events"][0]["event_id"]

# We are waiting for the event to be created
time.sleep(5)

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/events/{eventId}"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "create_time": "2020-10-11T09:11:41.674Z",
  • "end_time": "2020-10-11T09:11:41.674Z",
  • "event_id": "bd6df8ea-1df2-449d-b8e3-d1d40b215dc8",
  • "handler_id": "791f002e-919c-459d-b766-cba9f4130853",
  • "face_id": "e88b8804-fedb-4dc3-8a59-171caf416571",
  • "account_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
  • "source": "3rd Avenue",
  • "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "top_match": {
    },
  • "match_result": [
    ],
  • "face_detections": [
    ],
  • "body_detections": [
    ],
  • "attach_result": [
    ],
  • "gender": 1,
  • "age": 27,
  • "emotion": 5,
  • "mask": 1,
  • "ethnic_group": 3,
  • "tags": [
    ],
  • "user_data": "people are strange",
  • "location": {
    },
  • "track_id": "e3ed4e18-2983-418d-879a-825e4517fc6c",
  • "body_basic_attributes": {
    },
  • "upper_body": {
    },
  • "lower_body": {
    },
  • "accessories": {
    },
  • "meta": {
    }
}

check if event exists

Check if event with event_id exists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
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
Array of strings (events_targets)
Items Enum: "event_id" "account_id" "create_time" "end_time" "external_id" "handler_id" "stream_id" "source" "top_match" "match_result" "face_detections" "body_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "tags" "user_data" "location" "mask" "liveness" "deepfake" "track_id" "body_basic_attributes" "upper_body" "lower_body" "accessories" "meta"
Example: target=create_time,event_id,face_detections

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

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/handlers"
payload = {
    "description": "non_dynamic_handler",
    "policies": {},
    "handler_type": 0,
}
handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

# emit event
with open("image.jpg", "rb") as image_file:
    image = image_file.read()

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
    "Content-Type": "image/jpeg",
    "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
}
url = f"{baseUri}/handlers/{handlerId}/events"

eventId = requests.post(
    url,
    headers=headers,
    data=image,
).json()["events"][0]["event_id"]

# We are waiting for the event to be created
time.sleep(5)

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/events/{eventId}"

response = requests.head(url, headers=headers)

print(response.status_code)

event options

Get options for the resource.

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.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

general events

get statistics on general events

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

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

Grouping by frequency or grouping by time intervals is available.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Array of objects 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 + - - - +
event_type + - - - +
event_create_time + + + - -
event_end_time + + + - -
track_id + - - - +
stream_id + - - - +
city + - - - +
area + - - - +
district + - - - +
street + - - - +
house_number + - - - +
geo_position + - - - -
event.* + + + + -
Array of objects >= 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 eq/neq null
account_id - + + + - -
event_id - + + + - -
event_type - + + - - +
track_id - + + - - +
stream_id - + + - - +
city - + + - - +
area - + + - - +
district - + + - - +
street - + + - - +
house_number - + + - - +
geo_position - - - - + +
event.* + + + + - -

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

Array of objects (periods) >= 0 items

Specifies the period of event creation. All the events created during this period will be included in the statistics.

You can set the start and end of the period or only one of the bounds.

Note! You can specify only one period!

group_by
string (group_by)

Enables you to group events by creation time according to one of two ways:

  1. Grouping by time intervals - number and dimension
Parameter value Description
1m one minute
2h two hours
7d seven days
5w five weeks
3M three months
10y ten years
  1. The frequency grouping - one of the following
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": [
    ]
}

general events statistics options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get general events

Get general events that satisfy filters.

Default filters for events:

  • event_create_time__lt - current date and time
  • event_create_time__gte - current date and time 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 (`event_create_time__gte`)
- upper create time boundary (`event_create_time__lt`)
Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
event_type
Array of strings[ items <= 36 characters ]
Example: event_type=my-shiny-event

Comma-separated list of general event types.

account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

event_create_time__gte
string <date-time> (time)
Example: event_create_time__gte=2018-08-11T09:11:41.674Z

Lower included bound for object create_time.

event_create_time__lt
string <date-time> (time)
Example: event_create_time__lt=2018-08-11T09:11:41.674Z

Upper bound for object create_time.

event_end_time__gte
string <date-time> (time)
Example: event_end_time__gte=2018-08-11T09:11:41.674Z

Lower included bound for object end_time.

event_end_time__lt
string <date-time> (time)
Example: event_end_time__lt=2018-08-11T09:11:41.674Z

Upper bound for object end_time.

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

Comma-separated list of event IDs.

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

Event ID lower included bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time.

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

Event ID upper excluded bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time.

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

Comma-separated list of stream IDs or null.

string or null_filter (string)
Example: track_ids=track_id_number_1,track_id_number_2,null

Comma-separated list of track IDs. Each event from result will contain one of given track IDs. Each track ID can be at most 36 characters.

cities
string
Example: cities=Moscow,New York,null

Comma-separated list of cities or null. Each event from result will contain one of given cities in "location" parameter.

areas
string
Example: areas=CAD,Manhattan,null

Comma-separated list of areas or null. Each event from result will contain one of given areas in "location" parameter.

districts
string
Example: districts=Mitino,Midtown,null

Comma-separated list of districts or null. Each event from result will contain one of given districts in "location" parameter.

streets
string
Example: streets=Arbat,West 48th street,null

Comma-separated list of streets or null. Each event from result will contain one of given streets in "location" parameter.

house_numbers
string
Example: house_numbers=1,220,null

Comma-separated list of house numbers or null. Each event from result will contain one of given house numbers in "location" parameter.

longitude (number) or null_filter (string)
Example: origin_longitude=36.616

Longitude origin in degrees, a part of composite geo position filter or null for undefined geo position. 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. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set.

latitude (number) or null_filter (string)
Example: origin_latitude=55.752

Latitude origin in degrees, a part of composite geo position filter or null for undefined geo position. 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. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set.

longitude_delta
number (longitude_delta) [ 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 - the default value is applied.

WARNING: Bounding 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.

NOTE: highly recommended for citywide use only.

latitude_delta
number (latitude_delta) [ 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 - the default value is applied.

WARNING: Bounding 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.

NOTE: highly recommended for citywide use only.

string or null_filter (string)
Example: event.field_1__gt:numeric=36.6&event.field_2.field_3__in=value,none&event.field_4:integer=5

User-defined general events event field's content filters.

Parameter name pattern: event.<path.to.field>__<operator>:<type>

Path to field is a general events event json field path. To navigate through nested objects the dot (.) is used.

Field comparison operator is optional one of eq (default), neq, like, nlike, in, nin, gt, gte, lt, lte.

Field data type is optional one of string (default), integer, numeric.

Allowed usage of filters is:

operator type
none string integer numeric
eq + + + +
neq + + + +
like - + - -
nlike - + - -
in + + + +
nin + + + +
gt - + + +
gte - + + +
lt - + + +
lte - + + +
order
string
Default: "desc"
Enum: "asc" "desc"

Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

curl --location --request GET 'http://127.0.0.1:5000/6/general/events?cities=New%20York,Moscow&track_ids=There_and_Back_Again,Around_the_World&event.foo=bar' \
--header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
--header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

Response samples

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

general events options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get general event

Get general event by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
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.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Response samples

Content type
application/json
{
  • "event_type": "my-shiny-event",
  • "event_create_time": "2020-10-11T09:11:41.674Z",
  • "event_end_time": "2020-10-11T09:11:41.674Z",
  • "event": {
    },
  • "account_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
}

check if event exists

Check if general event exists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
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.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

general event options

Get options for the resource.

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.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

task processing

clustering task

Create a clustering task.

The Filters section specifies which faces (or events) should be added to the cluster. The filters are combined with logical AND.

Available filters depend on the object type: events or faces.

You can receive a report about the finished clustering task using the reporter task.

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

Objects to be processed must belong to the user account making the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
object (clustering_task_content)

Clustering task content.

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 17
}

clustering options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

reporter task

Create a task report in CSV format.

Now the report is only created for clustering tasks.

The report contains additional information about clustering objects (faces or events). You can specify additional information that will be added to the report. The first and the second columns in the report always correspond to a cluster number and an object ID.

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results. The result is returned in ZIP archive, which contains a CSV file. If you set the save_images parameter, then the ZIP archive will also contain a folder with images.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

Objects to be processed must belong to the user account making the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
object (reporter_task_content)

Reporter task content.

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 17
}

reporter options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

exporter task

Collect event and/or face data and export them from LP to a CSV file. The file rows represent requested objects. Corresponding samples (if they were requested) are also returned.

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results. The result is returned in ZIP archive, which contains a CSV file. If you set the save_images parameter, then the ZIP archive will also contain a folder with images.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

Objects to be processed must belong to the user account making the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
any

Exporter task content.

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 31
}

exporter options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

linker task

Create a linker task.

The task enables you to attach faces to the specified list according to the filters.

You can use faces or events as objects for the task. When events are used, new face is created for each of the events.

A list is required for the task processing:

  • If you specified a list, the Tasks service checks its existence and displays an error if the list is not found.
  • If you set new list creation using create_list = 1, new list is created.

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

Objects to be processed must belong to the user account making the request.

If luna-image-store is disabled no subtask/task result will be stored.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
object (linker_task_content)

Linker task content.

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 29
}

linker options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

garbage collection task

Create a garbage collection task.

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

Objects to be processed must belong to the user account making the request.

WARNING: If you perform the task for faces with the remove_samples flag disabled, then the only way to delete samples is to execute the "remove face/body sample" resource.

If luna-image-store is disabled no subtask/task result will be stored.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
any (gc_task_content)

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 25
}

gc options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

cross-matching task

Create a cross-matching task.

The cross-matching task enables you to compare references (faces, attributes or events) with candidates (faces, attributes or events) according to the specified filters.

All the references are matched with all the candidates.

You can limit the number of candidates returned in matching results and set the minimum acceptable similarity threshold.

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

Objects to be processed must belong to the user account making the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
object (cross_match_task_content)

Cross match task content.

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 15
}

cross match options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

ROC-curve calculating task

Create a ROC-curve calculating task.

ROC (or Receiver Operating Characteristic) is a performance measurement for the classification problem at various threshold settings. The ROC-curve is plotted with TPR (True Positive Rate) against the FPR (False Positive Rate).

TPR is a true positive match pair count divided by a count of total expected positive match pairs, and FPR is a false positive match pair count divided by a count of total expected negative match pairs. Each point (FPR, TPR) of the ROC-cure corresponds to a certain similarity threshold.

The model performance is determined by looking at the area under the ROC-curve (or AUC), the ROC-curve and the secondary main diagonal intersection point, where type I and type II error rates are equal. The model performance is also determined by getting into the top-N probability, i.e. probability of getting a positive match pair into the top-N for any match result group sorted by similarity.

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

Objects to be processed must belong to the user account making the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
object (roc_task_content)

ROC-curve calculating task content.

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 14
}

roc options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

estimator task

Create an estimator task.

Task allows to process images using established policies. Policies can be specified in the request or use saved ones by passing the handler ID.

The resource can accept three types of sources with images for processing:

  • ZIP archive
  • S3-like storage
  • Network disk
  • FTP server
  • Samba

Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.

If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.

WARNING: Check handler storage_policy before a task start, notification_policy and event_policy enable by default.

Objects to be processed must belong to the user account making the request.

If luna-image-store is disabled no subtask/task result will be stored.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
object (estimator_task_content)

Estimator task content.

Responses

Request samples

Content type
application/json
Example
{
  • "description": "estimator task with zip archive",
  • "content": {
    },
  • "notification_policy": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 123
}

estimator options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

lambda task

Create new lambda task.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
object (notification_policy)

Tasks processing notification policy.

object (result_storage_policy)

tasks processing result storage policy

description
string (task_description) <= 128 characters

Task description.

required
object (lambda_task_content)

Lambda task content.

Responses

Request samples

Content type
application/json
{
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "task_id": 123
}

lambda task options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

task info

get tasks

Get tasks according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

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

Upper bound for object create_time.

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

Lower included bound for object create_time.

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

Upper bound for object end_time.

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

Lower included bound for object end_time.

task_ids
string <comma-separate task ids> (taskIds)
Example: task_ids=1,2,3

Comma-separated task IDs.

task_type
integer (task_type)
Enum: 0 1 2 3 4 5 6 7 8 9 10
Example: task_type=1

Task type.

task type value
unknown 0
linker 1
clusterization 2
report 3
garbage collection 4
additional extract 5
cross match 6
roc-curve calculation 7
export objects 8
estimate data 9
lambda task 10
task_status
integer (taskStatus)
Enum: 0 1 2 3 4 5
Example: task_status=1

Task status.

task status value
pending 0
in progress 1
cancelled 2
failed 3
collect results 4
done 5
schedule_id
integer (schedule_id) >= 1

Schedule according to which the task was created

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

params = {
    "task_id": taskId,
    "task_type": 4,
    "task_status": 5,
    "create_time__gte": "2018-08-11T09:11:41.674Z",
    "page": 1,
}

url = f"{baseUri}/tasks"
response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

tasks options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get tasks count

Count tasks according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
create_time__lt
string <date-time> (time)
Example: create_time__lt=2018-08-11T09:11:41.674Z

Upper bound for object create_time.

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

Lower included bound for object create_time.

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

Upper bound for object end_time.

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

Lower included bound for object end_time.

task_ids
string <comma-separate task ids> (taskIds)
Example: task_ids=1,2,3

Comma-separated task IDs.

task_type
integer (task_type)
Enum: 0 1 2 3 4 5 6 7 8 9 10
Example: task_type=1

Task type.

task type value
unknown 0
linker 1
clusterization 2
report 3
garbage collection 4
additional extract 5
cross match 6
roc-curve calculation 7
export objects 8
estimate data 9
lambda task 10
task_status
integer (taskStatus)
Enum: 0 1 2 3 4 5
Example: task_status=1

Task status.

task status value
pending 0
in progress 1
cancelled 2
failed 3
collect results 4
done 5
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

schedule_id
integer (schedule_id) >= 1

Schedule according to which the task was created

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

params = {
    "task_id": taskId,
    "task_type": 4,
    "task_status": 5,
    "create_time__gte": "2018-08-11T09:11:41.674Z",
    "page": 1,
}

url = f"{baseUri}/tasks/count"
response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "count": 13
}

tasks count options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get task

Get task by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/tasks/{taskId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "task_id": 13,
  • "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "end_time": "2018-08-11T10:11:41.674Z",
  • "last_update_time": "2018-08-11T10:11:41.674Z",
  • "task_type": 1,
  • "task_status": 5,
  • "result_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "count_task_parts_done": 10,
  • "count_task_parts_all": 10,
  • "content": {
    },
  • "notification_policy": {
    },
  • "result_storage_policy": {
    },
  • "description": "task description"
}

cancel task

Cancel task by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/tasks/{taskId}"
response = requests.patch(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
{}

delete task

Delete a task and the task results by the task ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/tasks/{taskId}"
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
Example
{}

task options

Get options for the resource.

path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get task result

Get task result by the task ID.

In addition to the result of the task, the occurred errors can be returned in the response.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

# wait for tasks to complete
time.sleep(5)

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/tasks/{taskId}/result"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
Example
{
  • "result": [
    ],
  • "errors": [ ]
}

task result options

Get options for the resource.

path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get subtasks

Get subtasks of a task by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

# wait for tasks to complete
time.sleep(5)

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/tasks/{taskId}/subtasks"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

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

subtasks options

Get options for the resource.

path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

tasks notification policy

get task notification policy

Get task notification policy by task ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/gc"
payload = {"content": {"target": "events"}}
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/tasks/{taskId}/notification_policy"
response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "enable": 0,
  • "task_callbacks": [
    ],
  • "subtask_callbacks": [
    ]
}

replace task notification policy

Replace task notification policy by task ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
enable
integer
Default: 0
Enum: 0 1

Whether callbacks enabled or not.

Array of any (task_callbacks)

Callbacks for sending tasks id and status to third party system. Callbacks are executed after task status changed.

Sample Output for successful task

{
  "task_id": 123, 
  "task_status": "done", 
  "result_id": "00000000-0000-4000-a000-000000658854",
  "result_url": "http://127.0.0.1:5000/6/tasks/00000000-0000-4000-a000-000000658854/result"
}

Sample Output for failed task

{"task_id": 123, "task_status": "failed"}

Sample Output for cancelled task

{"task_id": 123, "task_status": "cancelled"}
Array of any (subtask_callbacks)

Callbacks for sending subtasks id, status and number of completed subtasks to third party system. Callbacks are executed after task status changed.

Sample Output for start subtask

{"subtask_id": 123, "subtask_status": "in_progress", "completed_subtasks": 0}

Sample Output for successful subtask

{"subtask_id": 123, "subtask_status": "done", "completed_subtasks": 1}

Sample Output for failed subtask

{"subtask_id": 123, "subtask_status": "failed", "completed_subtasks": 0}

Sample Output for cancelled subtask

{"subtask_id": 123, "subtask_status": "cancelled", "completed_subtasks": 0}

Responses

Request samples

Content type
application/json
{
  • "enable": 0,
  • "task_callbacks": [
    ],
  • "subtask_callbacks": [
    ]
}

Response samples

Content type
application/json
Example
{}

tasks notification policy options

Get options for the resource.

path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

task errors

get task errors

Get errors of a task by the task ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time
from uuid import uuid4

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

payload = {
    "description": "matching famous people with customers",
    "content": {
        "markup": [
            {"face_id": str(uuid4()), "label": 1},
            {"face_id": str(uuid4()), "label": 2},
        ],
    },
}

url = f"{baseUri}/tasks/roc"
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

# wait for tasks to complete
time.sleep(5)

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

url = f"{baseUri}/tasks/{taskId}/errors"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{}

task errors options

Get options for the resource.

path Parameters
task_id
required
integer (task_id) >= 1
Example: 123

Task ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get errors

Get errors according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

task_ids
string <comma-separate task ids> (taskIds)
Example: task_ids=1,2,3

Comma-separated task IDs.

error_code
integer (error_code)

Error code.

error_ids
string <comma-separate task ids> (errorIds) non-empty
Example: error_ids=4,5,6

Comma-separated error IDs.

error_time__lt
string <date-time> (time)
Example: error_time__lt=2018-08-11T09:11:41.674Z

Upper bound for object error_time.

error_time__gte
string <date-time> (time)
Example: error_time__gte=2018-08-11T09:11:41.674Z

Lower included bound for object error_time.

task_type
integer (task_type)
Enum: 0 1 2 3 4 5 6 7 8 9 10
Example: task_type=1

Task type.

task type value
unknown 0
linker 1
clusterization 2
report 3
garbage collection 4
additional extract 5
cross match 6
roc-curve calculation 7
export objects 8
estimate data 9
lambda task 10
status_code
integer (status_code) [ 400 .. 599 ]
Example: status_code=500

HTTP status code.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time
from uuid import uuid4

baseUri = "http://127.0.0.1:5000/6"

# create bad task
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "description": "matching famous people with customers",
    "content": {
        "markup": [
            {"face_id": str(uuid4()), "label": 1},
            {"face_id": str(uuid4()), "label": 2},
        ],
    },
}
url = f"{baseUri}/tasks/roc"
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

# wait for tasks to complete
time.sleep(5)

# get tasks error id list
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/{taskId}/errors"
response = requests.get(url, headers=headers)
errorIds = [
    str(error["error_id"]) for error in response.json()["errors"]
]

# get error according to the filters
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "errors": [
        {
            "error_id": ",".join(errorIds),
            "task_id": taskId,
            "error_time__gte": "2018-08-11T09:11:41.674Z",
        }
    ]
}

url = f"{baseUri}/tasks/errors"
response = requests.get(url, headers=headers, json=payload)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{}

errors options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get errors count

Count errors according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

error_time__lt
string <date-time> (time)
Example: error_time__lt=2018-08-11T09:11:41.674Z

Upper bound for object error_time.

error_time__gte
string <date-time> (time)
Example: error_time__gte=2018-08-11T09:11:41.674Z

Lower included bound for object error_time.

task_type
integer (task_type)
Enum: 0 1 2 3 4 5 6 7 8 9 10
Example: task_type=1

Task type.

task type value
unknown 0
linker 1
clusterization 2
report 3
garbage collection 4
additional extract 5
cross match 6
roc-curve calculation 7
export objects 8
estimate data 9
lambda task 10
status_code
integer (status_code) [ 400 .. 599 ]
Example: status_code=500

HTTP status code.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time
from uuid import uuid4

baseUri = "http://127.0.0.1:5000/6"

# create bad task
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "description": "matching famous people with customers",
    "content": {
        "markup": [
            {"face_id": str(uuid4()), "label": 1},
            {"face_id": str(uuid4()), "label": 2},
        ],
    },
}
url = f"{baseUri}/tasks/roc"
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

# wait for tasks to complete
time.sleep(5)

# get tasks error id list
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/{taskId}/errors"
response = requests.get(url, headers=headers)
errorIds = [
    str(error["error_id"]) for error in response.json()["errors"]
]

# get error count
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "errors": [
        {
            "error_id": ",".join(errorIds),
            "task_id": taskId,
            "error_time__gte": "2018-08-11T09:11:41.674Z",
        }
    ]
}

url = f"{baseUri}/tasks/errors/count"
response = requests.get(url, headers=headers, json=payload)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "count": 18
}

task errors count options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get error

Get error by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
error_id
required
integer >= 1

Error ID.

query Parameters
error_id
integer (errorId)
Example: error_id=10

Error ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests
import time
from uuid import uuid4

baseUri = "http://127.0.0.1:5000/6"

# create bad task
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "description": "matching famous people with customers",
    "content": {
        "markup": [
            {"face_id": str(uuid4()), "label": 1},
            {"face_id": str(uuid4()), "label": 2},
        ],
    },
}
url = f"{baseUri}/tasks/roc"
taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

# wait for tasks to complete
time.sleep(5)

# get tasks error id list
headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/{taskId}/errors"
response = requests.get(url, headers=headers)
errorId = [
    str(error["error_id"]) for error in response.json()["errors"]
][0]

url = f"{baseUri}/tasks/errors/{errorId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{}

error options

Get options for the resource.

path Parameters
error_id
required
integer >= 1

Error ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

task schedules

create tasks schedule

Create a new task schedule.

Execution of scheduled tasks will be regulated according to the trigger and optionally starts one task immediately (see start_immediately parameter in behavior section).

No task from the schedule will be executed if the previous task has not yet been completed.

Permissions for task objects.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
required
any (task_schedulable)

Task schedule.

required
object (schedule_trigger)

Task schedule trigger.

object (schedule_behaviour)

Schedule behaviour parameters.

Responses

Request samples

Content type
application/json
Example
{
  • "task": {
    },
  • "trigger": {
    },
  • "behaviour": {
    }
}

Response samples

Content type
application/json
{
  • "schedule_id": 1
}

get tasks schedules

Get tasks schedules with filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

task_type
integer (task_type_schedulable_reply)
Enum: 1 2 3 4 5 6 7 8 9 10
Example: task_type=1

Task type.

Task type Value
Linker 1
Clusterization 2
Report 3
Garbage collection 4
Additional extract 5
Cross match 6
Roc-curve calculation 7
Export objects 8
estimator 9
lambda 10
create_time__lt
string <date-time> (time)
Example: create_time__lt=2018-08-11T09:11:41.674Z

Upper bound for object create_time.

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

Lower included bound for object create_time.

account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
params = {
        "create_time__lt": "2018-08-11T09:11:41.674Z", 
        "create_time_gte": "2050-08-11T09:11:41.674Z",
        "task_type": 1,
}
url = f"{baseUri}/tasks/schedules"
response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
[
  • {
    }
]

schedules options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get tasks schedule

Get tasks schedule by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
schedule_id
required
integer (schedule_id) >= 1

Schedule according to which the task was created

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

payload = {
    "task": {
        "task_type": 1,
        "content": {
            "create_list": 1,
            "objects_type": "faces",
            "filters": {
                "create_time__gte": "2018-08-11T09:11:41.674Z"
            },
        },
    },
    "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
    "behaviour": {"start_immediately": False, "create_stopped": False}
    
}

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/schedules"
response = requests.post(url, headers=headers, json=payload)
scheduleId = response.json()["schedule_id"]

url = f"{baseUri}/tasks/schedules/{scheduleId}"
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "schedule_id": 1,
  • "task_ids": [
    ],
  • "account_id": "string",
  • "task": {
    },
  • "trigger": {
    },
  • "status": "running",
  • "next_run_time": "2018-08-11T09:11:41.674Z",
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "last_update_time": "2018-08-11T09:11:41.674Z"
}

replace tasks schedule

Replace tasks schedule:

  • if any task created by old schedule is running, it will be cancelled

  • schedule parameters will be replaced with the new ones

  • tasks will be executed according to the new schedule

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
schedule_id
required
integer (schedule_id) >= 1

Schedule according to which the task was created

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
required
any (task_schedulable)

Task schedule.

required
object (schedule_trigger)

Task schedule trigger.

object (schedule_behaviour)

Schedule behaviour parameters.

Responses

Request samples

Content type
application/json
{
  • "task": {
    },
  • "trigger": {
    },
  • "behaviour": {
    }
}

Response samples

Content type
application/json
{
  • "schedule_id": 1
}

patch tasks schedule

Pause/start tasks schedule.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
schedule_id
required
integer (schedule_id) >= 1

Schedule according to which the task was created

query Parameters
action
required
string
Enum: "pause" "start"

Pause/start tasks schedule.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

# create list
url = f"{baseUri}/lists"
listId = requests.post(url, headers=headers).json()["list_id"]

# create face
url = f"{baseUri}/faces"
faceId = requests.post(url, headers=headers).json()["face_id"]

payload = {
    "task": {
        "task_type": 1,
        "content": {
            "create_list": 0,
            "objects_type": "faces",
            "list_id": listId,
            "filters": {
                "face_ids": [faceId],
            },
        },
    },
    "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
    "behaviour": {"start_immediately": False, "create_stopped": False}

}

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/schedules"
response = requests.post(url, headers=headers, json=payload)
scheduleId = response.json()["schedule_id"]

# Patch schedule
params = {"action": "pause"}
response = requests.patch(url + f"/{scheduleId}", headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{}

delete tasks schedule

Delete tasks schedule.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
schedule_id
required
integer (schedule_id) >= 1

Schedule according to which the task was created

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}

# create list
url = f"{baseUri}/lists"
listId = requests.post(url, headers=headers).json()["list_id"]

# create face
url = f"{baseUri}/faces"
faceId = requests.post(url, headers=headers).json()["face_id"]

payload = {
    "task": {
        "task_type": 1,
        "content": {
            "create_list": 0,
            "objects_type": "faces",
            "list_id": listId,
            "filters": {
                "face_ids": [faceId],
            },
        },
    },
    "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
    "behaviour": {"start_immediately": False, "create_stopped": False}

}

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/tasks/schedules"
response = requests.post(url, headers=headers, json=payload)
scheduleId = response.json()["schedule_id"]

# Delete schedule
payload = {"action": "pause"}
response = requests.delete(url + f"/{scheduleId}", headers=headers, json=payload)

print(response.status_code)

Response samples

Content type
application/json
{}

schedule options

Get options for the resource.

path Parameters
schedule_id
required
integer (schedule_id) >= 1

Schedule according to which the task was created

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

verifiers

create verifier

Create a verifier.

The verifier determines a list of rules for processing and verification of input images.

You can set:

  • verification_threshold
  • detect_policy
  • extract_policy
  • storage_policy for attributes and face samples.

The created handler can be used in "raw verification" and "perform verification" requests.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
description
string <= 128 characters

Verifier user description.

object

Responses

Request samples

Content type
application/json
{
  • "description": "strict verifier",
  • "policies": {
    }
}

Response samples

Content type
application/json
{}

get verifiers

Get verifiers by filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

description
string

Records with descriptions similar to this parameter will be processed.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/verifiers"

payload = {
    "description": "new verifier",
    "policies": {
        "verification_threshold": 0.5,
        "detect_policy": {
            "estimate_mask": 1
        },
        "extract_policy": {
            "extract_basic_attributes": 1
        },
        "storage_policy": {
            "attribute_policy": {
                "store_attribute": 1
            },
            "face_sample_policy": {
                "store_sample": 1,
                "ttl": 7
            }
        }
    }
}

# create verifier
requests.post(url, json=payload, headers=headers)

# get verifiers
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

verifiers options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

raw verification

This request performs verification of input descriptors.

"Similarity" and "verification status" are returned for each candidate.

"Verification status" is "True" if the received similarity is greater than the verification_threshold (specified in the verifier handler). Hence, the reference and the candidate are considered the same person.

You should specify descriptors as references and candidates for this request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

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

Format of a request body data.

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Request Body schema:
required
Array of xpk_file_entity_base64 (object) or sdk_descriptor_entity_base64 (object) or raw_descriptor_entity_base64 (object) non-empty

Reference list for verification.

required
Array of xpk_file_entity_base64 (object) or sdk_descriptor_entity_base64 (object) or raw_descriptor_entity_base64 (object) non-empty

Candidates for verification.

Responses

Request samples

Content type
{
  • "references": [
    ],
  • "candidates": [
    ]
}

Response samples

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

raw verification options

Get options for the resource.

path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

perform verification

Verify given images and/or descriptors against specified objects set: faces IDs, events IDs, external IDs.

"Similarity" and "verification status" are returned for each candidate.

"Verification status" is "True" if the received similarity is greater than the verification_threshold (specified in the verifier handler). Hence, the reference and the candidate are considered the same person.

The input images are processed according to the specified policies and the received information is returned in the response.

Objects to be processed must belong to the user account making the request.

Notes for incoming data:

  • face or body bounding boxes passed with face or body warped image will be ignored.
Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
verifier_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

Verifier ID.

query Parameters
face_ids
string <list of uuid>
Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381

Comma-separated list of face IDs.

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

Comma-separated list of event IDs.

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

Comma-separated list of attribute IDs.

external_ids
string
Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381

Comma-separated list of external IDs.

image_type
integer
Default: 0
Enum: 0 1

Image type of input image. 0 - raw image, 1 - face warped image.

use_exif_info
integer
Default: 1
Enum: 0 1
Example: use_exif_info=1

Whether to try to auto orient image based on EXIF data.

The processed image should have EXIF data, otherwise auto orientation will not be performed.

Has no effect with tiff images (they're always auto oriented).

Ignored with warped images (see warped_image or image_type parameter).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" "application/x-sdk-descriptor" "application/x-sdk-descriptor-base64" "application/x-vl-xpk" "application/x-vl-xpk-base64"
Request Body schema:
string <binary>

Responses

Request samples

Content type
No sample

Response samples

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

verification options

Get options for the resource.

path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

count verifiers

Count verifiers that satisfy the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

description
string

Records with descriptions similar to this parameter will be processed.

header Parameters
Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/verifiers"

payload = {
    "description": "new verifier",
    "policies": {
        "verification_threshold": 0.5,
        "detect_policy": {
            "estimate_mask": 1
        },
        "extract_policy": {
            "extract_basic_attributes": 1
        },
        "storage_policy": {
            "attribute_policy": {
                "store_attribute": 1
            },
            "face_sample_policy": {
                "store_sample": 1,
                "ttl": 7
            }
        }
    }
}

# create verifier
requests.post(url, json=payload, headers=headers)

url = f"{url}/count"

# get verifiers count
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "verifiers_count": 4
}

count verifiers options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get verifier

Get verifier by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/verifiers"

payload = {
    "description": "new verifier",
    "policies": {
        "verification_threshold": 0.5,
        "detect_policy": {
            "estimate_mask": 1
        },
        "extract_policy": {
            "extract_basic_attributes": 1
        },
        "storage_policy": {
            "attribute_policy": {
                "store_attribute": 1
            },
            "face_sample_policy": {
                "store_sample": 1,
                "ttl": 7
            }
        }
    }
}

# create verifier
response = requests.post(url, json=payload, headers=headers)
verifierId = response.json()["verifier_id"]

url = f"{url}/{verifierId}"

# get verifier
response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "verifier_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
  • "description": "simple verifier",
  • "policies": {
    },
  • "create_time": "2019-08-24T14:15:22Z",
  • "last_update_time": "2019-08-24T14:15:22Z",
  • "version": 111
}

replace verifier

Update the verifier. You can not update a part of verifier, so you should specify all the fields for your handler.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
description
string <= 128 characters

Verifier user description.

object

Responses

Request samples

Content type
application/json
{
  • "description": "strict verifier",
  • "policies": {
    }
}

Response samples

Content type
application/json
{
  • "version": 111
}

check if verifier exists

Check if verifier with verifier_id exists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/verifiers"

payload = {
    "description": "new verifier",
    "policies": {
        "verification_threshold": 0.5,
        "detect_policy": {
            "estimate_mask": 1
        },
        "extract_policy": {
            "extract_basic_attributes": 1
        },
        "storage_policy": {
            "attribute_policy": {
                "store_attribute": 1
            },
            "face_sample_policy": {
                "store_sample": 1,
                "ttl": 7
            }
        }
    }
}

# create verifier
response = requests.post(url, json=payload, headers=headers)
verifierId = response.json()["verifier_id"]

url = f"{url}/{verifierId}"

# check verifier
response = requests.head(url, headers=headers)

print(response.status_code)

remove verifier

Remove verifier by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

url = f"{baseUri}/verifiers"

payload = {
    "description": "new verifier",
    "policies": {
        "verification_threshold": 0.5,
        "detect_policy": {
            "estimate_mask": 1
        },
        "extract_policy": {
            "extract_basic_attributes": 1
        },
        "storage_policy": {
            "attribute_policy": {
                "store_attribute": 1
            },
            "face_sample_policy": {
                "store_sample": 1,
                "ttl": 7
            }
        }
    }
}

# create verifier
response = requests.post(url, json=payload, headers=headers)
verifierId = response.json()["verifier_id"]

url = f"{url}/{verifierId}"

# delete verifier
response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
{}

verifier options

Get options for the resource.

path Parameters
verifier_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

Verifier ID.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

ws

ws handshake

Ws handshake.

Attention!

Subscription to events occurs via WebSocket. Messages sent by ws you can view in callback section. Connection supports autoping.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
sources
string
Example: sources=cam1,cam2

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

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

Comma-separated list of stream IDs.

matching_candidates_labels
string
Example: matching_candidates_labels=matching_label_1,matching_label_2

Comma-separated list of matching candidates label. Each event from result will contain one or more given labels.

object_similarity__gte
number
Example: object_similarity__gte=0.5

Object similarity lower included bound (boundary for top matching candidate).

object_similarity__lt
number
Example: object_similarity__lt=0.5

Object similarity upper excluded bound (boundary for top matching candidate).

age__lt
integer
Example: age__lt=50

Age upper excluded bound.

age__gte
integer
Example: age__gte=50

Age lower included bound.

gender
integer
Enum: 0 1
Example: gender=1

Gender. 1 - male, 0 - female.

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
deepfake
string <list of integer(0, 1)>
Example: deepfake=0,1

Comma-separated list of dominant deepfakes. Each event from result will contain one of the given deepfake.

deepfake value
fake 0
real 1
tags
Array of strings (tag) >= 0 items [ items <= 36 characters ]
Example: tags=tag_1,tag_2

Comma-separated list of tags. Each event from result will contain all of given tags. Each tag can be at most 36 characters.

user_data
string
Example: user_data=user_data_text

Find all objects with user_data similar to this parameter. You can specify only part of the user_data value for this filter.

object
Example: geo_position=origin_longitude,36.616,origin_latitude,55.752

Geo position filter, i.e. geo bounding box specified by coordinates of its center (origin) and some delta. Each event from result will be covered by bbox specified.

cities
string
Example: cities=Moscow,New York

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

areas
string
Example: areas=CAD,Manhattan

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

districts
string
Example: districts=Mitino,Midtown

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

streets
string
Example: streets=Arbat,West 48th street

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

house_numbers
string
Example: house_numbers=1,220

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

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

Comma-separated list of handler IDs.

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
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
apparent_gender
Array of integers
Items Enum: 0 1 2
Example: apparent_gender=1

Comma-separated list of apparent gender: 0 - female, 1 - male, 2 - undefined. Each event from result will contain one of the given states.

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

Apparent age lower included bound.

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

Apparent age upper excluded bound.

headwear_states
Array of integers
Items Enum: 0 1 2
Example: headwear_states=1

Comma-separated list of headwear states: 0 - absent, 1 - present, 2 - undefined. Each event from result will contain one of the given states.

headwear_apparent_colors
Array of strings (headwear_color)
Items Enum: "undefined" "black" "white" "other"
Example: headwear_apparent_colors=white,undefined

Comma-separated list of headwear apparent colors. Each event from result will contain one of the given states.

sleeve_lengths
Array of strings
Items Enum: "short" "long" "undefined"
Example: sleeve_lengths=short,undefined

Comma-separated list of sleeve length states. Each event from result will contain one of the given states.

upper_clothing_colors
Array of strings (clothing_color)
Items Enum: "undefined" "black" "blue" "green" "gray" "orange" "purple" "red" "white" "yellow" "pink" "brown" "beige" "khaki" "multicolored"
Example: upper_clothing_colors=black,white

Comma-separated list of upper clothing colors. Each event from result will contain at least one of the given clothing colors.

lower_garment_colors
Array of strings (clothing_color)
Items Enum: "undefined" "black" "blue" "green" "gray" "orange" "purple" "red" "white" "yellow" "pink" "brown" "beige" "khaki" "multicolored"
Example: lower_garment_colors=black,white

Comma-separated list of lower garment colors. Each event from result will contain at least one of the given clothing colors.

lower_garment_types
Array of strings
Items Enum: "undefined" "trousers" "shorts" "skirt"
Example: lower_garment_types=trousers,undefined

Comma-separated list of lower garment types. Each event from result will contain one of the given types.

shoes_apparent_colors
Array of strings (shoes_color)
Items Enum: "undefined" "black" "white" "other"
Example: shoes_apparent_colors=white,undefined

Comma-separated list of shoes apparent colors. Each event from result will contain one of the given states.

backpack_states
Array of integers
Items Enum: 0 1 2
Example: backpack_states=1
header Parameters
Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

from luna3.lunavl.httpclient import LunaHttpClient

EXPECTED_EVENT_COUNT = 1

client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna")
with client.wsConnect() as ws:
    for _ in range(EXPECTED_EVENT_COUNT):
        WS_RESP = ws.recv()
        print(WS_RESP)

Response samples

Content type
application/json
{
  • "event": {
    },
  • "handler_id": "88c5dd7e-693b-4386-92bc-0c31a150a7d0",
  • "event-create-time": "2021-06-18T02:44:58.653485+03:00",
  • "event-end-time": "2021-06-18T02:44:58.653485+03:00",
  • "Luna-Request-id": "1623984298,375c6d96-09c7-4db3-91cc-f13e66288aa9"
}

ws handshake for general events [beta]

Ws handshake.

Attention!

Subscription to events occurs via WebSocket. Messages sent by ws you can view in callback section. Connection supports autoping.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
event_type
string <list of strings (some_event_type_1, some_event_type_1)>
Example: event_type=some_event_type_1,some_event_type_1

Comma-separated list of general event types to subscribe.

account_id
string
Example: account_id=8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

General event account to subscribe.

* (event.path.to.field__operator:type)
string
Example: event.field_1__gt:numeric=36.6&event.field_2.field_3__in=value,none&event.field_4:integer=5

User-defined general event filters.

Parameter name pattern: event.<path.to.field>__<operator>:<type>

Path to field is an event json field path. To navigate through nested objects the dot (.) is used.

Field comparison operator is optional one of eq (default), neq, like, nlike, in, nin, gt, gte, lt, lte.

Field data type is optional one of string (default), integer, numeric.

Allowed usage of filters is:

operator type
none string integer numeric
eq + + + +
neq + + + +
like - + - -
nlike - + - -
in + + + +
nin + + + +
gt - + + +
gte - + + +
lt - + + +
lte - + + +
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

from luna3.lunavl.httpclient import LunaHttpClient

client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna")
with client.generalConnect() as ws:
    for _ in range(3):
        WS_RESP = ws.recv()
        print(WS_RESP)

Response samples

Content type
application/json
{
  • "event": { },
  • "event_type": "string",
  • "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
  • "event-create-time": "2019-08-24T14:15:22Z",
  • "event-end-time": "2019-08-24T14:15:22Z"
}

login

set login cookie

Set login cookie.

Authorizations:
BearerAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
Example
{}

clear login cookie

Clear login cookie.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

login cookie options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

liveness

predict liveness

Predict liveness probability in input images.

The response contains the probability that there is a real person in the image, and it is not a presentation attack.

"meta" and "x_meta" sections of the request are used for backward compatibility and are deprecated now.

The incoming images should correspond the requirements of the utilized Liveness version. See "Administrator’s manual" for details.

Liveness estimation is not supported for samples (warped images).

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
aggregate
integer
Default: 0
Enum: 1 0
Example: aggregate=1

Whether to aggregate liveness estimations.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64"
Request Body schema:
object (LivenessMeta)
Deprecated

Device information. This information can significantly decrease the overall error rate.

The "meta" object is not mandatory. If you are not sure about any of the parameters, set "UNKNOWN" value or don't pass meta.

The specified meta is applied to all the images within the request.

x_meta
object
Deprecated

The JSON string with any additional information.

required
Array of image_binary_for_multipart (string) or image_base64_for_multipart (string) (image_list_for_multipart) non-empty

Responses

Request samples

Content type
No sample

Response samples

Content type
application/json
{}

liveness options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

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 is text/html.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the 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
{}

get openapi documentation options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

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^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get development documentation options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

config

get service configuration

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

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

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

Acceptable type of receiving data.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/config"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
{
  • "INFLUX_MONITORING": {
    }
}

get config options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

features

get platform features

Get information about platform features:

  • relevance of the license (license)
  • enabled estimations (estimations)
  • enabled modules (components)
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
"Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}
url = f"{baseUri}/features"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "license": true,
  • "estimations": {
    },
  • "components": {
    }
}

features options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

plugins

get list of plugins

Get list of service plugins:

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
"Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
}
url = f"{baseUri}/plugins"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

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

plugins options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

lambda [beta]

create lambda

Create a new lambda.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
required
string
Value: "multipart/form-data"

The request content type header.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: multipart/form-data
archive
required
string <binary>

Archive file with zip extension. Content-Type must be "application/zip".

required
object

Lambda credentials. Content-Type must be "application/json".

object

Parameters for lambda. Content-Type must be "application/json".

object (deploy_parameters)

Deploy parameters for lambda. Content-Type must be "application/json".

Responses

Request samples

# This example is written using requests library
from time import sleep
import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}
lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
namespace = "default"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps(
                {"lambda_name": lambdaName, "description": "test description"}
            ), "application/json"),
        "parameters": (
            "parameters",
            json.dumps(
                {"lambda_type": "standalone"}
            ), "application/json"),
    }

response = requests.post(url, headers=headers, files=files)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "lambda_id": "string"
}

get lambdas

Get lambdas according to filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Upper bound for object create_time.

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

Lower included bound for object create_time.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

lambda_type
string
Enum: "standalone" "handlers" "tasks"

Lambda type.

namespace
Array of strings (namespace)
Example: namespace=default,no-default-namespace

Comma-separated list of lambda namespaces. Each namespace must match the pattern ^[a-z0-9][a-z0-9-]*[a-z0-9]$

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

from datetime import datetime, timedelta
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}
accountId = "00000000-0000-4000-a000-000000000156"
lambdaId = str(uuid4())
lambdaName = str(uuid4())
timeDelta = timedelta(days=1)
namespace = "default"
params = {
    "account_id": accountId,
    "create_time__lt": datetime.utcnow().isoformat("T") + "Z",
    "create_time__gte": (datetime.utcnow() - timeDelta).isoformat("T") + "Z",
    "page": 1,
    "page_size": 100,
    "lambda_type": "standalone",
    "namespace": namespace
}
url = f"{baseUri}/lambdas/"

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

validation lambda

Validate lambda.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
required
string
Value: "multipart/form-data"

The request content type header.

Request Body schema: application/zip
archive
required
string <binary>

Archive file with zip extension. Content-Type must be "application/zip".

required
object

Parameters for lambda.

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}
url = f"{baseUri}/lambdas/validator"

with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "parameters": (
            "parameters",
            json.dumps({"lambda_type": "standalone"}),
            "application/json",
        )
    }

response = requests.post(url, headers=headers, files=files)

print(response.status_code)

Response samples

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

put lambda

Update lambda. You cannot update a part of the lambda, so you should specify all the fields for your lambda.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
required
string
Value: "multipart/form-data"

The request content type header.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: multipart/form-data
archive
required
string <binary>

Archive file with zip extension. Content-Type must be "application/zip".

required
object

Lambda credentials. Content-Type must be "application/json".

object

Parameters for lambda. Content-Type must be "application/json".

object (deploy_parameters)

Deploy parameters for lambda. Content-Type must be "application/json".

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps(
                {"lambda_name": str(uuid4()), "description": "new lambda description"}
            ), "application/json"),
        "parameters": (
            "parameters",
            json.dumps(
                {"lambda_type": "standalone"}
            ), "application/json"),
    }
response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Put lambda

files.update(
    {
      "credentials": (
            "credentials",
            json.dumps(
                {"lambda_name": str(uuid4()), "description": "new lambda description"}
            ), "application/json") 
    }
)
response = requests.put(url + lambdaId, headers=headers, files=files)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "version": 0
}

patch lambda

Patch lambda.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

The request content type header.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Request Body schema: application/json
non-empty
lambda_name
string (lambda_name)

Lambda name. Each user can create only lambdas with unique names.

description
string <= 256 characters

Lambda description.

Responses

Request samples

Content type
application/json
{
  • "lambda_name": "first-lambda",
  • "description": "very useful lambda"
}

Response samples

Content type
application/json
Example
{}

get lambda

Get lambda by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import json

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}
lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f"
url = f"{baseUri}/lambdas/{lambdaId}"
params = {
    "account_id": "00000000-0000-4000-a000-000000000156",
}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "account_id": "string",
  • "lambda_id": "string",
  • "lambda_name": "first-lambda",
  • "description": "very useful lambda",
  • "version": 1,
  • "info": {
    },
  • "lambda_type": "standalone",
  • "create_time": "2019-08-24T14:15:22Z",
  • "last_update_time": "2018-08-11T09:11:41.674Z",
  • "additional_user_docker_commands": [ ],
  • "base_image": {
    },
  • "workers": 1,
  • "archive_ttl": 7,
  • "deploy_parameters": {
    }
}

check lambda existence

Check existence of the lambda by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}
lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f"
url = f"{baseUri}/lambdas/{lambdaId}"

response = requests.head(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
{}

delete lambda

Remove lambda by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import requests
import json
from uuid import uuid4


baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps(
                {"lambda_name": lambdaName, "description": "lambda description"}
            ), "application/json"),
        "parameters": (
            "parameters",
            json.dumps(
                {"lambda_type": "standalone"}
            ), "application/json"),
    }
response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Delete lambda

url = f"{baseUri}/lambdas/{lambdaId}"

response = requests.delete(url, headers=headers)

print(response.status_code)

Response samples

Content type
application/json
{}

update lambda

Update lambda using latest base image.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the plugin.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps(
                {"lambda_name": lambdaName, "description": "lambda description"}
            ), "application/json"),
        "parameters": (
            "parameters",
            json.dumps(
                {"lambda_type": "standalone"}
            ), "application/json"),
    }
response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Update lambda

url = f"{baseUri}/lambdas/{lambdaId}/update"
response = requests.post(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "version": 0
}

get lambda image creation status

Get lambda image creation status by lambda ID.

If lambda image creation is in progress, lambda status will be waiting.

After lambda image creation will end, the lambda image creation job will be removed and status will be not_found.

For more information about lambda and lambda images statuses see development manual.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
            "application/json",
        ),
        "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
    }

response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Get lambda image creation status

url = f"{baseUri}/lambdas/{lambdaId}/image/status"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "not_found"
}

get lambda image creation logs

Get lambda image creation logs by lambda ID.

During the creation of the lambda image, it is possible to get logs to monitor the progress.

For more information about lambda and lambda images logs see development manual.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

query Parameters
tail_lines
integer [ 0 .. 4294967296 ]

Number of strings what will be return.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
            "application/json",
        ),
        "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
    }

response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Get lambda image creation logs

url = f"{baseUri}/lambdas/{lambdaId}/image/logs"
params = {"tail_lines": 1}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

get lambda status

Get lambda status by ID.

If lambda image creation is in progress, lambda status will be waiting.

For more information about lambda and lambda images statuses see development manual.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
            "application/json",
        ),
        "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
    }

response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Get lambda image creation status

url = f"{baseUri}/lambdas/{lambdaId}/status"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "running",
  • "pod_statuses": {
    }
}

get lambda logs

Get lambda logs by ID.

After lambda creation has been executed, there is possibility to get lambda logs.

For more information about lambda and lambda images logs see development manual.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

tail_lines
integer [ 0 .. 4294967296 ]

Number of strings what will be return.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
            "application/json",
        ),
        "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
    }

response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Get lambda image creation logs

url = f"{baseUri}/lambdas/{lambdaId}/logs"
params = {"tail_lines": 1}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

lambda proxy [beta]

get lambda openapi documentation

Get lambda 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

path Parameters
lambda_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

ID of the lambda.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the 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
{}

proxy post request to lambda

Proxy POST request to lambda.

Request and response headers, query parameters and body description must be provided by lambda documentation.

Described headers will be processed and received independently of lambda behavior. In case of bearer authorization, the token must include view permissions for lambdas to process request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
lambda_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

ID of the lambda.

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

Any additional path parameter will be use as path parameter to lambda

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda
def wait4start(lambdaId: str) -> None:
    """
    Wait for lambda start

    Args:
        lambdaId: lambda id
    """
    for _ in range(150):
        reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
        if reply["status"] == "running":
            break
        if reply["status"] == "terminated":
            raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
        sleep(1)
    else:
        raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
            "application/json",
        ),
        "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
    }

response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Post proxy request to lambda
path = "main"
url = f"{baseUri}/lambdas/{lambdaId}/proxy/{path}"

response = requests.post(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
Example
{}

proxy options request to lambda

Proxy OPTIONS request to lambda.

The response to options contains all the possible methods that can be proxyed to a lambda, but does not say which of them are implemented and which are not.

path Parameters
lambda_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

ID of the lambda.

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

Any additional path parameter will be use as path parameter to lambda

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library
from time import sleep

import json
from uuid import uuid4

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
}

# Create lambda

lambdaName = str(uuid4())
url = f"{baseUri}/lambdas/"
with open("lambda.zip", "rb") as archive:
    files = {
        "archive": ("lambda.zip", archive.read(), "application/zip"),
        "credentials": (
            "credentials",
            json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
            "application/json",
        ),
        "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
    }

response = requests.post(url, headers=headers, files=files)
lambdaId = response.json()["lambda_id"]
wait4start(lambdaId)

# Put proxy request to lambda
path = "main"
url = f"{baseUri}/lambdas/{lambdaId}/proxy/{path}"

response = requests.options(url, headers=headers)

print(response.status_code)
print(response.headers)

Response samples

Content type
application/json
Example
{}

health

get health

Get health of service.

query Parameters
include_luna_services
integer
Default: 0
Enum: 0 1

Whether to perform healthchecks for dependent LUNA services.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# make request
url = f"{baseUri}/healthcheck"
response = requests.get(url, params={"include_luna_services": 1})

print(response.status_code)
print(response.json())

Response samples

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

healthcheck options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get health (redirect)

Get health of service (redirect).

query Parameters
include_luna_services
integer
Default: 0
Enum: 0 1

Whether to perform healthchecks for dependent LUNA services.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

# make request
url = f"http://127.0.0.1:5000/healthcheck"
response = requests.get(url, params={"include_luna_services": 1})

print(response.status_code)
print(response.json())

Response samples

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

healthcheck options (redirect)

Get options for the resource (redirect).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

streams [beta]

create stream

Create stream.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Any of
name
string <= 128 characters
Default: ""

Stream name.

description
string <= 512 characters
Default: ""

Stream description.

required
object (stream_data)
object (location_to_be_created)

Stream location parameters.

object (stream_autorestart)

Stream autorestart parameters.

required
Array of objects (analytics) non-empty

list of analytics with its parameters

group_name
string (group_name) ^[a-zA-Z0-9_\-]{1,128}$

Stream group name.

Responses

Request samples

Content type
application/json
Example
{
  • "name": "",
  • "description": "",
  • "data": {},
  • "location": {
    },
  • "autorestart": {
    },
  • "analytics": [
    ],
  • "group_name": "hd_stream_2"
}

Response samples

Content type
application/json
{
  • "stream_id": "b5d6fd45-fcca-453d-ac05-3e594054b813"
}

get streams

Get streams according to filters. The results are sorted by stream creation order, the oldest streams shown first.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Comma-separated list of stream IDs.

stream_id__gte
string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: stream_id__gte=ae09126e-70a6-49c7-923f-df2320f08639

Stream id lower included bound.

stream_id__lt
string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: stream_id__lt=ae09126e-70a6-49c7-923f-df2320f08639

Stream id upper excluded bound.

names
Array of strings (stream_name) [ items <= 128 characters ]
Example: names=name1,name2

Stream name filter. Only streams with the specified names will be returned in the response.

reference
string (stream_reference) <= 512 characters
Example: reference=https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==

Stream reference filter. Only streams with the specified reference will be returned in the response.

statuses
Array of integers (stream_status)
Items Enum: 0 1 2 3 4 5
Example: statuses=pending,stop

Stream status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response.

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

Lower included bound for object create_time.

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

Upper bound for object create_time.

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

Agent ID filter. Only streams associated with the specified id will be returned in the response.

group_name
string (group_name) ^[a-zA-Z0-9_\-]{1,128}$
Example: group_name=group1

Group name filter. Only groups with the specified names will be returned in the response.

order
string
Default: "desc"
Enum: "asc" "desc"

Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/streams"
params = {
    "names": ["some_stream1", "some_stream_2"],
}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

delete streams

Delete streams matching specified filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Request Body schema: application/json
stream_ids
required
Array of strings <uuid> (stream_id) <= 1000 items

Stream ID filter.

Responses

Request samples

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

Response samples

Content type
application/json
{}

streams options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

count streams

Count streams according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Comma-separated list of stream IDs.

names
Array of strings (stream_name) [ items <= 128 characters ]
Example: names=name1,name2

Stream name filter. Only streams with the specified names will be returned in the response.

reference
string (stream_reference) <= 512 characters
Example: reference=https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==

Stream reference filter. Only streams with the specified reference will be returned in the response.

statuses
Array of integers (stream_status)
Items Enum: 0 1 2 3 4 5
Example: statuses=pending,stop

Stream status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response.

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

Lower included bound for object create_time.

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

Upper bound for object create_time.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/streams/count"
response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "streams_count": 1
}

streams count options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get stream

Get the stream by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
stream_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

ID of the stream (stream_id received in the "create stream" request).

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create stream
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "name": "post_stream_name",
    "description": "important stream",
    "data": {
        "type": "videofile",
        "reference": "https://reference.local/video.mp4",
    },
    "analytics": [
        {
            "analytic_name": "example_analytic",
            "parameters": {}
        }
    ],
}

url = f"{baseUri}/streams"
response = requests.post(
    url,
    headers=headers,
    json=payload,
)
streamId = response.json()["stream_id"]

url = f"{baseUri}/streams/{streamId}"
response = requests.get(
    url,
    headers=headers,
)
print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
  • "name": "",
  • "description": "some description",
  • "data": {},
  • "location": {
    },
  • "autorestart": {
    },
  • "version": 1,
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "status": 0,
  • "last_error": null,
  • "groups": [
    ],
  • "analytics": [
    ]
}

head stream

Check if stream exists.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
stream_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

ID of the stream (stream_id received in the "create stream" request).

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"


# create stream
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "name": "post_stream_name",
    "description": "important stream",
    "data": {
        "type": "videofile",
        "reference": "https://reference.local/video.mp4",
    },
    "analytics": [
        {
            "analytic_name": "example_analytic",
            "parameters": {}
        }
    ],
}

url = f"{baseUri}/streams"
response = requests.post(
    url,
    headers=headers,
    json=payload,
)
streamId = response.json()["stream_id"]

url = f"{baseUri}/streams/{streamId}"
response = requests.head(
    url,
    headers=headers,
)
print(response.status_code)

Response samples

Content type
application/json
Example
{}

put stream

Update existing stream. You should specify all the fields required for the stream in the request.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
stream_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

ID of the stream (stream_id received in the "create stream" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
Any of
name
string <= 128 characters
Default: ""

Stream name.

description
string <= 512 characters
Default: ""

Stream description.

required
object (stream_data)
object (location_to_be_created)

Stream location parameters.

object (stream_autorestart)

Stream autorestart parameters.

required
Array of objects (analytics) non-empty

list of analytics with its parameters

group_name
string (group_name) ^[a-zA-Z0-9_\-]{1,128}$

Stream group name.

Responses

Request samples

Content type
application/json
Example
{
  • "name": "",
  • "description": "",
  • "data": {},
  • "location": {
    },
  • "autorestart": {
    },
  • "analytics": [
    ],
  • "group_name": "hd_stream_2"
}

Response samples

Content type
application/json
{
  • "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
  • "version": 1
}

patch stream

Pause/unpause stream

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
stream_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

ID of the stream (stream_id received in the "create stream" request).

query Parameters
action
required
string
Enum: "stop" "resume"

stop - stop stream processing, stream status will be switched to stop resume - resume stream processing, stream status will be switched to pending

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests
import time

baseUri = "http://127.0.0.1:5000/6"

# create stream
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "name": "post_stream_name",
    "description": "important stream",
    "data": {
        "type": "videofile",
        "reference": "https://reference.local/video.mp4",
    },
    "analytics": [
        {
            "analytic_name": "example_analytic",
            "parameters": {}
        }
    ],
}

url = f"{baseUri}/streams"
response = requests.post(
    url,
    headers=headers,
    json=payload,
)
streamId = response.json()["stream_id"]
time.sleep(5)

url = f"{baseUri}/streams/{streamId}?action=stop"
response = requests.patch(
    url,
    headers=headers,
)
print(response.status_code)

Response samples

Content type
application/json
{}

remove stream

Remove the stream by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
stream_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

ID of the stream (stream_id received in the "create stream" request).

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create stream
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
    "name": "post_stream_name",
    "description": "important stream",
    "data": {
        "type": "videofile",
        "reference": "https://reference.local/video.mp4",
    },
    "analytics": [
        {
            "analytic_name": "example_analytic",
            "parameters": {}
        }
    ],
}

url = f"{baseUri}/streams"
response = requests.post(
    url,
    headers=headers,
    json=payload,
)
streamId = response.json()["stream_id"]

url = f"{baseUri}/streams/{streamId}"
response = requests.delete(
    url,
    headers=headers,
)
print(response.status_code)

Response samples

Content type
application/json
Example
{}

stream options

Get options for the resource.

path Parameters
stream_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

ID of the stream (stream_id received in the "create stream" request).

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

stream events ws handshake

Stream ws events handshake. The resource is designed to receive realtime events from analytics.

Attention!

Subscription to events occurs via WebSocket. Messages sent by ws you can view in callback section. Connection supports autoping.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
stream_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

ID of the stream (stream_id received in the "create stream" request).

header Parameters
Luna-Account-Id
string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Deprecated
Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

Account ID.

An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID.

User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests).

Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

from luna3.lunavl.httpclient import LunaHttpClient

EXPECTED_EVENT_COUNT = 100

client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna")
with client.streamsWsConnect(streamId="5818e68c-12ad-4a8b-96fe-5037225d61eb") as ws:
    for _ in range(EXPECTED_EVENT_COUNT):
        WS_RESP = ws.recv()
        print(WS_RESP)

Response samples

Content type
application/json
Example
{
  • "stream_status": "in_progress",
  • "error": null,
  • "analytics_results": {
    }
}

streams logs [beta]

get streams logs

Get streams logs according to filters. The results are sorted by log creation order, the new streams logs shown first.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

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

Comma-separated list of stream IDs.

statuses
Array of integers (stream_status)
Items Enum: 0 1 2 3 4 5
Example: statuses=pending,stop

Stream status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response.

targets
Array of strings
Default: ["stream_id","status","error","log_time"]
Items Enum: "stream_id" "status" "error" "log_time"
Example: targets=status

List of comma-separated stream logs targets.

log_time__lt
string <date-time> (time)
Example: log_time__lt=2021-09-21T19:11:41.674Z

Stream log record time upper excluding bound filter in RFC 3339 format. Only stream logs with the record time lower than the specified boundary will be returned in the response.

log_time__gte
string <date-time> (time)
Example: log_time__gte=2021-09-21T11:11:41.674Z

Stream log record time lower including bound filter in RFC 3339 format. Only stream log with the record time greater than or equal to the specified boundary will be returned in the response.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/streams/logs"
params = {
    "targets": "error,log_time",
}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

delete stream logs

Delete streams logs older than specified date excluding last log entry.

query Parameters
log_time__lt
string <date-time> (time)
Example: log_time__lt=2021-09-21T19:11:41.674Z

Stream log record time upper excluding bound filter in RFC 3339 format. Only stream logs with the record time lower than the specified boundary will be deleted.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/streams/logs"
params = {
    "log_time__lt": "2021-09-21T19:11:41.674Z",
}

response = requests.delete(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "deleted_count": 1000
}

streams logs options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

streams group linker [beta]

attach (or detach) streams to a group

Attach (or detach) streams to a group.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
action
required
string
Enum: "attach" "detach"

Action to perform: attach or detach streams to group.

stream_ids
required
Array of strings <uuid> (uuid) <= 1000 items

Stream IDs.

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

Stream group ID.

Responses

Request samples

Content type
application/json
{
  • "action": "attach",
  • "stream_ids": [
    ],
  • "group_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
}

Response samples

Content type
application/json
Example
{}

linker options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

groups [beta]

create group

Create group.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
group_name
required
string (group_name) ^[a-zA-Z0-9_\-]{1,128}$

Stream group name.

description
string <= 256 characters
Default: ""

Stream group description.

Responses

Request samples

Content type
application/json
{
  • "group_name": "hd_stream_2",
  • "description": ""
}

Response samples

Content type
application/json
{
  • "group_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
}

get groups

Get groups according to filters. The results are sorted by group creation order, the oldest group shown first.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
group_ids
Array of strings <uuid> (group_id)
Example: group_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce

Group IDs.

group_names
Array of strings (group_name)
Example: group_names=group1,group2

Group names.

account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/groups"
params = {
    "group_names": ["some_group1", "some_group2"],
}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

groups options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get group count

Count of groups according to the filters.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
group_ids
Array of strings <uuid> (group_id)
Example: group_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce

Group IDs.

group_names
Array of strings (group_name)
Example: group_names=group1,group2

Group names.

account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/groups/count"
response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "groups_count": 7
}

groups count options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get group

Get the group by name.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
group_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

ID of the group (group_id received in the "create group" request).

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create group
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
  "group_name": "group_name_get",
  "description": "a group"
}

url = f"{baseUri}/groups"
response = requests.post(
    url,
    headers=headers,
    json=payload,
)

groupId = response.json()["group_id"]

url = f"{baseUri}/groups/{groupId}"
response = requests.get(
    url,
    headers=headers,
)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "account_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
  • "group_name": "stream_group-1",
  • "group_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
  • "description": "default stream group",
  • "create_time": "2018-08-11T09:11:41.674Z"
}

update group

Update group fields: description

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
group_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

ID of the group (group_id received in the "create group" request).

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Content-Type
string
Value: "application/json"

Content type is application/json.

Request Body schema: application/json
description
required
string <= 256 characters

Stream group description.

Responses

Request samples

Content type
application/json
{
  • "description": "old stream group"
}

Response samples

Content type
application/json
{}

remove group

Remove the group by name.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
group_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

ID of the group (group_id received in the "create group" request).

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

# create group
headers = {
    "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
payload = {
  "group_name": "group_name_delete",
  "description": "a group"
}

url = f"{baseUri}/groups"
response = requests.post(
    url,
    headers=headers,
    json=payload,
)

groupId = response.json()["group_id"]

url = f"{baseUri}/groups/{groupId}"
response = requests.delete(
    url,
    headers=headers,
)

print(response.status_code)

Response samples

Content type
application/json
{}

group options

Get options for the resource.

path Parameters
group_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

ID of the group (group_id received in the "create group" request).

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

analytics [beta]

get analytics

Get analytics according to filters. The results are sorted by analytic creation order, the oldest analytics shown first.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
query Parameters
analytic_ids
Array of strings <uuid> (analytic_id)
Example: analytic_ids=ae09126e-80a9-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce

Analytics ID filter. Only analytics with the specified ids will be returned in the response.

analytic_id__gte
string <uuid> (analytic_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: analytic_id__gte=ae09126e-70a6-49c7-923f-df2320f08639

Analytic id lower included bound.

analytic_id__lt
string <uuid> (analytic_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: analytic_id__lt=ae09126e-70a6-49c7-923f-df2320f08639

Analytic id upper excluded bound.

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

Upper bound for object create_time.

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

Lower included bound for object create_time.

names
Array of strings (analytic_name) [ items <= 36 characters ^[a-zA-Z0-9_\-]{1,36}$ ]
Example: names=name1,name2

Analytic name filter. Only streams with the specified names will be returned in the response.

order
string
Default: "desc"
Enum: "asc" "desc"

Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first.

page
integer >= 1
Default: 1

Page number.

page_size
integer [ 1 .. 1000 ]
Default: 10

Number of items on page.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/analytics"
params = {
    "names": "example_analytic",
}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())

Response samples

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

analytics options

Get options for the resource.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get analytic

Get the analytic by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
analytic_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

ID of the analytic.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/analytics/43b8f72b-769a-48e1-a69c-7150fae2db3c"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
application/json
{
  • "analytic_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
  • "analytic_name": "some name",
  • "description": "",
  • "analytic_version": 1,
  • "default_parameters": { },
  • "create_time": "2018-08-11T09:11:41.674Z",
  • "last_update_time": "2018-08-11T09:11:41.674Z",
  • "validation_schema": { }
}

analytic options

Get options for the resource.

path Parameters
analytic_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

ID of the analytic.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

get analytic documentation

Get the analytic documentation by ID.

Authorizations:
BasicAuthBearerAuthLunaAccountIdAuth
path Parameters
analytic_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

ID of the analytic.

query Parameters
account_id
string <uuid> (account_id) ^[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 filter. Will not have effect if Luna-Account-Id header is used for authorization

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Accept
string
Value: "text/html"

Preferred response content type

Responses

Request samples

# This example is written using requests library

import requests

baseUri = "http://127.0.0.1:5000/6"

headers = {
    "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
}
url = f"{baseUri}/analytics/43b8f72b-769a-48e1-a69c-7150fae2db3c/docs"

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())

Response samples

Content type
"string"

analytic docs options

Get options for the resource.

path Parameters
analytic_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

ID of the analytic.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
application/json
{}

metrics

get service requests statistics

Get statistics of success and failed requests to the service in prometheus format.

header Parameters
Luna-Request-Id
string^[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 in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.

Responses

Response samples

Content type
text/plain
# HELP request_count_total Counter of requests
# TYPE request_count_total counter
request_count_total{path="GET:/healthcheck",status_code="200"} 1.0
# HELP requests Histogram of request time metrics
# TYPE requests histogram
requests_sum{route="GET:/healthcheck",status_code="200"} 0.005269583023618907
requests_bucket{le="0.0001",route="GET:/healthcheck",status_code="200"} 0.0
requests_bucket{le="0.00025",route="GET:/healthcheck",status_code="200"} 0.0
requests_bucket{le="0.0005",route="GET:/healthcheck",status_code="200"} 0.0
requests_bucket{le="0.001",route="GET:/healthcheck",status_code="200"} 0.0
requests_bucket{le="0.0025",route="GET:/healthcheck",status_code="200"} 0.0
requests_bucket{le="0.005",route="GET:/healthcheck",status_code="200"} 0.0
requests_bucket{le="0.01",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="0.025",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="0.05",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="0.075",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="0.1",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="0.25",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="0.5",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="0.75",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="1.0",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="2.5",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="5.0",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="7.5",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="10.0",route="GET:/healthcheck",status_code="200"} 1.0
requests_bucket{le="+Inf",route="GET:/healthcheck",status_code="200"} 1.0
requests_count{route="GET:/healthcheck",status_code="200"} 1.0