Person Directory Operations - Create Person

Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person Face".

POST {endpoint}/face/{apiVersion}/persons

URI Parameters

Name In Required Type Description
apiVersion
path True

string

API Version

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
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

CreatePersonResult

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.

Headers

  • Location: string
  • 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 Person in PersonDirectory

Sample request

POST {endpoint}/face/v1.2-preview.1/persons

{
  "name": "your_person_name",
  "userData": "your_user_data"
}

Sample response

location: https://contoso.com/operationstatus
operation-Location: https://contoso.com/operationstatus
{
  "personId": "85c0c630-c9c9-40f8-8a4e-f9ae4f926ea5"
}

Definitions

Name Description
CreatePersonResult

Response of create person.

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.

UserDefinedFields

User defined fields for object creation.

CreatePersonResult

Response of create person.

Name Type Description
personId

string

Person ID of the person.

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.

UserDefinedFields

User defined fields for object creation.

Name Type Description
name

string

User defined name, maximum length is 128.

userData

string

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