> 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: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/crm/forms/form-restrictions/introduction.md

## Article Content:

# About the Form Restrictions API

The Form Restrictions API tells you what a site's [premium plan](https://support.wix.com/en/article/wix-forms-upgrading-wix-forms) allows its forms to do. A single call returns the site's form limits, the premium features its plan permits, and how many forms it already has.

With the Form Restrictions API, you can:

- Retrieve how many forms the site can have, and how many input fields, steps, rules, and submission email recipients each form can have.
- Retrieve which premium capabilities the site's plan permits, such as accepting payments, file upload fields, and signature fields.
- Retrieve how many forms the site currently has, to compare against its forms limit.

Restrictions come from the site's premium plan and change when that plan changes. Creating or updating a form that exceeds a limit, or that uses a feature the plan doesn't allow, is rejected, so read the restrictions before you write. Use the [Forms API](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas.md) to create and update the forms these restrictions apply to.

## What happens when a plan changes

A site's limits change as soon as its premium plan changes, and a downgrade can leave existing forms over a limit.

Such a form is disabled rather than deleted. It stops accepting submissions, but the form and its submissions stay readable, and it accepts submissions again once the site is back within its limits, whether because the site owner edited the form or restored the plan. Because of this, a site's forms can exceed its current restrictions, so don't assume that what the API returns describes every form the site already has.

## Before you begin

It's important to note the following points before starting to code:

- Restrictions apply to the site in the request's context. There's no way to read another site's restrictions.
- A `limit` of `null` means the plan sets no limit on that value.
- Each limit also carries a `warnThreshold`, the count at which to warn that the limit is close to being reached. Reaching it doesn't block anything. For some limits `warnThreshold` equals `limit`, meaning there's no early warning.
- `totalFormCount` is `0` when the count can't be retrieved, rather than the call failing. Treat `0` as unknown rather than as an empty site before using it to decide whether a form can be added.
- `features` is an allowlist. Any feature absent from the list is unavailable on the site's current plan.

## Use cases

- [Add a form only when the site's plan allows it](https://dev.wix.com/docs/api-reference/crm/forms/form-restrictions/sample-flows.md#add-a-form-only-when-the-sites-plan-allows-it)
- [Warn a site owner as they approach a limit](https://dev.wix.com/docs/api-reference/crm/forms/form-restrictions/sample-flows.md#warn-a-site-owner-as-they-approach-a-limit)
- [Offer only the premium features the site's plan allows](https://dev.wix.com/docs/api-reference/crm/forms/form-restrictions/sample-flows.md#offer-only-the-premium-features-the-sites-plan-allows)
- [Bring a site's forms back within its limits after a plan change](https://dev.wix.com/docs/api-reference/crm/forms/form-restrictions/sample-flows.md#bring-a-sites-forms-back-within-its-limits-after-a-plan-change)

## Terminology

- **Restriction:** A limit or premium feature that a site's premium plan puts in force for its forms.
- **Limit:** The maximum number of a given item the plan allows.
- **Warn threshold:** The count at which to warn that a limit is close to being reached. An absolute count in the same unit as the limit, never greater than it.
- **Feature:** A premium capability a form may use, such as accepting payments or a file upload field.
- **Form provider restrictions:** A separate concept. Ceilings that a form schema provider declares for every site in a namespace it owns, independently of any site's plan. A form must satisfy both these and the site's own restrictions.

@sdk_package_setup