:doc:`Rekognition <../../rekognition>` / Client / disassociate_faces

******************
disassociate_faces
******************



.. py:method:: Rekognition.Client.disassociate_faces(**kwargs)

  

  Removes the association between a ``Face`` supplied in an array of ``FaceIds`` and the User. If the User is not present already, then a ``ResourceNotFound`` exception is thrown. If successful, an array of faces that are disassociated from the User is returned. If a given face is already disassociated from the given UserID, it will be ignored and not be returned in the response. If a given face is already associated with a different User or not found in the collection it will be returned as part of ``UnsuccessfulDisassociations``. You can remove 1 - 100 face IDs from a user at one time.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rekognition-2016-06-27/DisassociateFaces>`_  


  **Request Syntax**
  ::

    response = client.disassociate_faces(
        CollectionId='string',
        UserId='string',
        ClientRequestToken='string',
        FaceIds=[
            'string',
        ]
    )
    
  :type CollectionId: string
  :param CollectionId: **[REQUIRED]** 

    The ID of an existing collection containing the UserID.

    

  
  :type UserId: string
  :param UserId: **[REQUIRED]** 

    ID for the existing UserID.

    

  
  :type ClientRequestToken: string
  :param ClientRequestToken: 

    Idempotent token used to identify the request to ``DisassociateFaces``. If you use the same token with multiple ``DisassociateFaces`` requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.

    This field is autopopulated if not provided.

  
  :type FaceIds: list
  :param FaceIds: **[REQUIRED]** 

    An array of face IDs to disassociate from the UserID.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'DisassociatedFaces': [
              {
                  'FaceId': 'string'
              },
          ],
          'UnsuccessfulFaceDisassociations': [
              {
                  'FaceId': 'string',
                  'UserId': 'string',
                  'Reasons': [
                      'FACE_NOT_FOUND'|'ASSOCIATED_TO_A_DIFFERENT_USER',
                  ]
              },
          ],
          'UserStatus': 'ACTIVE'|'UPDATING'|'CREATING'|'CREATED'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **DisassociatedFaces** *(list) --* 

        An array of DissociatedFace objects containing FaceIds that are successfully disassociated with the UserID is returned. Returned if the DisassociatedFaces action is successful.

        
        

        - *(dict) --* 

          Provides face metadata for the faces that are disassociated from a specific UserID.

          
          

          - **FaceId** *(string) --* 

            Unique identifier assigned to the face.

            
      
    
      

      - **UnsuccessfulFaceDisassociations** *(list) --* 

        An array of UnsuccessfulDisassociation objects containing FaceIds that are not successfully associated, along with the reasons for the failure to associate. Returned if the DisassociateFaces action is successful.

        
        

        - *(dict) --* 

          Contains metadata like FaceId, UserID, and Reasons, for a face that was unsuccessfully disassociated.

          
          

          - **FaceId** *(string) --* 

            A unique identifier assigned to the face.

            
          

          - **UserId** *(string) --* 

            A provided ID for the UserID. Unique within the collection.

            
          

          - **Reasons** *(list) --* 

            The reason why the deletion was unsuccessful.

            
            

            - *(string) --* 
        
      
    
      

      - **UserStatus** *(string) --* 

        The status of an update made to a User. Reflects if the User has been updated for every requested change.

        
  
  **Exceptions**
  
  *   :py:class:`Rekognition.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`Rekognition.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Rekognition.Client.exceptions.InternalServerError`

  
  *   :py:class:`Rekognition.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Rekognition.Client.exceptions.ProvisionedThroughputExceededException`

  
  *   :py:class:`Rekognition.Client.exceptions.IdempotentParameterMismatchException`

  
  *   :py:class:`Rekognition.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Rekognition.Client.exceptions.ConflictException`

  