tencent cloud

Feedback

CreateGroup

Last updated: 2023-02-27 15:22:50

1. API Description

Domain name for API request: iai.tencentcloudapi.com.

This API is used to create an empty group. If the group already exists, an error will be returned.
Custom description fields can be created as needed to describe persons in the group.

A maximum of 100,000 groups or 50 million faces can be created under one APPID.

The maximum number of faces that can be included in one group varies by algorithm model version (FaceModelVersion), which is 1 million for v2.0 or 3 million for v3.0.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateGroup.
Version Yes String Common Params. The value used for this API: 2020-03-03.
Region No String Common Params. This parameter is not required for this API.
GroupName Yes String Group name, which is modifiable, must be unique, and can contain 1 to 60 characters.
GroupId Yes String Group ID, which is unmodifiable, must be unique, and can contain letters, digits, and special symbols (-%@#&_) of up to 64 B.
GroupExDescriptions.N No Array of String Custom group description field that describes the person attributes in the group, which will be applied to all persons in the group.
Up to 5 ones can be created.
Each custom description field can contain 1 to 30 characters.
The custom description field must be unique in the group.
Example: if you set the "custom description field" of a group to ["student ID","employee ID","mobile number"],
then all the persons in the group will have description fields named "student ID", "employee ID", and "mobile number".
You can enter content in the corresponding field to register a person's student ID, employee ID, and mobile number.
Tag No String Group remarks, which can contain 0 to 40 characters.
FaceModelVersion No String Algorithm model version used by the Face Recognition service.

Currently, 2.0 and 3.0 are supported.

This parameter is 3.0 by default starting from April 2, 2020. If it is left empty for accounts that used this API, 2.0 will be used by default.

The parameter can be set only to 3.0 for accounts that purchase the service after November 26, 2020.

Different algorithm model versions correspond to different face recognition algorithms. The 3.0 version has a better overall effect than the legacy version and is recommended.

3. Output Parameters

Parameter Name Type Description
FaceModelVersion String Algorithm model version used for face recognition.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating group

This example shows you how to create groups.

Input Example

https://iai.tencentcloudapi.com/?Action=CreateGroup
&GroupName=Tencent Shenzhen Employee Group
&FaceModelVersion=3.0
&GroupId=TencentShenZhenEmployee
&Tag=Excludes interns
&GroupExDescriptions.0=Business Group
&GroupExDescriptions.1=Department name
&GroupExDescriptions.2=Group name
&<Common request parameters>

Output Example

{
    "Response": {
        "FaceModelVersion": "3.0",
        "RequestId": "e53ee4ec-9099-4b35-a129-21dd4820ff85"
    }
}

Example2 Creating group - 2

Input Example

https://iai.tencentcloudapi.com/?Action=CreateGroup
&GroupName=Building 1, Zhuyuan Dormitory of XXX University
&GroupId=ZhuYuanDormitoryNo1
&FaceModelVersion=3.0
&Tag=All are girls
&GroupExDescriptions.0=School name
&GroupExDescriptions.1=Major
&GroupExDescriptions.2=Grade
&GroupExDescriptions.3=Student ID
&<Common request parameters>

Output Example

{
    "Response": {
        "FaceModelVersion": "3.0",
        "RequestId": "1695f3dd-b668-479e-8b87-f37de371a8ec"
    }
}

Example3 Sample error

This example shows the error that will occur if a group ID already exists.

Input Example

https://iai.tencentcloudapi.com/?Action=CreateGroup
&GroupName=Tencent Shenzhen Employee Group
&GroupId=TencentShenZhenEmployee
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "76ec6e41-37d6-4ab9-abef-48ef0c6ab175"
    }
}

Example4 Sample error - 2

This example shows the error that will occur if there are Chinese characters in a group ID.

Input Example

