Enface REST API (1.0)

Download OpenAPI specification:Download

Enface REST API server description. You can find out more about Enface at https://enface.ai.

USERS

User operations

User login

Request Body schema: application/json
email
required
string <email>

User's email address

password
required
string <password> >= 6 characters

User's password

valid_days
integer >= 1
Default: 1

Temporary token expiration days

Responses

200

Successful user login response

400

Bad Request

403

Invalid user credentials

post /user/login

Enface API server

https://api.enface.ai/v1/user/login

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "user@example.com",
  • "password": "pa$$word",
  • "valid_days": 1
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "token": "jwt.temporary.token"
}

TOKENS

Permanent access tokens management

Tokens

Get all user's permanent tokens

Responses

200

Tokens List

401

Unauthorized

get /tokens

Enface API server

https://api.enface.ai/v1/tokens

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Token create

Create a new permanent access token with valid days count or exact expiration time

Request Body schema: application/json
One of
  • Valid days
  • Expires value
valid_days
required
number >= 1
Default: 1

Valid days count

token
string <uuid> (AccessToken)

User's permanent access token. If no temporary token provided in "token" header, this parameter is required.

Responses

201

Created

400

Bad Request

401

Unauthorized

post /token/create

Enface API server

https://api.enface.ai/v1/token/create

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "expires": "never"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "message": "new token created",
  • "token":
    {
    }
}

DATA SOURCE GROUPS

Data source groups management

Source groups

Get all data source groups

Responses

200

Ok

401

Unauthorized

get /source/groups

Enface API server

https://api.enface.ai/v1/source/groups

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Source group create

Create new data sources group

Request Body schema: application/json
name
required
string [ 1 .. 100 ] characters

Data sources group name

token
string <uuid> (AccessToken)

User's permanent access token. If no temporary token provided in "token" header, this parameter is required.

person_list_search
Array of objects (PersonListSearch)

Responses

201

Created

400

Bad Request

401

Unauthorized

post /source/group/create

Enface API server

https://api.enface.ai/v1/source/group/create

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "Office cameras",
  • "person_list_search":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "message": "source group created",
  • "group_id": "c2a61a30-8986-11ea-98f0-de0b10ae4112"
}

DATA SOURCES

Data sources management

Source create

Create new data source

Request Body schema: application/json
name
required
string [ 1 .. 100 ] characters

New source name

group_id
required
string <uuid>

Source group id

new_person_threshold
string
Default: "never"
Enum: "80" "85" "90" "95" "never" "no_match"

New person creation match score threshold

new_person_square_min
string
Default: 112
Enum: "50" "112" "224"

New person minimum square in pixels

new_person_angle_max
string
Default: 60
Enum: "5" "10" "20" "30" "40" "50" "60" "70" "80"

New person maximum face angle

person_list_add
string <uuid>

Person list id to automatically add new persons to (regarding all auto-creation rules)

token
string <uuid> (AccessToken)

User's permanent access token. If no temporary token provided in "token" header, this parameter is required.

feature_check
Array of strings (FeatureCheck) >= 0 items
Items Enum: "gender" "age" "race"

A list of features to detect on each found face. May be an array or just a single feature name.

Responses

201

Created

400

Bad Request

401

Unauthorized

post /source/create

Enface API server

https://api.enface.ai/v1/source/create

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "group_id": "ef9b7d20-8899-11ea-862b-b2763602db0e",
  • "name": "camera 1",
  • "features_check":
    [
    ],
  • "new_person_threshold": "no_match",
  • "new_person_square_min": 112,
  • "new_person_angle_max": 60,
  • "person_list_add": "d99a5df0-8292-11ea-b89f-db248d6ead66"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "message": "source created",
  • "source_id": "c2a61a30-8986-11ea-98f0-de0b10ae4112"
}

Sources

Get all data sources by group id

Request Body schema: application/json
group_id
required
string <uuid>

Sources group id

token
string <uuid> (AccessToken)

User's permanent access token. If no temporary token provided in "token" header, this parameter is required.

Responses

200

Ok

401

Unauthorized

post /sources

Enface API server

https://api.enface.ai/v1/sources

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "group_id": "d995ca10-8292-11ea-ae65-3048e12b1113"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

PERSONS LIST

Persons lists management

Person list create

Create new persons list

Request Body schema: application/json

New list name should be defined

name
required
string [ 1 .. 100 ] characters

New persons list name

token
string <uuid> (AccessToken)

User's permanent access token. If no temporary token provided in "token" header, this parameter is required.

Responses

201

Created

400

Bad Request

401

Unauthorized

post /person/list/create

Enface API server

https://api.enface.ai/v1/person/list/create

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "list name 1"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "list_id": "string",
  • "status": "ok"
}

Person lists

Get all persons lists

Responses

200

Ok

401

Unauthorized

get /person/lists

Enface API server

https://api.enface.ai/v1/person/lists

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

PERSONS

Persons management

Person create

Create a new person in defined (of default) list using parameters

Request Body schema: multipart/form-data
image
required
string <binary>

Image to process, can contain a lot of faces (check "multi" parameter value)

list_id
string <uuid>

New person list id. If this parameter is omitted, the person will be created (or replaced) in the default persons list.

replace_person_id
string <uuid>

Person id for replacement

bbox
boolean (BBoxRequest)
Default: false

Return top-left and bottom-right rectangle coordinates for each face on the processed image

bbox_pro
boolean (BBoxProRequest)
Default: false

Return 4 [x, y] rectangle coordinates for each face on the processed image

fields
Array of strings (PersonFields) <= 2000000 items

An array of strings to be stored with the person record regarding any business logic. This array is limited by 2 millions records of strings up to 64kb each.

multi
boolean
Default: false

Create separate person instance for each face found on image. New person creation conditions are applied to each face separately. If this parameter is "false", the largest face on image will be processed.

token
string <uuid> (AccessToken)

User's permanent access token. If no temporary token provided in "token" header, this parameter is required.

feature_check
Array of Array of strings (FeatureCheck)
Items Enum: "gender" "age" "race"

A list of features to detect on each found face. May be an array of features names or just a single feature name.

new_person_threshold
string (NewPersonThreshold)
Default: "no_match"
Enum: "80" "85" "90" "95" "no_match" "never"

New person creation match threshold, calculated for every "person_list_add" (or "default list", if no lists were provided). Value "no_match" will be automatically replaced with platform internal default - the optimal value, defined by complex neural network checks and tests (recommended). Value "never" means no person will be created in this action.

drop_image
boolean
Default: false

Do not store the image in persons list. If this parameter is provided, only the face unpersonalized embedding will be stored.

thumb
boolean (ThumbRequest)
Default: false

Return pre-processed thumb image for each found face (112x112 pixels, base64 encoded)

new_person_yaw_max
integer
Default: 30
Enum: "5" "10" "20" "30" "40" "50" "60" "70" "80"

New person face maximum yaw angle

new_person_square_min
integer
Default: 112
Enum: "50" "112" "224"

Person creation minimum face square side size in pixels

Responses

200

Ok

201

Created

400

Bad Request

401

Unauthorized

post /person/create

Enface API server

https://api.enface.ai/v1/person/create

Request samples

Content type
multipart/form-data
Example
Copy
{
  "image": "binary",
  "list_id": "c8a97400-8a1b-11ea-bf7a-61a614d87933"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "message": "image format is unknown",
  • "faces_total": 0,
  • "spent": 97
}

Person

Get person record by id

Request Body schema: application/json
token
string <uuid> (AccessToken)

User's permanent access token. If no temporary token provided in "token" header, this parameter is required.

list_id