swagger: '2.0'
info:
version: 2020-08-01-preview
title: Microsoft Azure AccessControlClient AccessConnector Persongroups API
schemes:
- https
tags:
- name: Persongroups
paths:
/persongroups/{personGroupId}/persons:
post:
description: Create a new person in a specified person group.
operationId: microsoftAzurePersongrouppersonCreate
parameters:
- $ref: '#/parameters/personGroupId'
- name: body
description: Request body for creating new person.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/NameAndUserDataContract'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns a new personId created.
schema:
$ref: '#/definitions/Person'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Create new person for person group example:
$ref: ./examples/CreateNewPersonGroupPerson.json
summary: Microsoft Azure Post Persongroups Persongroupid Persons
tags:
- Persongroups
get:
description: List all persons in a person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person).
operationId: microsoftAzurePersongrouppersonList
parameters:
- $ref: '#/parameters/personGroupId'
- name: start
description: Starting person id to return (used to list a range of persons).
in: query
required: false
type: string
- name: top
description: Number of persons to return starting with the person id indicated by the 'start' parameter.
in: query
required: false
type: integer
minimum: 1
maximum: 1000
produces:
- application/json
responses:
'200':
description: A successful call returns an array of person information that belong to the person group.
schema:
$ref: '#/definitions/Persons'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
List persons in person group:
$ref: ./examples/ListPersonGroupPersons.json
summary: Microsoft Azure Get Persongroups Persongroupid Persons
tags:
- Persongroups
/persongroups/{personGroupId}/persons/{personId}:
delete:
description: Delete an existing person from a person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted.
operationId: microsoftAzurePersongrouppersonDelete
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/personId'
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Delete an existing person example:
$ref: ./examples/DeletePersonGroupPerson.json
summary: Microsoft Azure Delete Persongroups Persongroupid Persons Personid
tags:
- Persongroups
get:
description: Retrieve a person's information, including registered persisted faces, name and userData.
operationId: microsoftAzurePersongrouppersonGet
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/personId'
produces:
- application/json
responses:
'200':
description: A successful call returns the person's information.
schema:
$ref: '#/definitions/Person'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Get person example:
$ref: ./examples/GetPersonGroupPerson.json
summary: Microsoft Azure Get Persongroups Persongroupid Persons Personid
tags:
- Persongroups
patch:
description: Update name or userData of a person.
operationId: microsoftAzurePersongrouppersonUpdate
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/personId'
- name: body
description: Request body for person update operation.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/NameAndUserDataContract'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Update person example:
$ref: ./examples/UpdatePersonGroupPerson.json
summary: Microsoft Azure Patch Persongroups Persongroupid Persons Personid
tags:
- Persongroups
/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}:
delete:
description: Delete a face from a person in a person group by specified personGroupId, personId and persistedFaceId.
Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.
operationId: microsoftAzurePersongrouppersonDeleteface
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/personId'
- $ref: '#/parameters/persistedFaceId'
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Delete face from person example:
$ref: ./examples/DeletePersonGroupPersonFace.json
summary: Microsoft Azure Delete Persongroups Persongroupid Persons Personid Persistedfaces Persistedfaceid
tags:
- Persongroups
get:
description: Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId).
operationId: microsoftAzurePersongrouppersonGetface
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/personId'
- $ref: '#/parameters/persistedFaceId'
produces:
- application/json
responses:
'200':
description: A successful call returns target persisted face's information (persistedFaceId and userData).
schema:
$ref: '#/definitions/PersistedFace'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Get persisted face example:
$ref: ./examples/GetPersonGroupPersistedFace.json
summary: Microsoft Azure Get Persongroups Persongroupid Persons Personid Persistedfaces Persistedfaceid
tags:
- Persongroups
patch:
description: 'Add a face to a person into a person group for face identification or verification. To deal with an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [PersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/deleteface), [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl).
* Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
* Each person entry can hold up to 248 faces.
* JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
* "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully.
* Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures.
* Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.'
operationId: microsoftAzurePersongrouppersonUpdateface
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/personId'
- $ref: '#/parameters/persistedFaceId'
- name: body
description: Request body for updating persisted face.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/UpdateFaceRequest'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Update person face example:
$ref: ./examples/UpdatePersonGroupPersonFace.json
summary: Microsoft Azure Patch Persongroups Persongroupid Persons Personid Persistedfaces Persistedfaceid
tags:
- Persongroups
/persongroups/{personGroupId}:
put:
description: 'Create a new person group with specified personGroupId, name, user-provided userData and recognitionModel.
A person group is the container of the uploaded person data, including face recognition features.
After creation, use [PersonGroup Person - Create](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/create) to add persons into the group, and then call [PersonGroup - Train](https://docs.microsoft.com/rest/api/faceapi/persongroup/train) to get this group ready for [Face - Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).
No image will be stored. Only the person''s extracted face features and userData will be stored on server until [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.
''recognitionModel'' should be specified to associate with this person group. The default value for ''recognitionModel'' is ''recognition_01'', if the latest model needed, please explicitly specify the model you need in this parameter. New faces that are added to an existing person group will use the recognition model that''s already associated with the collection. Existing face features in a person group can''t be updated to features extracted by another version of recognition model.
Person group quota:
* Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000 persons.
* S0-tier subscription quota: 1,000,000 person groups. Each holds up to 10,000 persons.
* to handle larger scale face identification problem, please consider using [LargePersonGroup](https://docs.microsoft.com/rest/api/faceapi/largepersongroup).'
operationId: microsoftAzurePersongroupCreate
parameters:
- $ref: '#/parameters/personGroupId'
- name: body
description: Request body for creating new person group.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/MetaDataContract'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Create new person group example:
$ref: ./examples/CreateNewPersonGroup.json
summary: Microsoft Azure Put Persongroups Persongroupid
tags:
- Persongroups
delete:
description: Delete an existing person group. Persisted face features of all people in the person group will also be deleted.
operationId: microsoftAzurePersongroupDelete
parameters:
- $ref: '#/parameters/personGroupId'
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Delete a person group example:
$ref: ./examples/DeletePersonGroup.json
summary: Microsoft Azure Delete Persongroups Persongroupid
tags:
- Persongroups
get:
description: Retrieve person group name, userData and recognitionModel. To get person information under this personGroup, use [PersonGroup Person - List](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/list).
operationId: microsoftAzurePersongroupGet
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/returnRecognitionModel'
responses:
'200':
description: A successful call returns the person group's information.
schema:
$ref: '#/definitions/PersonGroup'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
produces:
- application/json
x-ms-examples:
Get person group example:
$ref: ./examples/GetPersonGroup.json
summary: Microsoft Azure Get Persongroups Persongroupid
tags:
- Persongroups
patch:
description: Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated.
operationId: microsoftAzurePersongroupUpdate
parameters:
- $ref: '#/parameters/personGroupId'
- name: body
description: Request body for updating person group.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/NameAndUserDataContract'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Update person group example:
$ref: ./examples/UpdatePersonGroup.json
summary: Microsoft Azure Patch Persongroups Persongroupid
tags:
- Persongroups
/persongroups/{personGroupId}/training:
get:
description: Retrieve the training status of a person group (completed or ongoing).
operationId: microsoftAzurePersongroupGettrainingstatus
parameters:
- $ref: '#/parameters/personGroupId'
responses:
'200':
description: A successful call returns the person group's training status.
schema:
$ref: '#/definitions/TrainingStatus'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
produces:
- application/json
x-ms-examples:
Get person group's training status example:
$ref: ./examples/GetPersonGroupTrainingStatus.json
summary: Microsoft Azure Get Persongroups Persongroupid Training
tags:
- Persongroups
/persongroups:
get:
description: 'List person groups’ personGroupId, name, userData and recognitionModel.
* Person groups are stored in alphabetical order of personGroupId.
* "start" parameter (string, optional) is a user-provided personGroupId value that returned entries have larger ids by string comparison. "start" set to empty to indicate return from the first item.
* "top" parameter (int, optional) specifies the number of entries to return. A maximal of 1000 entries can be returned in one call. To fetch more, you can specify "start" with the last returned entry’s Id of the current call.
For example, total 5 person groups: "group1", ..., "group5".
"start=&top=" will return all 5 groups.
"start=&top=2" will return "group1", "group2".
"start=group2&top=3" will return "group3", "group4", "group5".
'
operationId: microsoftAzurePersongroupList
parameters:
- name: start
in: query
required: false
description: List person groups from the least personGroupId greater than the "start".
type: string
maxLength: 64
- name: top
in: query
required: false
description: The number of person groups to list.
type: integer
minimum: 1
maximum: 1000
default: 1000
- $ref: '#/parameters/returnRecognitionModel'
produces:
- application/json
responses:
'200':
description: A successful call returns an array of person groups and their information.
schema:
$ref: '#/definitions/PersonGroups'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
List person groups example:
$ref: ./examples/ListPersonGroups.json
summary: Microsoft Azure Get Persongroups
tags:
- Persongroups
/persongroups/{personGroupId}/train:
post:
description: Queue a person group training task, the training task may not be started immediately.
operationId: microsoftAzurePersongroupTrain
parameters:
- $ref: '#/parameters/personGroupId'
produces:
- application/json
responses:
'202':
description: The training task was queued successfully.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Queue person group training:
$ref: ./examples/QueuePersonGroupTraining.json
summary: Microsoft Azure Post Persongroups Persongroupid Train
tags:
- Persongroups
/persongroups/{personGroupId}/persons/{personId}/persistedfaces:
post:
description: 'Add a face to a person into a person group for face identification or verification. To deal with an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [PersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/deleteface), [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl).
* Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
* Each person entry can hold up to 248 faces.
* JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
* "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully.
* Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures.
* Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.
* The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size.
* Different ''detectionModel'' values can be provided. To use and compare different detection models, please refer to [How to specify a detection model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model).'
operationId: microsoftAzurePersongrouppersonAddfacefromurl
parameters:
- $ref: '#/parameters/personGroupId'
- $ref: '#/parameters/personId'
- $ref: '#/parameters/faceUserData'
- $ref: '#/parameters/targetFace'
- $ref: ../../../Common/Parameters.json#/parameters/ImageUrl
- $ref: '#/parameters/detectionModel'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns the new persistedFaceId.
schema:
$ref: '#/definitions/PersistedFace'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Add Person face example:
$ref: ./examples/AddPersonGroupPersonFaceFromUrl.json
summary: Microsoft Azure Post Persongroups Persongroupid Persons Personid Persistedfaces
tags:
- Persongroups
definitions:
TrainingStatus:
type: object
required:
- status
- createdDateTime
description: Training status object.
properties:
status:
type: string
description: 'Training status: notstarted, running, succeeded, failed. If the training process is waiting to perform, the status is notstarted. If the training is ongoing, the status is running. Status succeed means this person group or large person group is ready for Face - Identify, or this large face list is ready for Face - Find Similar. Status failed is often caused by no person or no persisted face exist in the person group or large person group, or no persisted face exist in the large face list.'
x-ms-enum:
name: TrainingStatusType
modelAsString: false
enum:
- nonstarted
- running
- succeeded
- failed
createdDateTime:
type: string
format: date-time
description: A combined UTC date and time string that describes the created time of the person group, large person group or large face list.
x-ms-client-name: created
lastActionDateTime:
type: string
format: date-time
description: A combined UTC date and time string that describes the last modify time of the person group, large person group or large face list, could be null value when the group is not successfully trained.
x-ms-client-name: lastAction
lastSuccessfulTrainingDateTime:
type: string
format: date-time
description: A combined UTC date and time string that describes the last successful training time of the person group, large person group or large face list.
x-ms-client-name: lastSuccessfulTraining
message:
type: string
description: Show failure message when training failed (omitted when training succeed).
APIError:
type: object
description: Error information returned by the API
properties:
error:
$ref: '#/definitions/Error'
PersonGroups:
type: array
description: An array of person groups.
items:
$ref: '#/definitions/PersonGroup'
PersonGroup:
type: object
required:
- personGroupId
- name
description: Person group object.
properties:
personGroupId:
description: PersonGroupId of the target person group.
type: string
maxLength: 64
pattern: ^[a-z0-9-_]+$
name:
type: string
description: User defined name, maximum length is 128.
maxLength: 128
minLength: 1
userData:
type: string
description: User specified data. Length should not exceed 16KB.
maxLength: 16384
recognitionModel:
$ref: '#/definitions/RecognitionModel'
NameAndUserDataContractForCreation:
type: object
description: A combination of user defined name and user specified data for the person, largePersonGroup/personGroup, and largeFaceList/faceList.
required:
- name
properties:
name:
type: string
description: User defined name, maximum length is 128.
maxLength: 128
minLength: 1
userData:
type: string
description: User specified data. Length should not exceed 16KB.
maxLength: 16384
NameAndUserDataContract:
type: object
description: A combination of user defined name and user specified data for the person, largePersonGroup/personGroup, and largeFaceList/faceList.
properties:
name:
type: string
description: User defined name, maximum length is 128.
maxLength: 128
userData:
type: string
description: User specified data. Length should not exceed 16KB.
maxLength: 16384
PersistedFace:
type: object
required:
- persistedFaceId
description: PersonFace object.
properties:
persistedFaceId:
type: string
format: uuid
description: The persistedFaceId of the target face, which is persisted and will not expire. Different from faceId created by Face - Detect and will expire in at the time specified by faceIdTimeToLive after the detection call.
userData:
type: string
description: User-provided data attached to the face. The size limit is 1KB.
maxLength: 1024
UpdateFaceRequest:
type: object
description: Request to update face data.
properties:
userData:
type: string
description: User-provided data attached to the face. The size limit is 1KB.
maxLength: 1024
Person:
type: object
required:
- personId
description: Person object.
properties:
personId:
type: string
format: uuid
description: PersonId of the target face list.
persistedFaceIds:
type: array
description: PersistedFaceIds of registered faces in the person. These persistedFaceIds are returned from Person - Add a Person Face, and will not expire.
items:
type: string
format: uuid
x-nullable: false
allOf:
- $ref: '#/definitions/NameAndUserDataContract'
Error:
type: object
description: Error body.
properties:
code:
type: string
message:
type: string
RecognitionModel:
type: string
description: Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition model name can be provided when performing Face - Detect or (Large)FaceList - Create or (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, please explicitly specify the model you need.
default: recognition_01
x-nullable: false
x-ms-enum:
name: RecognitionModel
modelAsString: true
enum:
- recognition_01
- recognition_02
- recognition_03
- recognition_04
MetaDataContract:
type: object
description: A combination of user defined name and user specified data and recognition model name for largePersonGroup/personGroup, and largeFaceList/faceList.
properties:
recognitionModel:
$ref: '#/definitions/RecognitionModel'
allOf:
- $ref: '#/definitions/NameAndUserDataContractForCreation'
Persons:
type: array
description: An array of Persons.
items:
$ref: '#/definitions/Person'
parameters:
detectionModel:
name: detectionModel
description: Name of detection model. Detection model is used to detect faces in the submitted image. A detection model name can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify it.
default: detection_01
required: false
type: string
in: query
x-ms-parameter-location: method
x-nullable: false
x-ms-enum:
name: DetectionModel
modelAsString: true
enum:
- detection_01
- detection_02
- detection_03
persistedFaceId:
name: persistedFaceId
in: path
description: Id referencing a particular persistedFaceId of an existing face.
required: true
type: string
format: uuid
x-ms-parameter-location: method
collectionFormat: csv
faceUserData:
name: userData
in: query
description: User-specified data about the face for any purpose. The maximum length is 1KB.
type: string
maxLength: 1024
x-ms-parameter-location: method
required: false
collectionFormat: csv
personId:
name: personId
in: path
description: Id referencing a particular person.
required: true
type: string
format: uuid
x-ms-parameter-location: method
collectionFormat: csv
personGroupId:
name: personGroupId
in: path
description: Id referencing a particular person group.
required: true
type: string
x-ms-parameter-location: method
collectionFormat: csv
maxLength: 64
pattern: ^[a-z0-9-_]+$
targetFace:
name: targetFace
in: query
description: A face rectangle to specify the target face to be added to a person in the format of "targetFace=left,top,width,height". E.g. "targetFace=10,10,100,100". If there is more than one face in the image, targetFace is required to specify which face to add. No targetFace means there is only one face detected in the entire image.
type: array
x-ms-parameter-location: method
required: false
collectionFormat: csv
items:
type: integer
format: int32
x-nullable: false
maxItems: 4
minItems: 4
returnRecognitionModel:
name: returnRecognitionModel
description: A value indicating whether the operation should return 'recognitionModel' in response.
default: false
required: false
type: boolean
in: query
x-ms-parameter-location: method
x-ms-parameterized-host:
hostTemplate: '{endpoint}'
useSchemePrefix: false
parameters:
- $ref: '#/parameters/Endpoint'