🎉 NewsPro 3.0 Launch Discount — use code NEWSPRO3LAUNCH for 20% OFF · ends May 31 View plans →

API Reference

Full documentation for the NewsPro REST API. Manage content, media, and users programmatically.

Media

Available Fields

FieldTypeDescription
idintMedia file ID
file_namestringFile name
file_pathstringFull path or CDN URL to the file
file_typestringMIME type (e.g. image/jpeg, video/mp4, audio/mpeg)
file_sizestringHuman-readable file size (e.g. 245 KB)
resolutionstringImage resolution (e.g. 1920x1080)
titlestringDisplay title in media library
creditstringPhoto/video credit or source attribution
descriptionstringInternal notes or alt text
cache_versionsjsonCached size variants (304px, 500px, 800px WebP)
created_atdatetimeUpload date

Get Media

{"resource":"media","action":"get","filters":{"file_type":"image/jpeg","search":"banner","date_from":"2025-01-01"},"fields":["id","file_name","file_path","file_type","file_size","title","created_at"],"limit":20,"order_by":"id DESC"}

Upload from URL

Downloads a file from a public URL and imports it into the media library. Returns the new media id to use in articles/pages. Supports images (JPG, PNG, WebP, GIF), video, and audio.

// Request
{"resource":"media","action":"upload_from_url","file_url":"https://example.com/image.jpg"}

// Response
{"status":"success","files":[[{"id":"48","file_path":"...","file_type":"image/jpeg"}]]}

Update Metadata

{"resource":"media","action":"update_metadata","file_id":123,"title":"Photo title","credit":"Photographer Name / Agency","description":"Photo description or alt text"}

Delete Media

Deletes the file and all its cached size variants.

{"resource":"media","action":"delete","file_id":123}

Regenerate Cache

Regenerates all image cache sizes (304px, 500px, 800px WebP) for every file in the library.

{"resource":"media","action":"create_all_cache"}
Copied to clipboard!