Face · Standard API · eKYC Core

Delete faces

POST/v1/delete_faces

Deletes the given image ids out of a face collection's index and returns the id of the request.

Request

MethodPOST
Path/v1/delete_faces
Content-Typeapplication/json
Auth requiredYes — HMAC signing
NameTypeRequiredDescription
image_ids[]stringRequiredimage IDs in DB. Should use indexed image
collectionstringOptionalindex faces to this collection
  • If not set collection, default collection will be used.
JSON
{
    "image_ids": []string,
    "collection": string,
}

Sample request

curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/delete_faces \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json' \
-d \
'
{
    "image_ids": [
      "a4facba3-334b-41fb-97e3-4766cb70ae29",
      "7db00808-0416-45cf-a5cb-3b6dfbd7bb74"
    ]
}
'

Response

In case of success, the HTTP status code will be 200, and the data will be an object containing following fields:

fieldtypedescription
request_idstringID of the request (UUID)
JSON
{
    "data": {
        "request_id": string,
    },
    "errors": [
        {
            "code": string,
            "message": string,
            "detail": {
                "field": string, // optional, which parameter is invalid.
                ... // any other information that can be useful for client
            },
        },
        ... // other errors
    ]
}

A successful delete comes back like this:

JSON
{
    "data": {
        "request_id": "d4493ff5-e41f-4d10-a291-6a9727050b4c"
    }
}

Failure codes

In case of error, the data will be empty, and server sends following HTTP status code and error information:

HTTP codeError codeDescription
401access_denied_exceptionYou are not authorized to perform the action.
400invalid_parameter_exceptionInput parameter violates a constraint.
400request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
404image_not_found_exceptionThe image ID is not found in DB.
408request_timeout_exceptionRequest takes too long to process
429rate_limit_exceptionThe number of requests exceeded your throughput limit.
500internal_server_errorSome unexpected error occurs while processing the request

The codes above are the ones documented for this endpoint. Response errors on the Overview lists the codes for the eKYC Core surface as a whole — the two lists do not match on every endpoint.