https://iai.tencentcloudapi.com/?Action=CreateGroup
&GroupName=Tencent Shenzhen Employee Group
&GroupId=Tencent Employees in Shenzhen
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "8125dda4-2905-4e02-88bd-79a93a660ad2"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure.InvalidAuthorization Authentication failed.
FailedOperation.ConflictOperation The operations conflict. Do not operate on the same person simultaneously.
FailedOperation.DuplicatedGroupDescription The custom description field must be unique in the group.
FailedOperation.GroupInDeletedState The current group is being deleted. Please wait.
FailedOperation.GroupPersonMapExist The ID of the corresponding person is already in the group.
FailedOperation.GroupPersonMapNotExist The ID of the corresponding person is not in the group.
FailedOperation.ImageDecodeFailed Image decoding failed.
FailedOperation.ImageDownloadError An error occurred while downloading the image.
FailedOperation.ImageFacedetectFailed Face detection failed.
FailedOperation.ImageSizeExceed The size of the Base64-encoded image cannot exceed 5 MB.
FailedOperation.RequestLimitExceeded The request frequency exceeds the limit.
FailedOperation.RequestTimeout The backend service timed out.
FailedOperation.SearchFacesExceed The number of faces searched for exceeds the limit.
FailedOperation.ServerError The algorithm service is exceptional. Please retry.
InternalError Internal error.
InvalidParameter.InvalidParameter Invalid parameter.
InvalidParameterValue.AccountFaceNumExceed The number of faces in the account exceeds the limit.
InvalidParameterValue.DeleteFaceNumExceed The number of faces to be deleted exceeds the limit. Every person must have at least one face image.
InvalidParameterValue.FaceModelVersionIllegal The algorithm model version is invalid.
InvalidParameterValue.GroupExDescriptionsExceed The array length of the group's custom description fields exceeds the limit. Up to 5 fields can be created.
InvalidParameterValue.GroupExDescriptionsNameIdentical The name of the group's custom description field must be unique.
InvalidParameterValue.GroupExDescriptionsNameIllegal The name of the group's custom description field contains invalid characters. It can contain only letters, -, _, and digits.
InvalidParameterValue.GroupExDescriptionsNameTooLong The name of the group's custom description field exceeds the length limit.
InvalidParameterValue.GroupFaceNumExceed The number of faces in the group exceeds the limit.
InvalidParameterValue.GroupIdAlreadyExist The group ID already exists. It must be unique.
InvalidParameterValue.GroupIdIllegal The group ID contains invalid characters. It can contain only letters, digits, and special symbols (-%@#&_).
InvalidParameterValue.GroupIdNotExist The group ID does not exist.
InvalidParameterValue.GroupIdTooLong The group ID exceeds the length limit.
InvalidParameterValue.GroupIdsExceed The list of groups passed in exceeds the limit.
InvalidParameterValue.GroupNameAlreadyExist The group name already exists. It must be unique.
InvalidParameterValue.GroupNameIllegal The group name contains invalid characters. It can contain only letters, -, _, and digits.
InvalidParameterValue.GroupNameTooLong The group name exceeds the length limit.
InvalidParameterValue.GroupNumExceed The number of groups exceeds the limit. If you need more, please contact us.
InvalidParameterValue.GroupNumPerPersonExceed The number of groups exceeds the limit. One person can be added to up to 100 groups.
InvalidParameterValue.GroupTagIllegal The group remarks field contains invalid characters. It can contain only letters, -, _, and digits.
InvalidParameterValue.GroupTagTooLong The group remarks field exceeds the length limit.
InvalidParameterValue.ImageEmpty Empty image.
InvalidParameterValue.LimitExceed The number of returned results exceeds the limit.
InvalidParameterValue.NoFaceInGroups There are no faces in the specified group.
InvalidParameterValue.NoFaceInPhoto There are no faces in the image.
InvalidParameterValue.OffsetExceed The starting number is too large. Please check the length of the array to be requested.
InvalidParameterValue.PersonExDescriptionInfosExceed The array length of the person's custom description fields exceeds the limit. Up to 5 fields are allowed.
InvalidParameterValue.PersonExDescriptionsNameIdentical The name of the person's custom description field must be unique.
InvalidParameterValue.PersonExDescriptionsNameIllegal The name of the person's custom description field contains invalid characters. It can contain only letters, -, _, and digits.
InvalidParameterValue.PersonExDescriptionsNameTooLong The name of the person's custom description field exceeds the length limit.
InvalidParameterValue.PersonExistInGroup The ID of the corresponding person is already in the group.
InvalidParameterValue.PersonFaceNumExceed The number of face images for the person exceeds the limit. One person can have up to 5 face images.
InvalidParameterValue.PersonGenderIllegal An error occurred while setting person gender. 0: empty; 1: male; 2: female.
InvalidParameterValue.PersonIdAlreadyExist The person ID already exists. It must be unique.
InvalidParameterValue.PersonIdIllegal The person ID contains invalid characters. It can contain only letters, digits, and -%@#&_.
InvalidParameterValue.PersonIdNotExist The person ID does not exist.
InvalidParameterValue.PersonIdTooLong The person ID field exceeds the length limit.
InvalidParameterValue.PersonNameIllegal The person name contains invalid characters. It can contain only letters, -, _, and digits.
InvalidParameterValue.PersonNameTooLong The person name exceeds the length limit.
InvalidParameterValue.SearchPersonsExceed The number of persons searched for exceeds the limit.
InvalidParameterValue.UploadFaceNumExceed Up to four faces can be uploaded at a time.
InvalidParameterValue.UrlIllegal Invalid URL format.
LimitExceeded.ErrorFaceNumExceed The number of faces exceeds the limit.
MissingParameter.ErrorParameterEmpty A required parameter is empty.
ResourceUnavailable.Delivering The resource is being shipped.
ResourceUnavailable.Freeze The account is frozen.
ResourceUnavailable.InArrears The account is in arrears.
ResourceUnavailable.LowBalance Insufficient balance.
ResourceUnavailable.NotExist The billing status is unknown. Please check whether the service has been activated in the console.
ResourceUnavailable.Recover The resource has been repossessed.
ResourceUnavailable.StopUsing The service has been suspended for the account.
ResourceUnavailable.UnknownStatus The billing status is unknown.
ResourcesSoldOut.ChargeStatusException The billing status is exceptional.
UnsupportedOperation.UnknowMethod Unknown method name.