> 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

# GetRestrictions

# Package: forms

# Namespace: RestrictionsService

# Method link: https://dev.wix.com/docs/api-reference/crm/forms/form-restrictions/get-restrictions.md

## Permission Scopes:
View Forms: SCOPE.FORMS.VIEW-FORM

## Introduction

Retrieves the form limits and premium features in force for the site, and the number of forms it currently has.

Call Get Restrictions before creating or updating a form to check the change against the site's plan. A form that
exceeds a limit, or that uses a feature absent from `restrictions.features`, is rejected. Compare
`totalFormCount` with `restrictions.formsLimit` to check whether the site can add another form, and use each
limit's `warnThreshold` to warn a site owner who is approaching it.

The limits come from the site's premium plan and change when the plan changes. When a plan change leaves a form
over a limit, the form is disabled rather than deleted: it stops accepting submissions, but it and its
submissions remain readable.

---

## REST API

### Schema

```
 Method: getRestrictions
 Description: Retrieves the form limits and premium features in force for the site, and the number of forms it currently has.  Call Get Restrictions before creating or updating a form to check the change against the site's plan. A form that exceeds a limit, or that uses a feature absent from `restrictions.features`, is rejected. Compare `totalFormCount` with `restrictions.formsLimit` to check whether the site can add another form, and use each limit's `warnThreshold` to warn a site owner who is approaching it.  The limits come from the site's premium plan and change when the plan changes. When a plan change leaves a form over a limit, the form is disabled rather than deleted: it stops accepting submissions, but it and its submissions remain readable.
 URL: https://www.wixapis.com/_api/form-app-service/v4/restrictions
 Method: GET
 Return type: GetRestrictionsResponse
  - name: restrictions | type: PremiumRestrictions | description: Form limits and premium features in force for the site.  
     - name: formsLimit | type: Limit | description: Maximum number of forms allowed on the site.  Compare this limit with `totalFormCount`, which counts the same set of forms. Forms in the trash bin aren't counted.  
        - name: limit | type: integer | description: Maximum number allowed.  `null` when the plan places no limit.  | validation: minimum 0, maximum 10000, format int32
        - name: warnThreshold | type: integer | description: Count at which to warn that the limit is close to being reached.  An absolute count in the same unit as `limit`, never greater than it. Reaching this count doesn't block the action; it's the point at which to surface a nearing-limit warning. For some limits it equals `limit`, meaning there's no early warning.  `null` when `limit` is `null`.  | validation: minimum 0, maximum 10000, format int32
     - name: fieldsLimit | type: Limit | description: Maximum number of input fields allowed per form.  Display elements, such as rich content and the submit button, don't count toward this limit.  
     - name: stepsLimit | type: Limit | description: Maximum number of steps allowed per form.  
     - name: emailsLimit | type: Limit | description: Maximum number of email recipients that can be notified when a form is submitted.  
     - name: features | type: array<Feature> | description: Premium features the site's plan allows.  Any feature absent from this list is unavailable on the site, and a form that uses it is rejected.  | validation: maxItems 10
         - enum:
         -     UNKNOWN_FEATURE: Unknown feature.
         -     FILE_UPLOAD_FIELD: Forms can include a file upload field, letting respondents attach files to their submission.
         -     ACCEPT_PAYMENTS: Forms can collect payments through payment, fixed payment, and donation fields.
         -     REMOVE_WIX_BRANDING: Wix branding can be hidden on the published form.
         -     SIGNATURE_FIELD: Forms can include a signature field.
         -     FILE_DOWNLOAD: Files that respondents attached to their submissions can be downloaded from the site's submissions.
     - name: ascendPlan | type: AscendPlan | description: Ascend by Wix plan the site holds.  `NOT_ASCEND` when the site isn't on an Ascend plan. The limits and features that follow from the plan are already reflected in the other fields, so most callers don't need to read this field.  
         - enum:
         -     NOT_ASCEND: Site isn't on an Ascend by Wix plan.
         -     FREE: Ascend by Wix Free plan.
         -     BASIC: Ascend by Wix Basic plan.
         -     PROFESSIONAL: Ascend by Wix Professional plan.
         -     UNLIMITED: Ascend by Wix Unlimited plan.
     - name: rulesLimit | type: Limit | description: Maximum number of rules allowed per form.  A single rule's `condition` can combine several tests, and the rule still counts once against this limit.  
  - name: totalFormCount | type: integer | description: Number of forms on the site that count toward `restrictions.formsLimit`.  Forms in the trash bin aren't counted. When the count can't be retrieved, the call still succeeds and this field is `0`, so treat `0` as unknown rather than as an empty site before using it to decide whether a form can be added.  


```

