Replace a file with its edit
Replace a file with its edit (media:write, posts:write, posts:delete)
Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.
The media editor's "Replace the original". A media id never changes content, so the edit is a new file that takes the original's name, alt text, folder and tags; drafts that used the original use it instead, and the original moves to Deleted (restorable for 30 days). A file that a scheduled, publishing, published or failed post uses answers 409: those posts keep what they had, save the edit as a new file instead.
AuthorizationBearer <token>API key (stk_...), or in the Community Edition the access token (stk_local_...)
id*stringmultipart/form-data- body
file*filebinaryThe edited file
application/json- response
An uploaded file
id*stringmime_type*stringsize_bytes*integeroriginal_name*stringurl*stringAbsolute URL (PUBLIC_API_URL); requires authentication
sha256*stringcreated_at*stringdate-timealt_text*stringDescribes a picture for people who can't see it; platforms that take alt text receive it
width*integerPixels; measured on upload for pictures, reported by the uploading browser for videos; 0 when unknown
height*integerPixels; 0 when unknown
duration_ms*integerA video's or audio file's length in milliseconds; 0 when unknown
folder_id*stringThe library folder the file sits in; empty for the top level
tags*array<string>deleted_at?stringSet while the file is in Deleted
date-timepurge_at?stringWhen a file in Deleted is deleted for good
date-timeduplicate_of?stringThe oldest other file with the same content, if any
curl -X POST 'https://staqly.example.com/v1/media/string/replace' \ -F 'file=string'{ "id": "string", "mime_type": "string", "size_bytes": 0, "original_name": "string", "url": "string", "sha256": "string", "created_at": "2019-08-24T14:15:22Z", "alt_text": "string", "width": 0, "height": 0, "duration_ms": 0, "folder_id": "string", "tags": [ "string" ], "deleted_at": "2019-08-24T14:15:22Z", "purge_at": "2019-08-24T14:15:22Z", "duplicate_of": "string"}