Post/upload file via admin API

Hi all,

Does the admin API support generic file upload (not just image formats, but say PDF, ZIP, text files, etc)? The editor supports this

Can this be done by using/abusing the existing image upload API?

The goal is to create posts via API that contain both embedded images and non-image files

Thanks!

Yep, since the editor supports generic file upload, you should be able to upload a generic file using the admin API. If it’s not documented in the docs, you can inspect the network traffic to see what you need to do.

1 Like