Files
bookhoard/bruno/media-items/Create Media Item.yml
T
john-okeefe af3c3019cf refactor: reorganize Bruno API collection for better structure
- Remove obsolete scenarios/ folder and move requests to root media-items/
- Create new filters/ folder for field value autocomplete searches
- Move Field Values Search requests from search/ to filters/ for clarity
- Move Search Media Items from scenarios/ to search/ for consistency
- Update sequence numbers across all media-items requests (2-13)
- Remove redundant folder configuration files
- Improve API collection organization for better discoverability
2026-03-27 21:14:34 -04:00

53 lines
1.1 KiB
YAML

info:
name: Create Media Item
type: http
seq: 3
http:
method: POST
url: "{{base_url}}/api/media-items"
headers:
- name: ""
value: application/json
body:
type: json
data: |-
{
"library_id": "{{library_id}}",
"title": "Test Book",
"author": "Test Author",
"file_path": "/path/to/book.epub",
"file_size": 1024,
"mime_type": "application/epub+zip"
}
auth: inherit
runtime:
scripts:
- type: tests
code: |-
test_create_media_item_success(status, headers, body) {
if (status !== 201) {
throw new Error("Expected status 201, got " + status);
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
## Create Media Item
Creates a new media item in a library with full metadata.
**Method:** POST
**Endpoint:** /api/media-items
**Authentication:** Required (Bearer token, admin only)
**Prerequisites**
- Library must have at least one folder configured before media items can be added
- Use `POST /api/libraries/{library_id