Detective / Client / delete_members



Removes the specified member accounts from the behavior graph. The removed accounts no longer contribute data to the behavior graph. This operation can only be called by the administrator account for the behavior graph.

For invited accounts, the removed accounts are deleted from the list of accounts in the behavior graph. To restore the account, the administrator account must send another invitation.

For organization accounts in the organization behavior graph, the Detective administrator account can always enable the organization account again. Organization accounts that are not enabled as member accounts are not included in the ListMembers results for the organization behavior graph.

An administrator account cannot use DeleteMembers to remove their own account from the behavior graph. To disable a behavior graph, the administrator account uses the DeleteGraph API method.

See also: AWS API Documentation

Request Syntax

response = client.delete_members(
  • GraphArn (string) –


    The ARN of the behavior graph to remove members from.

  • AccountIds (list) –


    The list of Amazon Web Services account identifiers for the member accounts to remove from the behavior graph. You can remove up to 50 member accounts at a time.

    • (string) –

Return type:



Response Syntax

    'AccountIds': [
    'UnprocessedAccounts': [
            'AccountId': 'string',
            'Reason': 'string'

Response Structure

  • (dict) –

    • AccountIds (list) –

      The list of Amazon Web Services account identifiers for the member accounts that Detective successfully removed from the behavior graph.

      • (string) –

    • UnprocessedAccounts (list) –

      The list of member accounts that Detective was not able to remove from the behavior graph. For each member account, provides the reason that the deletion could not be processed.

      • (dict) –

        A member account that was included in a request but for which the request could not be processed.

        • AccountId (string) –

          The Amazon Web Services account identifier of the member account that was not processed.

        • Reason (string) –

          The reason that the member account request could not be processed.


  • Detective.Client.exceptions.AccessDeniedException

  • Detective.Client.exceptions.ConflictException

  • Detective.Client.exceptions.InternalServerException

  • Detective.Client.exceptions.ResourceNotFoundException

  • Detective.Client.exceptions.ValidationException