Content Library & Folders
The content library is the creator-facing backend/API surface for browsing and organizing products after upload.
Current backend capabilities
The live backend currently supports:
- paginated product fetching
- sorting
- folder-based filtering
- an explicit unassigned-products filter
- folder CRUD
- per-product folder assignment
- collection toggling
Product list behavior
The primary content-library endpoint is:
GET /api/products
Supported query parameters confirmed in the live backend:
pagelimitsort_byfolder_idfolder_state=unassigned- legacy
filterFolder
The current response includes:
pages_totalcollection_linkdata
Important note:
The current live backend does not expose separate top-level fields such as totalCount, allItemsCount, or folderCounts on this endpoint. Client code should not assume those fields exist unless the backend adds them in a future release.
Sorting
Sort options are exposed through app bootstrap data and product-index handling. The client should prefer backend-supported sort keys instead of inventing new ones.
Folder lifecycle
Create
POST /api/content-folders
Rename
PATCH /api/content-folders/{contentFolder}
Delete
DELETE /api/content-folders/{contentFolder}
Deleting a folder does not delete products. It removes the folder assignment from those products.
Assigning and removing folder membership
Use:
PATCH /api/products/{product}/folder
Examples:
Assign to folder 12:
{
"folder_id": 12
}Remove folder assignment:
{
"folder_id": null
}The product resource includes both:
folder_idfolder
so the client can render current folder state without a second lookup.
Unassigned filter
To fetch products without a folder, use:
GET /api/products?folder_state=unassignedThis is the preferred explicit backend filter.
Collection behavior
Collection membership is separate from folders.
Use:
POST /api/products/{product}/collection
The backend toggles collection membership and creates the collection / short link if needed.
Folders and collections serve different purposes:
- folders organize the creator library
- collections affect grouped creator-side / link-side behavior
Search expectations
The current backend contract for the content-library product list does not expose a dedicated full-library search parameter in the same way the creator-search endpoint does. Search UX on the web app should only document parameters that are confirmed in the backend implementation.
If search is added or expanded later, it should be documented as a new contract rather than assumed from UI behavior alone.
Example flow
GET /api/content-foldersGET /api/products?page=1&limit=18PATCH /api/products/{product}/folderGET /api/products?folder_id=12GET /api/products?folder_state=unassigned