Skip to main content
PATCH
/
api
/
v1
/
folders
/
{id}
Update folder
const url = 'https://studyfetchapi.com/api/v1/folders/{id}';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"name":"<string>","parentFolderId":"<string>","description":"<string>","metadata":{}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "_id": "<string>",
  "name": "<string>",
  "organizationId": "<string>",
  "parentFolderId": "<string>",
  "description": "<string>",
  "status": "active",
  "metadata": {
    "color": "<string>",
    "icon": "<string>",
    "materialCount": 123,
    "totalSize": 123,
    "lastActivity": "2023-11-07T05:31:56Z"
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

id
string
required

Folder ID

Body

application/json
name
string

New folder name

parentFolderId
string

New parent folder ID

description
string

New folder description

metadata
object

Updated metadata

Response

200 - application/json

Folder updated successfully

_id
string
required

Folder ID

name
string
required

Folder name

organizationId
string
required

Organization ID

status
enum<string>
required

Folder status

Available options:
active,
deleted
createdAt
string<date-time>
required

Creation date

updatedAt
string<date-time>
required

Last update date

parentFolderId
string | null

Parent folder ID

description
string

Folder description

metadata
object

Folder metadata

I