> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# DeleteSubmission

# Package: forms

# Namespace: FormSubmissionService

# Method link: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/delete-submission.md

## Permission Scopes:
Manage form submissions.: SCOPE.FORMS.MANAGE-SUBMISSIONS

## Introduction

> **Note:** The Form Submission API only works with the Wix Forms app. Call [GetAppInstance](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/get-app-instance.md) to confirm that the app named `wix_forms` is installed on the site.
<br>
Deletes a submission by ID.

---

## REST API

### Schema

```
 Method: deleteSubmission
 Description: > **Note:** The Form Submission API only works with the Wix Forms app. Call [GetAppInstance](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/get-app-instance.md) to confirm that the app named `wix_forms` is installed on the site. <br> Deletes a submission by GUID.
 URL: https://www.wixapis.com/form-submission-service/v4/submissions/{submissionId}
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  submissionId
 Method parameters: 
   query param name: permanent | type: permanent | description: Whether to permanently delete a submission bypassing the trash bin.  Default: `false`  
   query param name: preserveFiles | type: preserveFiles | description: Whether to preserve files, associated with the submission. If the value is `false`, then the files are deleted after 210 days.  
   param name: submissionId | type:   none | required: true 
 Return type: DeleteSubmissionResponse
  EMPTY-OBJECT {}


```

### Examples

### DeleteSubmission
```curl
~~~cURL
curl -X DELETE \
  'https://www.wixapis.com/form-submission-service/v4/submissions/e62e3011-55cf-4de3-a497-e097b52d86b7' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.forms.submissions.deleteSubmission(submissionId, options)
 Description: > **Note:** The Form Submission API only works with the Wix Forms app. Call [GetAppInstance](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/get-app-instance.md) to confirm that the app named `wix_forms` is installed on the site. <br> Deletes a submission by GUID.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  submissionId
 Method parameters: 
   param name: submissionId | type: string | description: GUID of the submission to delete. | required: true | validation: format GUID
   param name: options | type: DeleteSubmissionOptions  none  
        - name: permanent | type: boolean | description: Whether to permanently delete a submission bypassing the trash bin.  Default: `false`  
        - name: preserveFiles | type: boolean | description: Whether to preserve files, associated with the submission. If the value is `false`, then the files are deleted after 210 days.  
 Return type: PROMISE<DeleteSubmissionResponse>
  EMPTY-OBJECT {}


```

### Examples

### Delete a submission (with elevated permissions)
```javascript
import { submissions } from '@wix/forms';
import { auth } from '@wix/essentials';

/*
Sample submissionId value: "f8281b62-1b2f-45bf-ba7d-f041d7653d2d"
*/

const elevatedDeleteSubmission = auth.elevate(submissions.deleteSubmission);

export async function myDeleteSubmissionFunction(submissionId) {
  try {
    const deletedSubmission = await elevatedDeleteSubmission(submissionId);
    console.log('Success! Submission is deleted');
    return deletedSubmission;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to void */
```

### Delete a submission
```javascript
import { submissions } from '@wix/forms';

/*
Sample submissionId value: "f8281b62-1b2f-45bf-ba7d-f041d7653d2d"
*/

export async function myDeleteSubmissionFunction(submissionId) {
  try {
    const deletedSubmission = await submissions.deleteSubmission(submissionId);
    console.log('Success! Submission is deleted');
    return deletedSubmission;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to void */
```

### deleteSubmission (self-managed)
Self-managed 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 { submissions } from '@wix/forms';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function deleteSubmission(submissionId,options) {
  const response = await myWixClient.submissions.deleteSubmission(submissionId,options);
};
```

---