Create a new data source

Description

This method creates a new data source in the selected group. A JWT token in the header is required for access.

Request Format

  • HTTP Method: POST
  • URL: /source/create
  • Content-Type: application/json
  • Authorization: required

Request Parameters

ParameterTypeLocationRequiredDescription
tokenstringHeaderUser JWT token

Request Body (JSON)

FieldTypeRequiredDescription
tokenstringUser JWT token
group_idstringGroup identifier
namestringName of the data source
feature_checkstring[]List of feature checks (e.g., «race», «age», …)
new_person_thresholdstringThreshold for new face detection (e.g., «0.7»)
new_person_square_minstringMinimum face area
new_person_yaw_maxstringMaximum face yaw angle
new_person_pitch_maxnumberMaximum face pitch angle
person_list_addstring[]List of person identifiers to add
person_list_searchobject[]Face search configuration list

Example Request (cURL)

curl -X POST "https://api.enface.ai/source/create" 
  -H "Content-Type: application/json" 
  -H "Authorization: Bearer jwt.temporary.token" 
  -d '{
    "token": "jwt.temporary.token",
    "group_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "New Source",
    "feature_check": ["race", "age"],
    "new_person_threshold": "0.7",
    "new_person_square_min": "50",
    "new_person_yaw_max": "1.5",
    "new_person_pitch_max": 1,
    "person_list_add": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ],
    "person_list_search": []
  }'

Response Examples

Success (200 OK)
{
  "message": "source created",
  "source_id": "c2a61a30-8986-11ea-98f0-de0b10ae4112",
  "status": "ok"
}
Error (400 Bad Request)
{
  "message": "invalid schema",
  "status": "error"
}
Error (401 Unauthorized)
{
  "message": "access denied",
  "status": "error"
}