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

# Agregar un nuevo rostro

> Cargue y almacene una nueva imagen facial dentro de una colección específica

La sección "Agregar un nuevo rostro a una colección" permite a los usuarios cargar y almacenar fácilmente una nueva imagen facial dentro de una colección específica. Al utilizar esta funcionalidad, los usuarios pueden gestionar y organizar eficientemente sus datos de reconocimiento facial agregando nuevos rostros a su base de datos existente. Esta sección optimiza el proceso de expandir colecciones con datos faciales adicionales para mejorar la precisión y eficiencia en aplicaciones de reconocimiento facial.

## Solicitud

### Headers

<ParamField header="x-api-key" type="string" required>
  La clave API utilizada para autenticación y control de acceso. Este parámetro de encabezado es requerido para autorización al agregar un nuevo rostro a una colección.
</ParamField>

### Parámetros del Body

<ParamField header="collectionId" type="string" required>
  Identificador único de la colección donde se agregará el rostro.
</ParamField>

<ParamField header="userName" type="string" required>
  Nombre asociado al rostro que se está agregando a la colección.
</ParamField>

<ParamField header="faceImage" type="string" required>
  Representación en cadena codificada en Base64 de la imagen facial.
</ParamField>

## Respuesta

### Respuesta Exitosa (200)

<ResponseField name="message" type="string">
  Un mensaje de éxito o error que indica el resultado del envío del rostro.
</ResponseField>

<ResponseField name="faceId" type="string">
  Identificador único para el envío del rostro.
</ResponseField>

<ResponseField name="metaFaceId" type="string">
  Identificador único correspondiente a los metadatos del envío del rostro.
</ResponseField>

<ResponseField name="option" type="object">
  Opciones adicionales y metadatos para el envío del rostro.
</ResponseField>

### Respuestas de Error

#### Bad Request (400)

<ResponseField name="errorCode" type="number">
  Identifica el error específico para resolución de problemas:

  * 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">
  Describe brevemente el error. Consulte el código de error para más detalles.
</ResponseField>

#### Forbidden (403)

<ResponseField name="errorCode" type="number">
  Identifica el error específico para resolución de problemas.
</ResponseField>

<ResponseField name="message" type="string">
  Describe brevemente el 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

````