Media¶
Upload images and files to attach to listings.
- Base URL:
/wp-json/dms/v1/ - All requests require a Bearer API key - see Authentication.
- Requests are
multipart/form-datauploads.
Endpoints¶
| Method | Path | Capability | Purpose |
|---|---|---|---|
| POST | upload_image |
modify_gallery |
Upload a gallery image. |
| POST | upload_file |
edit_all_inventory |
Upload a file attachment. |
Both return the created media attachment (including its id), which you then reference from a listing - e.g. in the Listings images field.
POST /upload_image¶
Capability: modify_gallery. Send the image as multipart form data.
curl -X POST "https://your-site.com/wp-json/dms/v1/upload_image" \
-H "Authorization: Bearer YOUR_KEY" \
-F "file=@/path/to/photo.jpg"
POST /upload_file¶
Capability: edit_all_inventory. Send the file as multipart form data.
curl -X POST "https://your-site.com/wp-json/dms/v1/upload_file" \
-H "Authorization: Bearer YOUR_KEY" \
-F "file=@/path/to/window-sticker.pdf"
See also¶
- Listings - attach uploaded media via the
imagesfield.