APIs for Media
Get all media folders
http
GET /api/media/:workspaceId/folderRequest Body
No body required
Response
ts
type FolderResponse = {
success: boolean;
message: string;
data: Data[];
};
type Data = {
folder_id: string;
folder_name: string;
workspace_id: string;
created_by: string;
parent_folder_id: null | string;
created_at: Date;
item_count: number;
sub_folders: Data[];
};Create media folder
http
POST /api/media/:workspaceId/folderRequest Body
ts
type CreateFolder = {
folder_name: string;
parent_folder_id?: string;
};Response
ts
type CreateFolder = {
success: boolean;
message: string;
data: Data;
};
type Data = {
folder_id: string;
folder_name: string;
workspace_id: string;
created_by: string;
parent_folder_id: null;
created_at: Date;
};Update Folder Name
http
PUT /api/media/:workspaceId/folder/:folderIdRequest Body
ts
type UpdateFolderName = {
folder_name: string;
};Response
ts
type UpdateFolderNameResponse = {
success: boolean;
message: string;
data: Data[];
};
type Data = {
folder_id: string;
folder_name: string;
workspace_id: string;
created_by: string;
parent_folder_id: string;
created_at: Date;
};Delete Folder
http
DELETE /api/media/:workspaceId/folder/:folderIdRequest Body
No body required
Response
ts
type DeleteFolderNameResponse = {
success: boolean;
message: string;
};Export folder
http
GET /api/media/:workspaceId/folder/:folderId/exportRequest Body
No body required
Response
Downloads a zip
Get all media files
http
GET /api/media/:workspaceId/files/:folderIdRequest Body
No body required
Response
ts
type FileResponse = {
success: boolean;
message: string;
data: Data[];
};
type Data = {
file_id: string;
folder_id: string;
file_name: string;
file_type: string;
file_path: string;
uploaded_by: string;
created_at: Date;
file_size: string;
};Create File
http
POST /api/media/:workspaceId/fileRequest Body
ts
type CreateFile = {
folder_id: string;
file_name: string;
file_type: string;
file_size: string;
};Response
ts
type CreateFileResponse = {
success: boolean;
message: string;
data: Data;
};
type Data = {
file_id: string;
folder_id: string;
file_name: string;
file_type: string;
file_path: string;
uploaded_by: string;
created_at: Date;
file_size: string;
};Update file name
http
PUT /api/media/:workspaceId/file/:fileIdRequest Body
ts
type UpdateFileName = {
file_name: string;
};Response
ts
type UpdateFileNameResponse = {
success: boolean;
message: string;
data: Data[];
};
type Data = {
file_id: string;
folder_id: string;
file_name: string;
file_type: string;
file_path: string;
uploaded_by: string;
created_at: Date;
file_size: string;
};Delete File
http
DELETE /api/media/:workspaceId/files/:fileIdRequest Body
No body required
Response
ts
type DeleteFileResponse = {
success: boolean;
message: string;
};Get folder and files by path
http
POST /api/media/:workspaceId/path get folder and files by pathRequest Body
ts
type Path = {
path: string[];
};Response
ts
type Response = {
success: boolean;
message: string;
data: Data[];
};
type Data = {
folder_id: string;
folder_name: string;
workspace_id: string;
created_by: string;
parent_folder_id: null;
created_at: Date;
item_count: number;
};export file
http
GET /api/media/:workspaceId/file/:folderId/:fileId/exportRequest Body
No body required
Response
Downloads files
Move folders and file
http
PUT /api/media/:workspaceId/:id/moveRequest Body
ts
type MoveFolderAndFile = {
folderId: string;
type: "file" | "folder";
};Response
ts
type MoveFolderAndFileResponse = {
success: boolean;
message: string;
data: Data[];
};
type Data = {
folder_id: string;
folder_name: string;
workspace_id: string;
created_by: string;
parent_folder_id: string;
created_at: Date;
};