curl --request PATCH \
--url https://{defaultHost}/v1/medias/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"media": {
"title": "My Image Title"
}
}
'import requests
url = "https://{defaultHost}/v1/medias/{id}"
payload = { "media": { "title": "My Image Title" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({media: {title: 'My Image Title'}})
};
fetch('https://{defaultHost}/v1/medias/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/medias/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'media' => [
'title' => 'My Image Title'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/medias/{id}"
payload := strings.NewReader("{\n \"media\": {\n \"title\": \"My Image Title\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/medias/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"media\": {\n \"title\": \"My Image Title\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/medias/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"media\": {\n \"title\": \"My Image Title\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "616a4ab3-d7b8-4065-95d7-226b159a4b32",
"object": "media",
"alt": null,
"byte_size": 12254,
"content_type": "image/png",
"extension": "png",
"filename": "test.png",
"height": null,
"public_access": false,
"release_json": null,
"title": "My Image Title",
"url": null,
"width": null,
"url_expires_at": null,
"created_at": 1787228413,
"updated_at": 1787228413
}Update
Updates a specific media.
curl --request PATCH \
--url https://{defaultHost}/v1/medias/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"media": {
"title": "My Image Title"
}
}
'import requests
url = "https://{defaultHost}/v1/medias/{id}"
payload = { "media": { "title": "My Image Title" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({media: {title: 'My Image Title'}})
};
fetch('https://{defaultHost}/v1/medias/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/medias/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'media' => [
'title' => 'My Image Title'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/medias/{id}"
payload := strings.NewReader("{\n \"media\": {\n \"title\": \"My Image Title\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/medias/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"media\": {\n \"title\": \"My Image Title\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/medias/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"media\": {\n \"title\": \"My Image Title\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "616a4ab3-d7b8-4065-95d7-226b159a4b32",
"object": "media",
"alt": null,
"byte_size": 12254,
"content_type": "image/png",
"extension": "png",
"filename": "test.png",
"height": null,
"public_access": false,
"release_json": null,
"title": "My Image Title",
"url": null,
"width": null,
"url_expires_at": null,
"created_at": 1787228413,
"updated_at": 1787228413
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Show child attributes
Show child attributes
Response
Success
The UUID of the specific object.
A string describing the object type returned.
The size of the media in bytes.
The content type (i.e. image/png, image/jpg, application/pdf).
The extension (i.e. png, jpg, pdf).
The full filename with extension.
If the media is an image, this will be the height in pixels.
Whether or not this media is publicly accessible.
The JSON that was extracted from the release.json file within the ZIP file.
The URL for accessing this media. If the media is public, this will be a permanent URL. If the media is private, this will be a short-lived URL if the media has been exposed.
The time at which the URL expires. This will only be present if the media is private and has been exposed.
If the media is an image, this will be the width in pixels.
Time at which the object was created. Measured in seconds since the Unix epoch.
Time at which the object was last updated. Measured in seconds since the Unix epoch.
Was this page helpful?