> 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

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/crm/forms/spam-submissions/sample-flows.md

## Article Content:

# Spam Submissions API: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Manage a form's spam folder

Your app can show site owners the spam submissions of a form, so they can restore real submissions and clear out spam.

To manage a form's spam folder:

1. Call [Count Form Spam Submission Reports](https://dev.wix.com/docs/api-reference/crm/forms/spam-submissions/count-form-spam-submission-reports.md) with the form IDs and `namespace` set to `wix.form_app.form` to show how many spam submissions each form has. Forms with no spam submission reports aren't included in the response.
1. Call [Query Form Spam Submission Reports By Namespace](https://dev.wix.com/docs/api-reference/crm/forms/spam-submissions/query-form-spam-submission-reports-by-namespace.md) with a filter on `namespace` and `formId`. Sort by `reportedDate` in `DESC` order to show the newest reports first.
1. For each report, show `submissions`, `reportReason`, and `reportReasonDescription`, so the site owner can decide whether it's spam.
1. Call [Bulk Report Not Spam Submission](https://dev.wix.com/docs/api-reference/crm/forms/spam-submissions/bulk-report-not-spam-submission.md) with the form ID and the IDs of the reports that aren't spam. Each restored submission gets a new submission ID, returned in `results.itemMetadata.id`.
1. Call [Bulk Delete Form Spam Submission Report](https://dev.wix.com/docs/api-reference/crm/forms/spam-submissions/bulk-delete-form-spam-submission-report.md) with the form ID and the IDs of the remaining reports.

## Let site owners mark submissions as spam

Your app can let site owners move unwanted submissions to the spam folder.

To let site owners mark submissions as spam:

1. Call [Query Submissions By Namespace](https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/query-submissions-by-namespace.md) to retrieve the form's submissions.
1. When the site owner marks submissions as spam, call [Bulk Report Spam Submission](https://dev.wix.com/docs/api-reference/crm/forms/spam-submissions/bulk-report-spam-submission.md) with the form ID, the submission IDs, and `reportReason` set to `MANUALLY_REPORTED`. The submissions are removed from the form's submissions, and a spam submission report is created for each one.

## Clear spam flagged for a specific reason

Your app can delete all spam submission reports of a form that were flagged for the same reason, such as a blocklisted IP address.

To clear spam flagged for a specific reason:

1. Call [Bulk Delete Form Spam Submission Report By Filter](https://dev.wix.com/docs/api-reference/crm/forms/spam-submissions/bulk-delete-form-spam-submission-report-by-filter.md) with a filter that includes `namespace`, `formId`, and `reportReason`. If no reports match the filter, the call fails with a `NOT_FOUND` error.
1. Pass the returned `jobId` to [Get Async Job](https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md) to check when the deletion is complete.