curl --request PATCH \
--url https://api.scripe.io/v1/posts/{postId}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"media": {
"kind": "images",
"images": [
{
"source": "key",
"key": "<string>",
"alt": "<string>",
"name": "<string>"
}
]
}
}
'import requests
url = "https://api.scripe.io/v1/posts/{postId}/media"
payload = { "media": {
"kind": "images",
"images": [
{
"source": "key",
"key": "<string>",
"alt": "<string>",
"name": "<string>"
}
]
} }
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: {
kind: 'images',
images: [{source: 'key', key: '<string>', alt: '<string>', name: '<string>'}]
}
})
};
fetch('https://api.scripe.io/v1/posts/{postId}/media', 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://api.scripe.io/v1/posts/{postId}/media",
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' => [
'kind' => 'images',
'images' => [
[
'source' => 'key',
'key' => '<string>',
'alt' => '<string>',
'name' => '<string>'
]
]
]
]),
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://api.scripe.io/v1/posts/{postId}/media"
payload := strings.NewReader("{\n \"media\": {\n \"kind\": \"images\",\n \"images\": [\n {\n \"source\": \"key\",\n \"key\": \"<string>\",\n \"alt\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\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://api.scripe.io/v1/posts/{postId}/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"media\": {\n \"kind\": \"images\",\n \"images\": [\n {\n \"source\": \"key\",\n \"key\": \"<string>\",\n \"alt\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripe.io/v1/posts/{postId}/media")
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 \"kind\": \"images\",\n \"images\": [\n {\n \"source\": \"key\",\n \"key\": \"<string>\",\n \"alt\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"postId": "<string>",
"kind": "images",
"media": {
"kind": "images",
"images": [
{
"key": "rrb7bw8pfuc.png",
"alt": "<string>",
"name": "<string>"
}
]
}
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}Set a post's media (full-state)
Replaces the post’s media in one write — read media on the post
first and resend the entries you are keeping, or they are gone.
Library images resolve to durable S3 keys server-side, so a post
never depends on an expiring CDN URL; assets without a stored
original are rejected with unprocessable.
source: "key" takes a stored file key — one the post already
carries. A media-library id (img_…), an upload handle
(upl_…) or a displayUrl is rejected with unprocessable
naming the branch that accepts it, because the publish step
classifies the key by extension and cannot use any of them: an
unclassifiable key used to be stored happily and then fail on
the publish cron, hours later.
A post the dashboard gave a LinkedIn poll refuses media with
conflict and is left unchanged: a post publishes media or a
poll, never both. Clearing media (kind: "none") is not refused.
The response echoes the post’s resulting media. Requires
posts:write AND media:read.
curl --request PATCH \
--url https://api.scripe.io/v1/posts/{postId}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"media": {
"kind": "images",
"images": [
{
"source": "key",
"key": "<string>",
"alt": "<string>",
"name": "<string>"
}
]
}
}
'import requests
url = "https://api.scripe.io/v1/posts/{postId}/media"
payload = { "media": {
"kind": "images",
"images": [
{
"source": "key",
"key": "<string>",
"alt": "<string>",
"name": "<string>"
}
]
} }
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: {
kind: 'images',
images: [{source: 'key', key: '<string>', alt: '<string>', name: '<string>'}]
}
})
};
fetch('https://api.scripe.io/v1/posts/{postId}/media', 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://api.scripe.io/v1/posts/{postId}/media",
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' => [
'kind' => 'images',
'images' => [
[
'source' => 'key',
'key' => '<string>',
'alt' => '<string>',
'name' => '<string>'
]
]
]
]),
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://api.scripe.io/v1/posts/{postId}/media"
payload := strings.NewReader("{\n \"media\": {\n \"kind\": \"images\",\n \"images\": [\n {\n \"source\": \"key\",\n \"key\": \"<string>\",\n \"alt\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\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://api.scripe.io/v1/posts/{postId}/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"media\": {\n \"kind\": \"images\",\n \"images\": [\n {\n \"source\": \"key\",\n \"key\": \"<string>\",\n \"alt\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripe.io/v1/posts/{postId}/media")
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 \"kind\": \"images\",\n \"images\": [\n {\n \"source\": \"key\",\n \"key\": \"<string>\",\n \"alt\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"postId": "<string>",
"kind": "images",
"media": {
"kind": "images",
"images": [
{
"key": "rrb7bw8pfuc.png",
"alt": "<string>",
"name": "<string>"
}
]
}
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"request_id": "req_a1b2c3d4e5f6",
"docs_url": "<string>",
"details": "<unknown>"
}
}Authorizations
Pass Authorization: Bearer scripe_sk_live_<...> (or
scripe_sk_test_<...> for test keys) on every request. Keys
are scoped to a single workspace and can be revoked from the
Scripe dashboard.
The same header also accepts an OAuth 2.1 access token
(scripe_oat_*); both credentials share one scope vocabulary
and every operation below documents the scope it requires.
An API key can hold every scope named on this surface except
webhooks:manage, which is grantable to OAuth tokens only
today — the webhook-endpoint operations answer
403 scope_missing to every API key. Operations that name no
scope accept any valid token of the workspace.
Headers
Pin the API version. Format YYYY-MM-DD. Omit to receive the
currently rolling default. Unknown versions return 400 version_unsupported.
"2026-08-10"
Path Parameters
"post_a1b2c3d4e5f6g7h8"
Body
Discriminated on kind — images (from library img_… ids or upload keys), video, document (PDF), or none to clear.
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Response
Media set.
Show child attributes
Show child attributes