> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetFolder

# Package: mediaManager

# Namespace: FoldersService

# Method link: https://dev.wix.com/docs/api-reference/assets/media/media-manager/folders/get-folder.md

## Permission Scopes:
Read Media Manager: SCOPE.DC-MEDIA.READ-MEDIAMANAGER

## Introduction

Gets information from a specific folder in the Media Manager.

---

## REST API

### Schema

```
 Method: getFolder
 Description: Gets information from a specific folder in the Media Manager.
 URL: https://www.wixapis.com/site-media/v1/folders/{folderId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  folderId
 Method parameters: 
   param name: folderId | type:   none | required: true 
 Return type: GetFolderResponse
  - name: folder | type: Folder | description: Information about the folder.  
     - name: id | type: string | description: Folder GUID. Generated when a folder is created in the Media Manager.  | validation: maxLength 100
     - name: displayName | type: string | description: Folder name as it appears in the Media Manager.  | validation: maxLength 1000
     - name: parentFolderId | type: string | description: GUID of the folder's parent folder. <br /> Default: `media-root` folder.  | validation: maxLength 100
     - name: createdDate | type: string | description: Date the folder was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date the folder was updated.  | read-only: true | validation: format date-time
     - name: state | type: State | description: State of the folder.  | read-only: true 
         - enum:
         -     OK: Folder is ready for use.
         -     DELETED: Folder is deleted.
     - name: siteId | type: string | description: Site GUID the folder belongs to.  | read-only: true | validation: maxLength 100


```

### Examples

### Get information about a folder
```curl
curl -X GET \
  'https://www.wixapis.com/site-media/v1/folders/12vn4498977596aeebcf5c41eca01c0d99667ac9' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.media.folders.getFolder(folderId)
 Description: Gets information from a specific folder in the Media Manager.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  folderId
 Method parameters: 
   param name: folderId | type: string | description: Folder GUID. | required: true | validation: maxLength 100
 Return type: PROMISE<Folder>
  - name: _id | type: string | description: Folder GUID. Generated when a folder is created in the Media Manager.  | validation: maxLength 100
  - name: displayName | type: string | description: Folder name as it appears in the Media Manager.  | validation: maxLength 1000
  - name: parentFolderId | type: string | description: GUID of the folder's parent folder. <br /> Default: `media-root` folder.  | validation: maxLength 100
  - name: _createdDate | type: Date | description: Date the folder was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date the folder was updated.  | read-only: true 
  - name: state | type: State | description: State of the folder.  | read-only: true 
     - enum:
     -     OK: Folder is ready for use.
     -     DELETED: Folder is deleted.
  - name: siteId | type: string | description: Site GUID the folder belongs to.  | read-only: true | validation: maxLength 100


```

### Examples

### Get a folder (with elevated permissions)
```javascript
import { folders } from '@wix/media';
import { auth } from '@wix/essentials';

const elevatedGetFolder = auth.elevate(folders.getFolder);

/* Sample folderId value: '30ed8f8a8f1e4a99b82c516cb212192f' */

async function myGetFolderFunction(folderId) {
  try {
    const folder = await elevatedGetFolder(folderId);

    console.log('Successfully retrieved folder:', folder);
    return folder;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "_createdDate": "2023-08-22T08:31:06.000Z",
 *   "_id": "30ed8f8a8f1e4a99b82c516cb212192f",
 *   "_updatedDate": "2023-08-22T08:31:06.000Z",
 *   "displayName": "test2",
 *   "parentFolderId": "302fc049d70c41dea33fa4a27ab481ba",
 *   "state": "OK"
 * }
 */
```

### Get a folder
```javascript
import { folders } from '@wix/media';

/* Sample folderId value: '30ed8f8a8f1e4a99b82c516cb212192f' */

async function myGetFolderFunction(folderId) {
  try {
    const folder = await folders.getFolder(folderId);

    console.log('Successfully retrieved folder:', folder);
    return folder;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "_createdDate": "2023-08-22T08:31:06.000Z",
 *   "_id": "30ed8f8a8f1e4a99b82c516cb212192f",
 *   "_updatedDate": "2023-08-22T08:31:06.000Z",
 *   "displayName": "test2",
 *   "parentFolderId": "302fc049d70c41dea33fa4a27ab481ba",
 *   "state": "OK"
 * }
 */
```

### getFolder (self-managed)
Self-managed 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 { folders } from '@wix/media';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function getFolder(folderId) {
  const response = await myWixClient.folders.getFolder(folderId);
};
```

---