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
string <uuid>

Person list id. If not specified, the default person list will be used.

person_id
required
string <uuid>

Person id

Responses

200

Ok

400

Bad Request

401

Unauthorized

404

Not Found

post /person

Enface API server

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

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "b9749cad-8b87-435b-84e3-c33e19e749ec",
  • "list_id": "string",
  • "person_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "person_id": "55e2c7d0-951c-11ea-83be-36b62cef36f0",
  • "list_id": "1ad22a7e-e5de-4a50-b066-d9f00f81ff5f",
  • "created": "2021-02-20T13:51:00Z",
  • "group_id": "a53910d3-44c6-40a7-98f0-0a93772495fa",
  • "source_id": "ccf4c6ca-95f3-4d73-8819-13918497e59e",
  • "status": "init",
  • "features":
    [
    ],
  • "fields":
    [
    ],
  • "yaw": 0
}

Person update

Update person record

Request Body schema: application/json
list_id
string <uuid>

Person's list id. If this parameter is omitted, the person will be searched in the default persons list.

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.

token
string <uuid> (AccessToken)

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

drop_image
boolean
Default: false

Remove person's image from database (if present). If this parameter is provided, only the face unpersonalized embedding will be stored.

person_id
required
string <uuid>

Person id to update

Responses

200

Ok

400

Bad Request

401

Unauthorized

404

Not Found

post /person/update

Enface API server

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

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "list_id": "ec86f010-9550-11ea-b0cd-c00ad6c83721",
  • "fields":
    [
    ],
  • "token": "b9749cad-8b87-435b-84e3-c33e19e749ec",
  • "drop_image": false,
  • "person_id": "a2202315-1fe6-442e-bf73-effdc079324d"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "operation succeeded",
  • "status": "ok"
}

Person delete

Delete person from the list

Request Body schema: application/json
list_id
string <uuid>

Person's list id. If this parameter is omitted, the person will be searched in the default persons list.

token
string <uuid> (AccessToken)

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

person_id
required
string <uuid>

Person id to delete

Responses

200

Ok

400

Bad Request

401

Unauthorized

404

Not Found

delete /person/delete

Enface API server

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

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "list_id": "ec86f010-9550-11ea-b0cd-c00ad6c83721",
  • "token": "b9749cad-8b87-435b-84e3-c33e19e749ec",
  • "person_id": "a2202315-1fe6-442e-bf73-effdc079324d"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "message": "1 person(s) deleted"
}

ACTIONS

Various images processing actions.

Compare faces on 2 images

Find all faces on 2 images and compare by similarity. JPEG and PNG formats are supported (up to 10Mb of data in one request).

Request Body schema: multipart/form-data
images
required
Array of strings <binary> 2 items

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

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

multi
boolean
Default: false

Perform independent search for each face on image. 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.

thumb
boolean (ThumbRequest)
Default: false

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

Responses

200

Ok

400

Bad Request

401

Unauthorized

post /compare

Enface API server

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "image1":
    [
    ],
  • "image2":
    [
    ],
  • "spent": 143,
  • "status": "ok"
}

Detect face(s) on image(s)

Find all faces on image(s) and detect various features for each face found. JPEG and PNG formats are supported (up to 10Mb of data in one request).

Request Body schema: multipart/form-data
images
required
Array of strings <binary> [ 1 .. 100 ] items

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

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

multi
boolean (MultiRequest)
Default: false

Perform independent search for each face on image. 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 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.

thumb
boolean (ThumbRequest)
Default: false

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

Responses

200

Ok

400

Bad Request

401

Unauthorized

post /detect

Enface API server

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "spent": 143,
  • "results":
    [
    ],
  • "status": "ok"
}

Search for face(s) matches

Search for face(s) matches regarding various conditions. JPEG and PNG formats are supported (up to 10Mb of data in one request).

If there will be no "group_id" or "source_id" parameters specified, the default group and source settings will be applied.

If some of parameters:

  • person_list_search
  • new_person_threshold
  • new_person_yaw_max
  • new_person_square_min
  • person_list_add
are omitted, they will be taken from the data group and source, defined by "group_id" and "source_id". You can overwrite group and source settings with these variables for one request. Otherwise - you can setup required group and source regarding your business logic and skip these variables definition in every request. This is the most common misunderstanding during the setup.

If "new_person_threshold" value is "never", the values of "new_person_yaw_max", "new_person_square_min" and "person_list_add" parameters are ignored.

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

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

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

multi
boolean
Default: false

Perform independent search for each face found on image. Auto 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 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.

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.

group_id
string <uuid>

Action data source group id

source_id
string <uuid>

Action data source id

person_list_search
Array of strings <uuid>

Search for matches in defined person list(s). If omitted, the search will be performed in default person list only.

results
integer [ 1 .. 100 ]
Default: 1

How many person(s) matches to return. Results are sorted by distance.

person_list_add
Array of strings <uuid>
Default: "13814001-1dd2-11b2-b619-5502c27ed19c"

Automatically create persons in defined list(s). This parameter is required for person creation.

drop_image
boolean
Default: false

Do not store the image in actions history.

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

201

Created

400

Bad Request

401

Unauthorized

post /action

Enface API server

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

Request samples

Content type
multipart/form-data
Example
Copy
{
  "token": "98ace0d0-94a6-11ea-abc1-d1365b6aa8d4",
  "image": "<binary>"
}

Response samples

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