Organize media files into a hierarchical folder structure. Maximum nesting depth is 3 levels.
8 endpoints
GET /media-folders
List folders
Returns a flat list of all media folders.
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| query | string | No | Parent resource ID |
| query | string | No | Full-text search query |
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
Examples
curl https://api.lynkow.com/v1/media-folders \
-H "Authorization: Bearer $API_TOKEN"Response Example
{
"data": [
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Banners",
"parentId": null,
"mediaCount": 24,
"createdAt": "2025-01-15T09:00:00.000Z"
},
{
"id": "f2b3c4d5-e6f7-8901-bcde-f12345678901",
"name": "Blog Images",
"parentId": null,
"mediaCount": 87,
"createdAt": "2025-01-15T09:05:00.000Z"
},
{
"id": "f3c4d5e6-f7a8-9012-cdef-234567890123",
"name": "Thumbnails",
"parentId": "f2b3c4d5-e6f7-8901-bcde-f12345678901",
"mediaCount": 42,
"createdAt": "2025-02-01T14:00:00.000Z"
}
]
}POST /media-folders
Create a folder
Creates a new media folder. Set parentId to create a subfolder.
Request Body
Content-Type: application/json
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Required. Display name. 1-255 characters |
| string | No | Parent resource ID |
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
| Validation error |
Notes: - Maximum nesting depth: 3 levels.
Folder names must be unique within the same parent.
Examples
curl -X POST https://api.lynkow.com/v1/media-folders \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Product Photos", "parentId": null}'Response Example
{
"data": {
"id": "f4d5e6f7-a8b9-0123-defa-345678901234",
"name": "Product Photos",
"parentId": null,
"mediaCount": 0,
"createdAt": "2025-04-06T11:00:00.000Z"
}
}GET /media-folders/tree
Get folder tree
Returns folders as a nested tree structure.
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
Examples
curl https://api.lynkow.com/v1/media-folders/tree \
-H "Authorization: Bearer $API_TOKEN"Response Example
{
"data": [
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Banners",
"mediaCount": 24,
"children": []
},
{
"id": "f2b3c4d5-e6f7-8901-bcde-f12345678901",
"name": "Blog Images",
"mediaCount": 87,
"children": [
{
"id": "f3c4d5e6-f7a8-9012-cdef-234567890123",
"name": "Thumbnails",
"mediaCount": 42,
"children": []
}
]
}
]
}POST /media-folders/move-media
Move files to a folder
Moves one or more media files to a target folder. Provide an array
of media IDs and the target folder ID (or null for root).
Request Body
Content-Type: application/json
Field | Type | Required | Description |
|---|---|---|---|
| string[] | Yes | Required. 1-100 characters. Array of strings |
| string | null | Yes | Required. Media folder UUID |
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
| Validation error |
Examples
curl -X POST https://api.lynkow.com/v1/media-folders/move-media \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mediaIds": ["uuid1", "uuid2"], "folderId": "target-folder-uuid"}'Response Example
{
"moved": 2
}GET /media-folders/:id
Get a folder
Returns a single folder with its contents and subfolders.
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| path | string | Yes | Unique identifier |
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
| Not found |
Examples
curl https://api.lynkow.com/v1/media-folders/f1a2b3c4-d5e6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer $API_TOKEN"Response Example
{
"data": {
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Banners",
"parentId": null,
"mediaCount": 24,
"children": [
{
"id": "f5e6f7a8-b9c0-1234-efab-567890123456",
"name": "Homepage",
"mediaCount": 8
}
],
"createdAt": "2025-01-15T09:00:00.000Z",
"updatedAt": "2025-03-10T14:00:00.000Z"
}
}PUT /media-folders/:id
Rename a folder
Updates a folder's name.
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| path | string | Yes | Unique identifier |
Request Body
Content-Type: application/json
Field | Type | Required | Description |
|---|---|---|---|
| string | No | Display name. 1-255 characters |
| string | null | No | Parent resource ID |
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
| Not found |
| Validation error |
Examples
curl -X PUT https://api.lynkow.com/v1/media-folders/f1a2b3c4-d5e6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Hero Banners"}'Response Example
{
"data": {
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Hero Banners",
"parentId": null,
"mediaCount": 24,
"createdAt": "2025-01-15T09:00:00.000Z",
"updatedAt": "2025-04-06T12:00:00.000Z"
}
}DELETE /media-folders/:id
Delete a folder
Deletes a folder. You must specify what happens to contained files
via the action parameter: move (to parent) or delete (permanently).
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| path | string | Yes | Unique identifier |
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
| Not found |
Examples
curl -X DELETE "https://api.lynkow.com/v1/media-folders/f1a2b3c4-d5e6-7890-abcd-ef1234567890?action=move" \
-H "Authorization: Bearer $API_TOKEN"Response Example
{
"message": "Folder deleted"
}POST /media-folders/:id/move
Move a folder
Moves a folder to a different parent folder (or to root with parentId: null).
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| path | string | Yes | Unique identifier |
Request Body
Content-Type: application/json
Field | Type | Required | Description |
|---|---|---|---|
| string | null | Yes | Required. Parent resource ID |
Responses
Status | Description |
|---|---|
| Successful response |
| Unauthorized — invalid or missing API token |
| Forbidden — insufficient permissions |
| Not found |
| Validation error |
Examples
curl -X POST https://api.lynkow.com/v1/media-folders/f3c4d5e6-f7a8-9012-cdef-234567890123/move \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"parentId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890"}'Response Example
{
"data": {
"id": "f3c4d5e6-f7a8-9012-cdef-234567890123",
"name": "Thumbnails",
"parentId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"mediaCount": 42,
"createdAt": "2025-02-01T14:00:00.000Z",
"updatedAt": "2025-04-06T12:00:00.000Z"
}
}