> 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

# RestoreStandaloneFormFromTrashBin

# Package: forms

# Namespace: FormStandaloneService

# Method link: https://dev.wix.com/docs/api-reference/crm/forms/standalone-form-v1/restore-standalone-form-from-trash-bin.md

## Permission Scopes:
Manage forms: SCOPE.FORMS.EDIT-FORM

## Introduction

Restores a standalone form from the trash bin.

The restored standalone form keeps its `id` and `accountSlug`, so its public URL works again.

---

## REST API

### Schema

```
 Method: restoreStandaloneFormFromTrashBin
 Description: Restores a standalone form from the trash bin.  The restored standalone form keeps its `id` and `accountSlug`, so its public URL works again.
 URL: https://www.wixapis.com/forms/v4/standalone-forms/trash-bin/{standaloneFormId}/restore
 Method: POST
 Return type: RestoreStandaloneFormFromTrashBinResponse
  - name: standaloneForm | type: StandaloneForm | description: Restored standalone form.  
     - name: id | type: string | description: Standalone form GUID.  Used in the standalone form's public URL. See `accountSlug` for the URL format.  | read-only: true | validation: maxLength 36
     - name: formId | type: string | description: GUID of the [form](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/introduction.md) that the standalone form marks as standalone.  The form must exist before you create the standalone form.  | validation: format GUID
     - name: metaSiteId | type: string | description: GUID of the site that owns the standalone form.  Set to the site your request is authorized for when the standalone form is created.  | read-only: true | validation: format GUID
     - name: createdDate | type: string | description: Date and time the standalone form was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the standalone form was last updated.  | read-only: true | validation: format date-time
     - name: accountSlug | type: string | description: Account slug of the site owner, used in the standalone form's public URL.  The standalone form's public URL is: - `https://{accountSlug}.wixforms.com/f/{id}` when `accountSlug` is set. - `https://www.wixforms.com/f/{id}` when `accountSlug` is empty.  Set when the standalone form is created and doesn't change afterward.  | read-only: true | validation: maxLength 50


```

### Examples

### Restore a standalone form from the trash bin
Restores a standalone form from the trash bin.

```curl
curl -X POST \
'https://www.wixapis.com/forms/v4/standalone-forms/trash-bin/7390125846218437120/restore' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.standaloneForms.standaloneForms.restoreStandaloneFormFromTrashBin(standaloneFormId)
 Description: Restores a standalone form from the trash bin.  The restored standalone form keeps its `id` and `accountSlug`, so its public URL works again.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  standaloneFormId
 Method parameters: 
   param name: standaloneFormId | type: string | description: GUID of the standalone form to restore. | required: true | validation: maxLength 36
 Return type: PROMISE<RestoreStandaloneFormFromTrashBinResponse>
  - name: standaloneForm | type: StandaloneForm | description: Restored standalone form.  
     - name: _id | type: string | description: Standalone form GUID.  Used in the standalone form's public URL. See `accountSlug` for the URL format.  | read-only: true | validation: maxLength 36
     - name: formId | type: string | description: GUID of the [form](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/introduction.md) that the standalone form marks as standalone.  The form must exist before you create the standalone form.  | validation: format GUID
     - name: metaSiteId | type: string | description: GUID of the site that owns the standalone form.  Set to the site your request is authorized for when the standalone form is created.  | read-only: true | validation: format GUID
     - name: _createdDate | type: Date | description: Date and time the standalone form was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the standalone form was last updated.  | read-only: true 
     - name: accountSlug | type: string | description: Account slug of the site owner, used in the standalone form's public URL.  The standalone form's public URL is: - `https://{accountSlug}.wixforms.com/f/{id}` when `accountSlug` is set. - `https://www.wixforms.com/f/{id}` when `accountSlug` is empty.  Set when the standalone form is created and doesn't change afterward.  | read-only: true | validation: maxLength 50


```

### Examples

### Restore a standalone form from the trash bin
Restores a standalone form from the trash bin.

```javascript
import { standaloneForms } from "@wix/standalone-forms";

async function restoreStandaloneFormFromTrashBin() {
  const response = await standaloneForms.restoreStandaloneFormFromTrashBin("7390125846218437120");
}

/* Promise resolves to:
 * {
 *   "standaloneForm": {
 *     "_id": "7390125846218437120",
 *     "formId": "3c8f2a1e-6b4d-4f7a-9e2c-5d1b8a7f6e30",
 *     "metaSiteId": "9f1d7c3a-2e8b-4a6f-b5c4-1d0e9a8b7c62",
 *     "_createdDate": "2024-01-15T10:30:00.000Z",
 *     "_updatedDate": "2024-01-16T09:15:00.000Z",
 *     "accountSlug": "maple-studio"
 *   }
 * }
 */

```

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

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


async function restoreStandaloneFormFromTrashBin(standaloneFormId) {
  const response = await myWixClient.standaloneForms.restoreStandaloneFormFromTrashBin(standaloneFormId);
};
```

---