> 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

# BulkDeleteQuizzes

# Package: onlinePrograms

# Namespace: QuizService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes.md

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Permanently deletes up to 100 quiz definitions.

Individual item failures don't fail the bulk request. Check `results.itemMetadata.success` for each item and inspect `results.itemMetadata.error` when it is `false`. Individual results can contain error codes not listed for the request.

This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.

To delete a single quiz definition, call [Delete Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/delete-quiz.md).

---

## REST API

### Schema

```
 Method: bulkDeleteQuizzes
 Description: Permanently deletes up to 100 quiz definitions.  Individual item failures don't fail the bulk request. Check `results.itemMetadata.success` for each item and inspect `results.itemMetadata.error` when it is `false`. Individual results can contain error codes not listed for the request.  This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.  To delete a single quiz definition, call [Delete Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/delete-quiz.md).
 URL: https://www.wixapis.com/online-programs/v1/bulk/quizzes/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:  quizIds
 Method parameters: 
   param name: quizIds | type: array<quizIds> | description: IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first. | required: true | validation: minItems 1, maxItems 100, format GUID
 Return type: BulkDeleteQuizzesResponse
  - name: results | type: array<BulkQuizResult> | description: Results of the bulk delete operation.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Result metadata for the individual delete operation. If `success` is `false`, inspect `error` for details. Individual results can contain error codes not listed for the request.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - 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 about 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.  


```

### Examples

### Permanently delete quiz definitions in bulk
Permanently delete multiple quiz definitions. Remove references to these quizzes from program steps first. Replace <AUTH> with your authorization token and quizIds with the IDs of the quizzes you intend to delete. Check each result's itemMetadata.success because individual deletions can fail even when the HTTP request succeeds.

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/v1/bulk/quizzes/delete' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "quizIds": [
    "41ad416f-9a9a-478c-8363-9219d481891b",
    "7a444fa0-feab-485c-aa6f-3d71e4a85d97",
    "dd58af6e-c0f3-4bf6-90a6-d4e2f256d6d9"
  ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.quizzes.bulkDeleteQuizzes(quizIds)
 Description: Permanently deletes up to 100 quiz definitions.  Individual item failures don't fail the bulk request. Check `results.itemMetadata.success` for each item and inspect `results.itemMetadata.error` when it is `false`. Individual results can contain error codes not listed for the request.  This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.  To delete a single quiz definition, call [Delete Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/delete-quiz.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  quizIds
 Method parameters: 
   param name: quizIds | type: array<array> | description: IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first. | required: true | validation: minItems 1, maxItems 100, format GUID
 Return type: PROMISE<BulkDeleteQuizzesResponse>
  - name: results | type: array<BulkQuizResult> | description: Results of the bulk delete operation.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Result metadata for the individual delete operation. If `success` is `false`, inspect `error` for details. Individual results can contain error codes not listed for the request.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - 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 about 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.  


```

### Examples

### Permanently delete quiz definitions in bulk
```javascript
import { quizzes } from "@wix/online-programs";

// Run in an authorized Wix context. Replace the sample IDs with quiz _id values to delete.
// Deletion is permanent. Remove references to these quizzes from program steps first.
// Check each result's itemMetadata.success; individual deletions can fail.
const bulkDeleteQuizzesResponse = await quizzes.bulkDeleteQuizzes([
  "963bc415-3e38-457a-a868-0269bc73c4b7",
  "f04086ab-7979-4891-88b1-f9ece950bd0c",
  "e0e6bd9f-017e-4abc-8368-a74dac8acd2f"
]);

/* Promise resolves to:
{
  "results": [
    {
      "itemMetadata": {
        "originalIndex": 0,
        "success": true,
        "_id": "963bc415-3e38-457a-a868-0269bc73c4b7"
      }
    },
    {
      "itemMetadata": {
        "originalIndex": 1,
        "success": true,
        "_id": "f04086ab-7979-4891-88b1-f9ece950bd0c"
      }
    },
    {
      "itemMetadata": {
        "originalIndex": 2,
        "success": true,
        "_id": "e0e6bd9f-017e-4abc-8368-a74dac8acd2f"
      }
    }
  ],
  "bulkActionMetadata": {
    "totalSuccesses": 3,
    "totalFailures": 0,
    "undetailedFailures": 0
  }
}
*/

```

### bulkDeleteQuizzes (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 { quizzes } from '@wix/online-programs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function bulkDeleteQuizzes(quizIds) {
  const response = await myWixClient.quizzes.bulkDeleteQuizzes(quizIds);
};
```

---