Media endpoint to rename media

Hey there! Is there an endpoint in the API to rename media? I’m looking to GET/POST/PUT media.

There doesn’t seem to be any documentation for it, but it looks like the Micro.blog web app can do it, so I’m wondering if anyone has discovered it.

Thanks!

There’s not an official API for renaming yet. Uploads mostly uses the Micropub API, and I don’t think renaming is part of the spec. You can specify a filename during the upload, though.

If you need this now, you could copy the HTTP request the Micro.blog web app uses. It might change in the future, but probably not.

POST /account/uploads/<site ID>/info/<upload ID>

filename=newfilename.jpg

That won’t work in JavaScript web apps, though, because of cross-site restrictions.

If there’s a proposal for extending Micropub to support renaming uploads in the future, we’ll support it.

Sorry, just realized the upload ID isn’t exposed in the Micropub media endpoint, so perhaps this isn’t as useful as I thought. I’ll ask around and see if anyone has already thought about this for Micropub.