Reserve a media upload
curl --request POST \
--url https://posted-api.example.com/api/media/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "studio.jpg",
"contentType": "image/jpeg",
"sizeBytes": 245760,
"alt": "A bright studio desk beside a window"
}
'import requests
url = "https://posted-api.example.com/api/media/uploads"
payload = {
"fileName": "studio.jpg",
"contentType": "image/jpeg",
"sizeBytes": 245760,
"alt": "A bright studio desk beside a window"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileName: 'studio.jpg',
contentType: 'image/jpeg',
sizeBytes: 245760,
alt: 'A bright studio desk beside a window'
})
};
fetch('https://posted-api.example.com/api/media/uploads', 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://posted-api.example.com/api/media/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileName' => 'studio.jpg',
'contentType' => 'image/jpeg',
'sizeBytes' => 245760,
'alt' => 'A bright studio desk beside a window'
]),
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://posted-api.example.com/api/media/uploads"
payload := strings.NewReader("{\n \"fileName\": \"studio.jpg\",\n \"contentType\": \"image/jpeg\",\n \"sizeBytes\": 245760,\n \"alt\": \"A bright studio desk beside a window\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://posted-api.example.com/api/media/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"studio.jpg\",\n \"contentType\": \"image/jpeg\",\n \"sizeBytes\": 245760,\n \"alt\": \"A bright studio desk beside a window\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://posted-api.example.com/api/media/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"studio.jpg\",\n \"contentType\": \"image/jpeg\",\n \"sizeBytes\": 245760,\n \"alt\": \"A bright studio desk beside a window\"\n}"
response = http.request(request)
puts response.read_body{
"mediaId": "44444444-4444-4444-8444-444444444444",
"uploadUrl": "https://storage.example.test/signed-upload",
"headers": {
"Content-Type": "image/jpeg"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Reserve a media upload
Reserve a private image or video upload. PUT the approved file to the returned URL using its headers, then complete the upload. No post is created.
POST
/
api
/
media
/
uploads
Reserve a media upload
curl --request POST \
--url https://posted-api.example.com/api/media/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "studio.jpg",
"contentType": "image/jpeg",
"sizeBytes": 245760,
"alt": "A bright studio desk beside a window"
}
'import requests
url = "https://posted-api.example.com/api/media/uploads"
payload = {
"fileName": "studio.jpg",
"contentType": "image/jpeg",
"sizeBytes": 245760,
"alt": "A bright studio desk beside a window"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileName: 'studio.jpg',
contentType: 'image/jpeg',
sizeBytes: 245760,
alt: 'A bright studio desk beside a window'
})
};
fetch('https://posted-api.example.com/api/media/uploads', 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://posted-api.example.com/api/media/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileName' => 'studio.jpg',
'contentType' => 'image/jpeg',
'sizeBytes' => 245760,
'alt' => 'A bright studio desk beside a window'
]),
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://posted-api.example.com/api/media/uploads"
payload := strings.NewReader("{\n \"fileName\": \"studio.jpg\",\n \"contentType\": \"image/jpeg\",\n \"sizeBytes\": 245760,\n \"alt\": \"A bright studio desk beside a window\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://posted-api.example.com/api/media/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"studio.jpg\",\n \"contentType\": \"image/jpeg\",\n \"sizeBytes\": 245760,\n \"alt\": \"A bright studio desk beside a window\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://posted-api.example.com/api/media/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"studio.jpg\",\n \"contentType\": \"image/jpeg\",\n \"sizeBytes\": 245760,\n \"alt\": \"A bright studio desk beside a window\"\n}"
response = http.request(request)
puts response.read_body{
"mediaId": "44444444-4444-4444-8444-444444444444",
"uploadUrl": "https://storage.example.test/signed-upload",
"headers": {
"Content-Type": "image/jpeg"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Write access: a member/administrator with a write-enabled credential, or an authorized signed-in user.
Reserve a private image or video upload. PUT the approved file to the returned URL using its headers, then complete the upload. No post is created.
Use the returned uploadUrl and headers for the separate storage PUT. Reserving an upload does not create a post. Keep signed URLs private and use them before expiry.
MCP clients can use
reserve_media_upload for this operation.
Request conventions · API keys · MCP connectionsAuthorizations
bearerAuthsessionCookie
Personal or team Posted REST API key
Body
application/json
Was this page helpful?
