API Reference/api/user/api/user/folders

/api/user/folders

Info

GET
Get all folders

Query

Field NameTypeDescription
filesbooleanWhether to include the files in the response.

200
Ok (JSON)

Returns an array of folders

[
{
"id": 1,
"name": "test",
"userId": 1,
"createdAt": "2023-01-28T18:56:55.363Z",
"updatedAt": "2023-01-28T18:56:55.363Z"
},
...
]

If ?files=true:

[
{
"files": [
{
"id": 37,
"name": "NhOHti.png",
"originalName": null,
"mimetype": "image/png",
"createdAt": "2023-01-14T21:32:35.097Z",
"expiresAt": null,
"maxViews": null,
"views": 0,
"favorite": false,
"embed": true,
"format": "RANDOM",
"userId": 1,
"folderId": 1,
"url": "/NhOHti.png"
},
...
],
"id": 1,
"name": "test",
"userId": 1,
"createdAt": "2023-01-28T18:56:55.363Z",
"updatedAt": "2023-01-28T18:56:55.363Z"
},
...
]

POST
Create a folder

Body (JSON)

Field NameTypeDescription
namestringThe name for the folder
addnumber[] / string[]ID's of files to add to the folder upon creation

200
Ok (JSON)

Returns the created folder

{
"id": 1,
"name": "test",
"userId": 1,
"createdAt": "2023-01-28T18:56:55.363Z",
"updatedAt": "2023-01-28T18:56:55.363Z"
}

400
Bad Request (JSON)

  • name is required - No name was provided.
  • name cannot be empty - The name provided was empty.
  • files {id,id,id...} not found - One or more of the files provided were not found.
Last updated: 8/5/2023
Edit this page on GitHub