> ## Documentation Index
> Fetch the complete documentation index at: https://developers.argosidentity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a new face

> Upload and store a new facial image within a specific collection

The "Add a new face to a collection" section allows users to easily upload and store a new facial image within a specific collection. By utilizing this functionality, users can efficiently manage and organize their facial recognition data by adding new faces to their existing database. This section streamlines the process of expanding collections with additional facial data for enhanced accuracy and efficiency in facial recognition applications.

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  The API key used for authentication and access control. This header parameter is required for authorization to add a new face to a collection.
</ParamField>

### Body Parameters

<ParamField header="collectionId" type="string" required>
  Unique identifier of the collection where the face will be added.
</ParamField>

<ParamField header="userName" type="string" required>
  Name associated with the face being added to the collection.
</ParamField>

<ParamField header="faceImage" type="string" required>
  Base64-encoded string representation of the face image.
</ParamField>

## Response

### Success Response (200)

<ResponseField name="message" type="string">
  A success or error message indicating the result of the face submission
</ResponseField>

<ResponseField name="faceId" type="string">
  Unique identifier for the face submission.
</ResponseField>

<ResponseField name="metaFaceId" type="string">
  Unique identifier corresponding to the metadata of the face submission.
</ResponseField>

<ResponseField name="option" type="object">
  Additional options and metadata for the face submission.
</ResponseField>

### Error Responses

#### Bad Request (400)

<ResponseField name="errorCode" type="number">
  Identifies the specific error for troubleshooting:

  * 6010: CollectionId is required
  * 6011: WorkspaceId is required
  * 6012: Fail to add face
  * 6013: Cannot find collection info
  * 6014: This collection is unavailable
  * 6015: Failed to validate liveness of face
  * 6016: Image size is too large
  * 6017: Unsupported image format
</ResponseField>

<ResponseField name="message" type="string">
  Briefly describes the error. Please refer to the error code for details.
</ResponseField>

#### Forbidden (403)

<ResponseField name="errorCode" type="number">
  Identifies the specific error for troubleshooting.
</ResponseField>

<ResponseField name="message" type="string">
  Briefly describes the error:

  * API Key is required
  * Access Denied: API Key is unavailable
</ResponseField>


## OpenAPI

````yaml POST /faces
openapi: 3.1.0
info:
  title: Face ID API
  description: >-
    API for facial recognition and identity verification using Face ID
    technology
  version: 1.0.0
servers:
  - url: https://face.argosidentity.com
    description: Production server
security: []
paths:
  /faces:
    post:
      tags:
        - Face ID
      summary: Add a new face to a collection
      description: Upload and store a new facial image within a specific collection
      operationId: addFace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - collectionId
                - userName
                - faceImage
              properties:
                collectionId:
                  type: string
                  description: >-
                    Unique identifier of the collection where the face will be
                    added
                  example: col_123456789
                userName:
                  type: string
                  description: Name associated with the face being added to the collection
                  example: John Doe
                faceImage:
                  type: string
                  description: Base64-encoded string representation of the face image
                  example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...
      responses:
        '200':
          description: Face successfully added to collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Success message
                    example: Face added successfully
                  faceId:
                    type: string
                    description: Unique identifier for the face submission
                    example: face_123456789
                  metaFaceId:
                    type: string
                    description: >-
                      Unique identifier corresponding to the metadata of the
                      face submission
                    example: meta_123456789
                  option:
                    type: object
                    description: Additional options and metadata for the face submission
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  errorCode:
                    type: number
                    description: Error code
                    enum:
                      - 6010
                      - 6011
                      - 6012
                      - 6013
                      - 6014
                      - 6015
                      - 6016
                      - 6017
                  message:
                    type: string
                    description: Error message
        '403':
          description: Forbidden - Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  errorCode:
                    type: number
                    description: Error code
                    enum:
                      - 6039
                      - 6040
                  message:
                    type: string
                    description: Error message
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````