> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# BulkDeleteContacts

# Package: contacts

# Namespace: Contacts

# Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/bulk-delete-contacts.md

## Permission Scopes:
Manage Contacts: SCOPE.DC-CONTACTS.MANAGE-CONTACTS
Manage Members: SCOPE.DC-MEMBERS.MANAGE-MEMBERS

## Introduction

Deletes multiple contacts in a single request. Works synchronously.

Deleted contacts are moved to the trash bin and can be restored within 90 days by calling [Restore Contact From Trash Bin](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/restore-contact-from-trash-bin.md) or [Bulk Restore Contacts From Trash Bin](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/bulk-restore-contacts-from-trash-bin.md).

To delete a single contact, call [Delete Contact](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/delete-contact.md).

---

## REST API

### Schema

```
 Method: bulkDeleteContacts
 Description: Deletes multiple contacts in a single request. Works synchronously.  Deleted contacts are moved to the trash bin and can be restored within 90 days by calling [Restore Contact From Trash Bin](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/restore-contact-from-trash-bin.md) or [Bulk Restore Contacts From Trash Bin](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/bulk-restore-contacts-from-trash-bin.md).  To delete a single contact, call [Delete Contact](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/delete-contact.md).
 URL: https://www.wixapis.com/contacts/v5/bulk/contacts/delete
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  contactIds
 Method parameters: 
   param name: contactIds | type: array<contactIds> | description: IDs of the contacts to delete. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: deleteMembers | type: deleteMembers | description: Whether to delete the associated site member for any contact that's a site member. If `true`, the site member is also deleted.  Default: `false`  
 Return type: BulkDeleteContactsResponse
  - name: results | type: array<BulkContactResult> | description: Results of the delete operation for each contact.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata regarding the deletion of this specific contact.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  | validation: format GUID
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata regarding the bulk delete operation.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: UNAUTHORIZED_DELETE_MEMBER | Description: Deleting a site member's contact isn't allowed.


```

### Examples

### Delete multiple contacts in bulk
Soft deletes contacts by ID, moving them to the trash bin where they can be restored for up to 90 days.

```curl
curl -X POST \
'https://www.wixapis.com/contacts/v5/bulk/contacts/delete' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "contactIds": [
    "e6b00217-e1f0-4b4c-89a1-6c635ed66e68",
    "fa6fe461-6fe9-400b-9866-2ad7734dba57"
  ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.crm.contactsV5.bulkDeleteContacts(contactIds, options)
 Description: Deletes multiple contacts in a single request. Works synchronously.  Deleted contacts are moved to the trash bin and can be restored within 90 days by calling [Restore Contact From Trash Bin](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/restore-contact-from-trash-bin.md) or [Bulk Restore Contacts From Trash Bin](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/bulk-restore-contacts-from-trash-bin.md).  To delete a single contact, call [Delete Contact](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/delete-contact.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  contactIds
 Method parameters: 
   param name: contactIds | type: array<array> | description: IDs of the contacts to delete. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: options | type: BulkDeleteContactsOptions  none  
        - name: deleteMembers | type: boolean | description: Whether to delete the associated site member for any contact that's a site member. If `true`, the site member is also deleted.  Default: `false`  
 Return type: PROMISE<BulkDeleteContactsResponse>
  - name: results | type: array<BulkContactResult> | description: Results of the delete operation for each contact.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata regarding the deletion of this specific contact.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  | validation: format GUID
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata regarding the bulk delete operation.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: UNAUTHORIZED_DELETE_MEMBER | Description: Deleting a site member's contact isn't allowed.


```

### Examples

### Delete multiple contacts in bulk
```javascript
import { contactsV5 } from "@wix/crm";

const contactIds = [
  "d1ce3067-5344-4a50-8eda-c720fb0e726d",
  "5d7608ee-9198-4ee1-a045-cc72e9cc6cb9",
];

async function bulkDeleteContacts() {
  const response = await contactsV5.bulkDeleteContacts(contactIds);
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "itemMetadata": {
 *         "originalIndex": 0,
 *         "success": true,
 *         "_id": "d1ce3067-5344-4a50-8eda-c720fb0e726d"
 *       }
 *     },
 *     {
 *       "itemMetadata": {
 *         "originalIndex": 1,
 *         "success": true,
 *         "_id": "5d7608ee-9198-4ee1-a045-cc72e9cc6cb9"
 *       }
 *     }
 *   ],
 *   "bulkActionMetadata": {
 *     "totalSuccesses": 2,
 *     "totalFailures": 0,
 *     "undetailedFailures": 0
 *   }
 * }
 */

```

### bulkDeleteContacts (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { contactsV5 } from '@wix/crm';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { contactsV5 },
  // Include the auth strategy and host as relevant
});


async function bulkDeleteContacts(contactIds,options) {
  const response = await myWixClient.contactsV5.bulkDeleteContacts(contactIds,options);
};
```

---