Person Directory Operations - Create Dynamic Person Group With Person

Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData.
A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group.

Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against persons.

No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until Person Directory "Delete Person" or "Delete Person Face" is called.

'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided during "Identify" determine the 'recognitionModel' used.

PUT {endpoint}/face/{apiVersion}/dynamicpersongroups/{dynamicPersonGroupId}

URI Parameters

Name In Required Type Description
apiVersion
path True

string

API Version

dynamicPersonGroupId
path True

string

ID of the dynamic person group.

Regex pattern: ^[a-z0-9-_]+$

endpoint
path True

string

uri

Supported Cognitive Services endpoints (protocol and hostname, for example: https://{resource-name}.cognitiveservices.azure.com).

Request Body

Name Required Type Description
addPersonIds True

string[]

Array of personIds created by Person Directory "Create Person" to be added.

name True

string

User defined name, maximum length is 128.

userData

string

Optional user defined data. Length should not exceed 16K.

Responses

Name Type Description
202 Accepted

A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. The URL provides the status of when Person Directory "Get Dynamic Person Group References" will return the changes made in this request.

Headers

operation-Location: string

Other Status Codes

FaceErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

Ocp-Apim-Subscription-Key

The secret key for your Azure AI Face subscription.

Type: apiKey
In: header

AADToken

The Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: accessCode
Authorization URL: https://api.example.com/oauth2/authorize
Token URL: https://api.example.com/oauth2/token

Scopes

Name Description
https://cognitiveservices.azure.com/.default

Examples

Create DynamicPersonGroup

Sample request

PUT {endpoint}/face/v1.2-preview.1/dynamicpersongroups/your_dynamic_person_group_id

{
  "name": "your_dynamic_person_group_name",
  "userData": "your_user_data",
  "addPersonIds": [
    "85c0c630-c9c9-40f8-8a4e-f9ae4f926ea5"
  ]
}

Sample response

operation-Location: https://contoso.com/operationstatus

Definitions

Name Description
FaceError

The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.

FaceErrorResponse

A response containing error details.

FaceError

The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.

Name Type Description
code

string

One of a server-defined set of error codes.

message

string

A human-readable representation of the error.

FaceErrorResponse

A response containing error details.

Name Type Description
error

FaceError

The error object.