Skip to main content

Update a Media

This endpoint updates a Media

info

It must be used for media of type url for set the preview image that can be choosed between the images returned by the create endpoint or other images that can be retrieved by an url.

info

This operation requires authentication. The logged user must be the media creator

HTTP Request

PUT /api/v2/media/{id}/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this media object
» imagebodystring(uri)trueImage url

Example Body Parameters

{
"image": "https://example.com"
}

Example Request

const inputBody = '{
"image": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/media/{id}/',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKResponse status codeMedia

Example responses

{
"id": "integer",
"added_at": "string",
"type": "string",
"title": "string",
"description": "string",
"url": "string(uri)",
"image": "string",
"image_width": "integer",
"image_height": "integer",
"order": "integer",
"embed": {Embed}
}