Folders
Requirements
Authentication: Bearer API token
Scope:
postsHeaders:
Authorization: Bearer-API YOUR_API_KEYPubler-Workspace-Id: YOUR_WORKSPACE_ID
Endpoint
List Media Folders
Retrieve the folders in a workspace's media library.
GET /api/v1/media/foldersQuery Parameters
parent_folder_id
string
No
Return the direct children of this folder. Omit to return root-level folders.
Retrieves media library folders for a workspace. Returns root-level folders by default, or the direct children of a folder when parent_folder_id is supplied.
API key authentication. Format: "Bearer-API YOUR_API_KEY"
Return the direct children of this folder. Omit to return root-level folders.
ID of the workspace containing the resource
Successful operation
Unauthorized
Permission denied or missing required scope
Unprocessable Entity - no folder with that ID in this workspace
GET /api/v1/media/folders HTTP/1.1
Host: app.publer.com
Authorization: YOUR_API_KEY
Publer-Workspace-Id: text
Accept: */*
{
"folders": [
{
"id": "text",
"name": "text",
"parent_folder_id": "text",
"created_at": "text"
}
],
"previous_folders": [
{
"id": "text",
"name": "text"
}
]
}Create Media Folder
Creates a folder in the media library.
Creates a folder in the media library.
API key authentication. Format: "Bearer-API YOUR_API_KEY"
ID of the workspace containing the resource
Folder name, 1 to 150 characters
Create inside this folder. Omit for a root-level folder.
Folder created
null for a root-level folder
Unauthorized
Unprocessable Entity - invalid name or parent
POST /api/v1/media/folders HTTP/1.1
Host: app.publer.com
Authorization: YOUR_API_KEY
Publer-Workspace-Id: text
Content-Type: application/json
Accept: */*
Content-Length: 41
{
"name": "text",
"parent_folder_id": "text"
}{
"id": "text",
"name": "text",
"parent_folder_id": "text",
"created_at": "text"
}Update Media Folder
Rename a folder or moves it under a different parent.
Renames a folder or moves it under a different parent.
API key authentication. Format: "Bearer-API YOUR_API_KEY"
ID of the folder
ID of the workspace containing the resource
New parent folder
Folder updated
null for a root-level folder
Unauthorized
Forbidden - invalid parent folder, or you are not the folder creator, owner or an admin
Unprocessable Entity - the move would create a circular reference
PUT /api/v1/media/folders/{id} HTTP/1.1
Host: app.publer.com
Authorization: YOUR_API_KEY
Publer-Workspace-Id: text
Content-Type: application/json
Accept: */*
Content-Length: 41
{
"name": "text",
"parent_folder_id": "text"
}{
"id": "text",
"name": "text",
"parent_folder_id": "text",
"created_at": "text"
}A folder cannot be moved into itself or into one of its own descendants; either returns 422.
Delete Media Folder
Deletes an empty folder.
Deletes an empty folder.
API key authentication. Format: "Bearer-API YOUR_API_KEY"
ID of the folder
ID of the workspace containing the resource
Folder deleted
No content
Unauthorized
Forbidden - the folder still contains media or sub-folders, or you lack permission
DELETE /api/v1/media/folders/{id} HTTP/1.1
Host: app.publer.com
Authorization: YOUR_API_KEY
Publer-Workspace-Id: text
Accept: */*
No content
Returns 204 No Content on success. A folder that still contains library media or sub-folders returns 403 — empty it first, using the move endpoint below.
Move Media Between Folders
Moves a set of media items into a folder, or to the library root.
Moves a set of media items into a folder, or to the library root.
API key authentication. Format: "Bearer-API YOUR_API_KEY"
Destination folder ID. Pass a non-ID value (or omit) to move items to the library root.
IDs of the media items to move
ID of the workspace containing the resource
Move completed
IDs actually moved. Items you lack permission on are skipped silently.
Destination folder, or null for the library root
Unauthorized
PUT /api/v1/media/folders/move_to_folder?media_ids=text HTTP/1.1
Host: app.publer.com
Authorization: YOUR_API_KEY
Publer-Workspace-Id: text
Accept: */*
{
"updated_ids": [
"text"
],
"folder_id": "text"
}Omit id to move items back to the library root.
Notes
Folders are returned newest first.
previous_foldersis the breadcrumb trail from the root down to and including the requested folder, so you can render or walk the current location. It is empty when listing root-level folders.Listing is scoped to one level at a time. To walk a tree, call the endpoint again with the
idof each folder you want to descend into.Folder names are unique per level. Creating a folder whose name already exists in the same parent appends a counter, for example
Campaigns (1).A
parent_folder_idthat does not exist in this workspace returns 422 Unprocessable Entity.
Last updated
Was this helpful?

