REST API: data sources

Update a data source

Change how the images of a source are handled.

Purpose

Use this call to rename a source or to change its settings. Send the fields you want to change together with source_id and group_id.

Request

POST <API_BASE_URL>/source/update. All calls are POST under your API address. Replace <API_BASE_URL> with the API address provided with your access.

Send a permanent API token in the token field of the body, or a user token in the token header. See authentication.

Content type: application/json.

FieldTypeRequiredDescription
tokenstring (uuid)if no headerYour permanent API token. Required unless you send a user token in the token header.
source_idstring (uuid)yesThe source to update.
group_idstring (uuid)yesThe group the source belongs to.
namestringnoThe new name of the source.
feature_checkarray of object or stringnoFeatures to detect on every image of the source: a name or an array of names such as age, gender, mood, glasses or mask.
new_person_thresholdvaluenoThe match threshold below which a new person is created automatically. The value never creates no person; no_match uses the platform default, which is recommended.
new_person_square_minvaluenoThe smallest face side, in pixels, from which a person is created automatically.
new_person_yaw_maxvaluenoThe largest left or right rotation, in degrees, at which a person is created automatically.
new_person_pitch_maxvaluenoThe largest up or down tilt, in degrees, at which a person is created automatically.
person_list_addarray of stringnoAn array of person list identifiers. Persons created automatically are added to each of them.

Response

HTTP 200. The source was updated.

FieldTypeDescription
statusstringAlways ok on this body.

Errors

  • 400: The body failed validation. The answer has status of error and a details list with one entry per offending field (path, expected, actual).
  • 401: The token is missing, expired or unknown.

A refusal can also come before the operation runs: an address outside your IP allowlist, a token bound to another address, or a body that is not valid JSON. See response format and errors.

Example

Request:

curl -X POST "<API_BASE_URL>/source/update" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "<your permanent API token>",
    "source_id": "<source id>",
    "group_id": "<group id>",
    "name": "Front door, north"
  }'

Response:

{
  "status": "ok",
  "message": "<detail>"
}

Questions about the face API?

Write to us and we will help.

Talk to us