1---2name: face-client3description: Face Client API skill. Use when working with Face Client for findsimilars, group, identify. Covers 63 endpoints.4---5
6# Face Client
7API version: 1.0
8
9## Auth
10ApiKey Ocp-Apim-Subscription-Key in header
11
12## Base URL
13Not specified.
14
15## Setup
161. Set your API key in the appropriate header
172. GET /persongroups -- verify access
183. POST /findsimilars -- create first findsimilars
19
20## Endpoints
21
2263 endpoints across 11 groups. See references/api-spec.lap for full details.
23
24### findsimilars
25| Method | Path | Description |
26|--------|------|-------------|
27| POST | /findsimilars | Given query face's faceId, to search the similar-looking faces from a faceId array, a face list or a large face list. faceId array contains the faces created by [Face - Detect With Url](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl) or [Face - Detect With Stream](https://docs.microsoft.com/rest/api/faceapi/face/detectwithstream), which will expire at the time specified by faceIdTimeToLive after creation. A "faceListId" is created by [FaceList - Create](https://docs.microsoft.com/rest/api/faceapi/facelist/create) containing persistedFaceIds that will not expire. And a "largeFaceListId" is created by [LargeFaceList - Create](https://docs.microsoft.com/rest/api/faceapi/largefacelist/create) containing persistedFaceIds that will also not expire. Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. |
28
29### group
30| Method | Path | Description |
31|--------|------|-------------|
32| POST | /group | Divide candidate faces into groups based on face similarity.<br /> |
33
34### identify
35| Method | Path | Description |
36|--------|------|-------------|
37| POST | /identify | 1-to-many identification to find the closest matches of the specific query person face from a person group or large person group. |
38
39### verify
40| Method | Path | Description |
41|--------|------|-------------|
42| POST | /verify | Verify whether two faces belong to a same person or whether one face belongs to a person. |
43
44### persongroups
45| Method | Path | Description |
46|--------|------|-------------|
47| POST | /persongroups/{personGroupId}/persons | Create a new person in a specified person group. |
48| GET | /persongroups/{personGroupId}/persons | List all persons in a person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person). |
49| DELETE | /persongroups/{personGroupId}/persons/{personId} | Delete an existing person from a person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted. |
50| GET | /persongroups/{personGroupId}/persons/{personId} | Retrieve a person's information, including registered persisted faces, name and userData. |
51| PATCH | /persongroups/{personGroupId}/persons/{personId} | Update name or userData of a person. |
52| DELETE | /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId} | Delete a face from a person in a person group by specified personGroupId, personId and persistedFaceId. |
53| GET | /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId} | Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId). |
54| PATCH | /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId} | 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. |
55| PUT | /persongroups/{personGroupId} | Create a new person group with specified personGroupId, name, user-provided userData and recognitionModel. |
56| DELETE | /persongroups/{personGroupId} | Delete an existing person group. Persisted face features of all people in the person group will also be deleted. |
57| GET | /persongroups/{personGroupId} | 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). |
58| PATCH | /persongroups/{personGroupId} | Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated. |
59| GET | /persongroups/{personGroupId}/training | Retrieve the training status of a person group (completed or ongoing). |
60| GET | /persongroups | List person groups’ personGroupId, name, userData and recognitionModel.<br /> |
61| POST | /persongroups/{personGroupId}/train | Queue a person group training task, the training task may not be started immediately. |
62| POST | /persongroups/{personGroupId}/persons/{personId}/persistedfaces | 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. |
63
64### facelists
65| Method | Path | Description |
66|--------|------|-------------|
67| PUT | /facelists/{faceListId} | Create an empty face list with user-specified faceListId, name, an optional userData and recognitionModel. Up to 64 face lists are allowed in one subscription. |
68| GET | /facelists/{faceListId} | Retrieve a face list’s faceListId, name, userData, recognitionModel and faces in the face list. |
69| PATCH | /facelists/{faceListId} | Update information of a face list. |
70| DELETE | /facelists/{faceListId} | Delete a specified face list. |
71| GET | /facelists | List face lists’ faceListId, name, userData and recognitionModel. <br /> |
72| DELETE | /facelists/{faceListId}/persistedfaces/{persistedFaceId} | Delete a face from a face list by specified faceListId and persistedFaceId. |
73| POST | /facelists/{faceListId}/persistedfaces | Add a face to a specified face list, up to 1,000 faces. |
74
75### detect
76| Method | Path | Description |
77|--------|------|-------------|
78| POST | /detect | Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.<br /> |
79
80### largepersongroups
81| Method | Path | Description |
82|--------|------|-------------|
83| POST | /largepersongroups/{largePersonGroupId}/persons | Create a new person in a specified large person group. |
84| GET | /largepersongroups/{largePersonGroupId}/persons | List all persons in a large person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person). |
85| DELETE | /largepersongroups/{largePersonGroupId}/persons/{personId} | Delete an existing person from a large person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted. |
86| GET | /largepersongroups/{largePersonGroupId}/persons/{personId} | Retrieve a person's name and userData, and the persisted faceIds representing the registered person face feature. |
87| PATCH | /largepersongroups/{largePersonGroupId}/persons/{personId} | Update name or userData of a person. |
88| DELETE | /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId} | Delete a face from a person in a large person group by specified largePersonGroupId, personId and persistedFaceId. |
89| GET | /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId} | Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging largePersonGroupId). |
90| PATCH | /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId} | Update a person persisted face's userData field. |
91| PUT | /largepersongroups/{largePersonGroupId} | Create a new large person group with user-specified largePersonGroupId, name, an optional userData and recognitionModel. |
92| DELETE | /largepersongroups/{largePersonGroupId} | Delete an existing large person group. Persisted face features of all people in the large person group will also be deleted. |
93| GET | /largepersongroups/{largePersonGroupId} | Retrieve the information of a large person group, including its name, userData and recognitionModel. This API returns large person group information only, use [LargePersonGroup Person - List](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/list) instead to retrieve person information under the large person group. |
94| PATCH | /largepersongroups/{largePersonGroupId} | Update an existing large person group's display name and userData. The properties which does not appear in request body will not be updated. |
95| GET | /largepersongroups/{largePersonGroupId}/training | Retrieve the training status of a large person group (completed or ongoing). |
96| GET | /largepersongroups | List all existing large person groups’ largePersonGroupId, name, userData and recognitionModel.<br /> |
97| POST | /largepersongroups/{largePersonGroupId}/train | Queue a large person group training task, the training task may not be started immediately. |
98| POST | /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces | Add a face to a person into a large 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 [LargePersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/deleteface), [LargePersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/delete) or [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/delete) is called. |
99
100### largefacelists
101| Method | Path | Description |
102|--------|------|-------------|
103| PUT | /largefacelists/{largeFaceListId} | Create an empty large face list with user-specified largeFaceListId, name, an optional userData and recognitionModel. |
104| GET | /largefacelists/{largeFaceListId} | Retrieve a large face list’s largeFaceListId, name, userData and recognitionModel. |
105| PATCH | /largefacelists/{largeFaceListId} | Update information of a large face list. |
106| DELETE | /largefacelists/{largeFaceListId} | Delete a specified large face list. |
107| GET | /largefacelists/{largeFaceListId}/training | Retrieve the training status of a large face list (completed or ongoing). |
108| GET | /largefacelists | List large face lists’ information of largeFaceListId, name, userData and recognitionModel. <br /> |
109| POST | /largefacelists/{largeFaceListId}/train | Queue a large face list training task, the training task may not be started immediately. |
110| DELETE | /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId} | Delete a face from a large face list by specified largeFaceListId and persistedFaceId. |
111| GET | /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId} | Retrieve information about a persisted face (specified by persistedFaceId and its belonging largeFaceListId). |
112| PATCH | /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId} | Update a persisted face's userData field. |
113| POST | /largefacelists/{largeFaceListId}/persistedfaces | Add a face to a specified large face list, up to 1,000,000 faces. |
114| GET | /largefacelists/{largeFaceListId}/persistedfaces | List all faces in a large face list, and retrieve face information (including userData and persistedFaceIds of registered faces of the face). |
115
116### snapshots
117| Method | Path | Description |
118|--------|------|-------------|
119| POST | /snapshots | Submit an operation to take a snapshot of face list, large face list, person group or large person group, with user-specified snapshot type, source object id, apply scope and an optional user data.<br /> |
120| GET | /snapshots | List all accessible snapshots with related information, including snapshots that were taken by the user, or snapshots to be applied to the user (subscription id was included in the applyScope in Snapshot - Take). |
121| GET | /snapshots/{snapshotId} | Retrieve information about a snapshot. Snapshot is only accessible to the source subscription who took it, and target subscriptions included in the applyScope in Snapshot - Take. |
122| PATCH | /snapshots/{snapshotId} | Update the information of a snapshot. Only the source subscription who took the snapshot can update the snapshot. |
123| DELETE | /snapshots/{snapshotId} | Delete an existing snapshot according to the snapshotId. All object data and information in the snapshot will also be deleted. Only the source subscription who took the snapshot can delete the snapshot. If the user does not delete a snapshot with this API, the snapshot will still be automatically deleted in 48 hours after creation. |
124| POST | /snapshots/{snapshotId}/apply | Submit an operation to apply a snapshot to current subscription. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.<br /> |
125
126### operations
127| Method | Path | Description |
128|--------|------|-------------|
129| GET | /operations/{operationId} | Retrieve the status of a take/apply snapshot operation. |
130
131## Common Questions
132
133Match user requests to endpoints in references/api-spec.lap. Key patterns:
134- "Create a findsimilar?" -> POST /findsimilars
135- "Create a group?" -> POST /group
136- "Create a identify?" -> POST /identify
137- "Create a verify?" -> POST /verify
138- "Create a person?" -> POST /persongroups/{personGroupId}/persons
139- "List all persons?" -> GET /persongroups/{personGroupId}/persons
140- "Delete a person?" -> DELETE /persongroups/{personGroupId}/persons/{personId}
141- "Get person details?" -> GET /persongroups/{personGroupId}/persons/{personId}
142- "Partially update a person?" -> PATCH /persongroups/{personGroupId}/persons/{personId}
143- "Delete a persistedface?" -> DELETE /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}
144- "Get persistedface details?" -> GET /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}
145- "Partially update a persistedface?" -> PATCH /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}
146- "Update a persongroup?" -> PUT /persongroups/{personGroupId}
147- "Delete a persongroup?" -> DELETE /persongroups/{personGroupId}
148- "Get persongroup details?" -> GET /persongroups/{personGroupId}
149- "Partially update a persongroup?" -> PATCH /persongroups/{personGroupId}
150- "List all training?" -> GET /persongroups/{personGroupId}/training
151- "List all persongroups?" -> GET /persongroups
152- "Create a train?" -> POST /persongroups/{personGroupId}/train
153- "Update a facelist?" -> PUT /facelists/{faceListId}
154- "Get facelist details?" -> GET /facelists/{faceListId}
155- "Partially update a facelist?" -> PATCH /facelists/{faceListId}
156- "Delete a facelist?" -> DELETE /facelists/{faceListId}
157- "List all facelists?" -> GET /facelists
158- "Delete a persistedface?" -> DELETE /facelists/{faceListId}/persistedfaces/{persistedFaceId}
159- "Create a persistedface?" -> POST /persongroups/{personGroupId}/persons/{personId}/persistedfaces
160- "Create a detect?" -> POST /detect
161- "Create a persistedface?" -> POST /facelists/{faceListId}/persistedfaces
162- "Create a person?" -> POST /largepersongroups/{largePersonGroupId}/persons
163- "List all persons?" -> GET /largepersongroups/{largePersonGroupId}/persons
164- "Delete a person?" -> DELETE /largepersongroups/{largePersonGroupId}/persons/{personId}
165- "Get person details?" -> GET /largepersongroups/{largePersonGroupId}/persons/{personId}
166- "Partially update a person?" -> PATCH /largepersongroups/{largePersonGroupId}/persons/{personId}
167- "Delete a persistedface?" -> DELETE /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}
168- "Get persistedface details?" -> GET /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}
169- "Partially update a persistedface?" -> PATCH /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}
170- "Update a largepersongroup?" -> PUT /largepersongroups/{largePersonGroupId}
171- "Delete a largepersongroup?" -> DELETE /largepersongroups/{largePersonGroupId}
172- "Get largepersongroup details?" -> GET /largepersongroups/{largePersonGroupId}
173- "Partially update a largepersongroup?" -> PATCH /largepersongroups/{largePersonGroupId}
174- "List all training?" -> GET /largepersongroups/{largePersonGroupId}/training
175- "List all largepersongroups?" -> GET /largepersongroups
176- "Create a train?" -> POST /largepersongroups/{largePersonGroupId}/train
177- "Create a persistedface?" -> POST /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces
178- "Update a largefacelist?" -> PUT /largefacelists/{largeFaceListId}
179- "Get largefacelist details?" -> GET /largefacelists/{largeFaceListId}
180- "Partially update a largefacelist?" -> PATCH /largefacelists/{largeFaceListId}
181- "Delete a largefacelist?" -> DELETE /largefacelists/{largeFaceListId}
182- "List all training?" -> GET /largefacelists/{largeFaceListId}/training
183- "List all largefacelists?" -> GET /largefacelists
184- "Create a train?" -> POST /largefacelists/{largeFaceListId}/train
185- "Delete a persistedface?" -> DELETE /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}
186- "Get persistedface details?" -> GET /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}
187- "Partially update a persistedface?" -> PATCH /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}
188- "Create a persistedface?" -> POST /largefacelists/{largeFaceListId}/persistedfaces
189- "List all persistedfaces?" -> GET /largefacelists/{largeFaceListId}/persistedfaces
190- "Create a snapshot?" -> POST /snapshots
191- "List all snapshots?" -> GET /snapshots
192- "Get snapshot details?" -> GET /snapshots/{snapshotId}
193- "Partially update a snapshot?" -> PATCH /snapshots/{snapshotId}
194- "Delete a snapshot?" -> DELETE /snapshots/{snapshotId}
195- "Create a apply?" -> POST /snapshots/{snapshotId}/apply
196- "Get operation details?" -> GET /operations/{operationId}
197- "How to authenticate?" -> See Auth section
198
199## Response Tips
200- Check response schemas in references/api-spec.lap for field details
201- Create/update endpoints typically return the created/updated object
202
203## References
204- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas
205
206> Generated from the official API spec by [LAP](https://lap.sh)