All Products
Search
Document Center

AI Guardrails:Add a face

Last Updated:Mar 31, 2026

Adds one or more face images to an individual in a face group.

Each individual can hold up to 20 face images. If no custom face search is performed within one year after adding a face image, the face image and its face group are deleted automatically.

Request syntax

POST /green/sface/face/add HTTPS|HTTP

Request headers

This operation uses only common request headers. For more information, see Common request headers.

Request parameters

ParameterTypeRequiredExampleDescription
clientInfoJSONObjectNo{"userId":"120234234","userNick":"Mike","userType":"others"}The client information serialized from the ClientInfo structure in JSON format, including the unique machine identifier (UMID) and International Mobile Equipment Identity (IMEI) of the client. For more information, see ClientInfo.
bizTypeStringNoeduThe business scenario type.
personIdStringYesperson1The ID of the individual. To get all individual IDs, call the /green/sface/group/persons operation.
urlsStringArrayYes["http://xxx/xxx01.jpg","http://xxx/xxx02.jpg"]The URLs of the face images to add.

Response parameters

All responses are returned in JSON format. For common response parameters, see Common response parameters. The data field returns business-specific data as a JSON object or array.

The data field may be empty when an error occurs.

The following table describes the fields in the data object.

FieldTypeExampleDescription
codeInteger200The HTTP status code. For more information, see Common error codes.
groupIdsStringArray["foreign1"]The IDs of the face groups to which the individual belongs.
personIdStringperson1The ID of the individual.
faceImageItemsJSONArrayThe results for each face image submitted. For details, see the faceImageItem structure below.

faceImageItem structure

FieldTypeExampleDescription
faceIdFloat23088737259260929The ID of the recognized face.
successBooleantrueSpecifies whether the face image was added successfully. Valid values: true | false.

Examples

Request

POST /green/sface/face/add HTTP/1.1
Common request headers
{
    "personId": "person1",
    "urls": [
        "http://xxx/xxx01.jpg",
        "http://xxx/xxx02.jpg"
    ]
}

Response

{
    "msg": "OK",
    "code": 200,
    "requestId": "36D384DA-8023-4E84-BCFD-0C5581352C16",
    "data": {
        "code": 200,
        "groupIds": [
            "foreign1"
        ],
        "personId": "person1",
        "faceImageItems": [
            {
                "success": true,
                "faceId": 23088737259260929
            }
        ]
    }
}

Error codes

For a list of error codes, see Service error codes.