### Examples

### Get Restrictions
Retrieves the form limits and premium features in force for the site, and the number of forms it currently has.

```curl
curl -X GET \
'https://www.wixapis.com/form-app-service/v4/restrictions' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.forms.restrictions.getRestrictions()
 Description: Retrieves the form limits and premium features in force for the site, and the number of forms it currently has.  Call Get Restrictions before creating or updating a form to check the change against the site's plan. A form that exceeds a limit, or that uses a feature absent from `restrictions.features`, is rejected. Compare `totalFormCount` with `restrictions.formsLimit` to check whether the site can add another form, and use each limit's `warnThreshold` to warn a site owner who is approaching it.  The limits come from the site's premium plan and change when the plan changes. When a plan change leaves a form over a limit, the form is disabled rather than deleted: it stops accepting submissions, but it and its submissions remain readable.
 Return type: PROMISE<GetRestrictionsResponse>
  - name: restrictions | type: PremiumRestrictions | description: Form limits and premium features in force for the site.  
     - name: formsLimit | type: Limit | description: Maximum number of forms allowed on the site.  Compare this limit with `totalFormCount`, which counts the same set of forms. Forms in the trash bin aren't counted.  
        - name: limit | type: integer | description: Maximum number allowed.  `null` when the plan places no limit.  | validation: minimum 0, maximum 10000, format int32
        - name: warnThreshold | type: integer | description: Count at which to warn that the limit is close to being reached.  An absolute count in the same unit as `limit`, never greater than it. Reaching this count doesn't block the action; it's the point at which to surface a nearing-limit warning. For some limits it equals `limit`, meaning there's no early warning.  `null` when `limit` is `null`.  | validation: minimum 0, maximum 10000, format int32
     - name: fieldsLimit | type: Limit | description: Maximum number of input fields allowed per form.  Display elements, such as rich content and the submit button, don't count toward this limit.  
     - name: stepsLimit | type: Limit | description: Maximum number of steps allowed per form.  
     - name: emailsLimit | type: Limit | description: Maximum number of email recipients that can be notified when a form is submitted.  
     - name: features | type: array<Feature> | description: Premium features the site's plan allows.  Any feature absent from this list is unavailable on the site, and a form that uses it is rejected.  | validation: maxItems 10
         - enum:
         -     UNKNOWN_FEATURE: Unknown feature.
         -     FILE_UPLOAD_FIELD: Forms can include a file upload field, letting respondents attach files to their submission.
         -     ACCEPT_PAYMENTS: Forms can collect payments through payment, fixed payment, and donation fields.
         -     REMOVE_WIX_BRANDING: Wix branding can be hidden on the published form.
         -     SIGNATURE_FIELD: Forms can include a signature field.
         -     FILE_DOWNLOAD: Files that respondents attached to their submissions can be downloaded from the site's submissions.
     - name: ascendPlan | type: AscendPlan | description: Ascend by Wix plan the site holds.  `NOT_ASCEND` when the site isn't on an Ascend plan. The limits and features that follow from the plan are already reflected in the other fields, so most callers don't need to read this field.  
         - enum:
         -     NOT_ASCEND: Site isn't on an Ascend by Wix plan.
         -     FREE: Ascend by Wix Free plan.
         -     BASIC: Ascend by Wix Basic plan.
         -     PROFESSIONAL: Ascend by Wix Professional plan.
         -     UNLIMITED: Ascend by Wix Unlimited plan.
     - name: rulesLimit | type: Limit | description: Maximum number of rules allowed per form.  A single rule's `condition` can combine several tests, and the rule still counts once against this limit.  
  - name: totalFormCount | type: integer | description: Number of forms on the site that count toward `restrictions.formsLimit`.  Forms in the trash bin aren't counted. When the count can't be retrieved, the call still succeeds and this field is `0`, so treat `0` as unknown rather than as an empty site before using it to decide whether a form can be added.  


```

### Examples

### getRestrictions
```javascript
import { restrictions } from '@wix/forms';

async function getRestrictions() {
  const response = await restrictions.getRestrictions();
};
```

### getRestrictions (with elevated permissions)
```javascript
import { restrictions } from '@wix/forms';
import { auth } from '@wix/essentials';

async function myGetRestrictionsMethod() {
  const elevatedGetRestrictions = auth.elevate(restrictions.getRestrictions);
  const response = await elevatedGetRestrictions();
}
```

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

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


async function getRestrictions() {
  const response = await myWixClient.restrictions.getRestrictions();
};
```

---