> 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 # DeleteSubmission # Package: forms # Namespace: FormSubmissionService # Method link: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/delete-submission.md ## Permission Scopes: Manage Submissions: SCOPE.DC-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.
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.
Deletes a submission by GUID. URL: https://www.wixapis.com/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 \ 'http://www.wixapis.com/form-submission/v4/submissions/e62e3011-55cf-4de3-a497-e097b52d86b7' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.forms.FormSubmissionService.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.
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: 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. param name: submissionId | type: string | description: GUID of the submission to delete. | required: true Return type: PROMISE 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-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 { 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); }; ``` ---