curl --request POST \
--url https://api.scripe.io/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "proj_a1b2c3d4e5f6g7h8",
"content_base64": "<string>",
"sha256": "<string>",
"uploadId": "upl_org_2aSH--30e8e643de8b4f01",
"fileName": "keynote-stage.jpg",
"mimeType": "image/png",
"alt": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.scripe.io/v1/media"
payload = {
"projectId": "proj_a1b2c3d4e5f6g7h8",
"content_base64": "<string>",
"sha256": "<string>",
"uploadId": "upl_org_2aSH--30e8e643de8b4f01",
"fileName": "keynote-stage.jpg",
"mimeType": "image/png",
"alt": "<string>",
"title": "<string>"
}
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({
projectId: 'proj_a1b2c3d4e5f6g7h8',
content_base64: '<string>',
sha256: '<string>',
uploadId: 'upl_org_2aSH--30e8e643de8b4f01',
fileName: 'keynote-stage.jpg',
mimeType: 'image/png',
alt: '<string>',
title: '<string>'
})
};
fetch('https://api.scripe.io/v1/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/media",
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([
'projectId' => 'proj_a1b2c3d4e5f6g7h8',
'content_base64' => '<string>',
'sha256' => '<string>',
'uploadId' => 'upl_org_2aSH--30e8e643de8b4f01',
'fileName' => 'keynote-stage.jpg',
'mimeType' => 'image/png',
'alt' => '<string>',
'title' => '<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/media"
payload := strings.NewReader("{\n \"projectId\": \"proj_a1b2c3d4e5f6g7h8\",\n \"content_base64\": \"<string>\",\n \"sha256\": \"<string>\",\n \"uploadId\": \"upl_org_2aSH--30e8e643de8b4f01\",\n \"fileName\": \"keynote-stage.jpg\",\n \"mimeType\": \"image/png\",\n \"alt\": \"<string>\",\n \"title\": \"<string>\"\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://api.scripe.io/v1/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"proj_a1b2c3d4e5f6g7h8\",\n \"content_base64\": \"<string>\",\n \"sha256\": \"<string>\",\n \"uploadId\": \"upl_org_2aSH--30e8e643de8b4f01\",\n \"fileName\": \"keynote-stage.jpg\",\n \"mimeType\": \"image/png\",\n \"alt\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripe.io/v1/media")
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 \"projectId\": \"proj_a1b2c3d4e5f6g7h8\",\n \"content_base64\": \"<string>\",\n \"sha256\": \"<string>\",\n \"uploadId\": \"upl_org_2aSH--30e8e643de8b4f01\",\n \"fileName\": \"keynote-stage.jpg\",\n \"mimeType\": \"image/png\",\n \"alt\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "img_a1b2c3d4e5f6g7h8",
"projectId": "<string>",
"source": "UPLOAD",
"status": "<string>",
"tags": [
"<string>"
],
"reusability": "<string>",
"createdAt": "<string>",
"title": "<string>",
"fileName": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123,
"alt": "<string>",
"aiCaption": "<string>",
"generatedAssetKind": "<string>",
"provenance": {
"provider": "<string>",
"authorName": "<string>",
"permalink": "<string>"
},
"displayUrl": "<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>"
}
}Add your own image to the media library
Register an image the customer supplied as a media-library asset of the project, so it can be attached to a post.
This is the producer the library was missing on this surface.
POST /v1/uploads accepts image/*, but its handle is consumed
by POST /v1/sources and POST /v1/knowledge — neither of
which produces media — and PATCH /v1/posts/{postId}/media
takes either a library img_… id or a stored file key, never an
upload handle. Every other library writer is first-party (the
dashboard, the LinkedIn sync, POST /v1/media/generations).
Two ways in, exactly one of them per call:
content_base64— the bytes inline, for SMALL files only (≤ ~3 MB decoded ≈ 4 MB as base64). Larger request bodies are rejected at the platform edge (~4.5 MB on the wire) with a bare HTTP 413 that carries no error envelope, so pre-check the file size instead of retrying inline. An optionalsha256of the decoded bytes is verified after decode.uploadId— anupl_…handle fromPOST /v1/uploads, after the bytes have been PUT to its signed URL. Preferred for anything larger than the inline cap; the signed PUT takes the full 25 MB image cap.
The stored object is copied into the project’s
image-library/ prefix with a file extension, which is what the
publish step needs in order to tell an image from a document.
The response is the same MediaAsset object GET /v1/media
lists.
The asset is returned status: PROCESSING and is attachable
immediately — attach resolves the stored file, not the status.
Cloudflare re-hosting and vision tagging run asynchronously;
GET /v1/media (READY only) lists it once they finish.
Sending the same bytes, or the same upload handle, twice returns
the asset already created rather than a duplicate row. Re-sending
the bytes of an asset that was deleted (MCP delete_media_asset)
restores it under a freshly minted storage key, so an object an
existing post already points at is never overwritten; the rare
case where that restore cannot be recorded answers 409.
Images only: SVG is refused (it is a script-bearing document and
LinkedIn rejects it), and a non-image content type is refused
naming the endpoint that takes it. Requires media:write.
curl --request POST \
--url https://api.scripe.io/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "proj_a1b2c3d4e5f6g7h8",
"content_base64": "<string>",
"sha256": "<string>",
"uploadId": "upl_org_2aSH--30e8e643de8b4f01",
"fileName": "keynote-stage.jpg",
"mimeType": "image/png",
"alt": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.scripe.io/v1/media"
payload = {
"projectId": "proj_a1b2c3d4e5f6g7h8",
"content_base64": "<string>",
"sha256": "<string>",
"uploadId": "upl_org_2aSH--30e8e643de8b4f01",
"fileName": "keynote-stage.jpg",
"mimeType": "image/png",
"alt": "<string>",
"title": "<string>"
}
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({
projectId: 'proj_a1b2c3d4e5f6g7h8',
content_base64: '<string>',
sha256: '<string>',
uploadId: 'upl_org_2aSH--30e8e643de8b4f01',
fileName: 'keynote-stage.jpg',
mimeType: 'image/png',
alt: '<string>',
title: '<string>'
})
};
fetch('https://api.scripe.io/v1/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/media",
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([
'projectId' => 'proj_a1b2c3d4e5f6g7h8',
'content_base64' => '<string>',
'sha256' => '<string>',
'uploadId' => 'upl_org_2aSH--30e8e643de8b4f01',
'fileName' => 'keynote-stage.jpg',
'mimeType' => 'image/png',
'alt' => '<string>',
'title' => '<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/media"
payload := strings.NewReader("{\n \"projectId\": \"proj_a1b2c3d4e5f6g7h8\",\n \"content_base64\": \"<string>\",\n \"sha256\": \"<string>\",\n \"uploadId\": \"upl_org_2aSH--30e8e643de8b4f01\",\n \"fileName\": \"keynote-stage.jpg\",\n \"mimeType\": \"image/png\",\n \"alt\": \"<string>\",\n \"title\": \"<string>\"\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://api.scripe.io/v1/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"proj_a1b2c3d4e5f6g7h8\",\n \"content_base64\": \"<string>\",\n \"sha256\": \"<string>\",\n \"uploadId\": \"upl_org_2aSH--30e8e643de8b4f01\",\n \"fileName\": \"keynote-stage.jpg\",\n \"mimeType\": \"image/png\",\n \"alt\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripe.io/v1/media")
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 \"projectId\": \"proj_a1b2c3d4e5f6g7h8\",\n \"content_base64\": \"<string>\",\n \"sha256\": \"<string>\",\n \"uploadId\": \"upl_org_2aSH--30e8e643de8b4f01\",\n \"fileName\": \"keynote-stage.jpg\",\n \"mimeType\": \"image/png\",\n \"alt\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "img_a1b2c3d4e5f6g7h8",
"projectId": "<string>",
"source": "UPLOAD",
"status": "<string>",
"tags": [
"<string>"
],
"reusability": "<string>",
"createdAt": "<string>",
"title": "<string>",
"fileName": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123,
"alt": "<string>",
"aiCaption": "<string>",
"generatedAssetKind": "<string>",
"provenance": {
"provider": "<string>",
"authorName": "<string>",
"permalink": "<string>"
},
"displayUrl": "<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"
Body
Exactly one of content_base64 or uploadId is required.
Project whose library receives the image. Optional for an OAuth principal with a default project pinned at consent time.
"proj_a1b2c3d4e5f6g7h8"
Base64-encoded image bytes, ≤ ~3 MB decoded (larger request
bodies are rejected at the platform edge as a bare HTTP 413
— use the uploadId path instead). Mutually exclusive with
uploadId.
Optional hex SHA-256 of the DECODED image bytes (inline
path only; refused beside uploadId). Strongly recommended
when the caller can compute it — base64 relayed through
model output corrupts silently, and a digest mismatch is
rejected naming both digests instead of storing the wrong
bytes.
upl_… handle from POST /v1/uploads, after the bytes have
been PUT to its signed URL. Mutually exclusive with
content_base64. A handle whose object does not exist is a
422, not a 404 — the handle is valid, the upload never
happened.
"upl_org_2aSH--30e8e643de8b4f01"
Original filename. On the inline path it is also how the
content type is inferred when mimeType is omitted.
200"keynote-stage.jpg"
Image MIME type for the inline path. Ignored on the
uploadId path, where the stored object's own content type
(bound into the signature at mint time) is authoritative.
200"image/png"
Alt text, carried onto the post at attach time.
1000120Response
The created (or already-existing) asset.
Show child attributes
Show child attributes