curl --request POST \
--url https://api.superx.so/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "chart.png",
"file_type": "image/png",
"size": 48213
}
'import requests
url = "https://api.superx.so/v1/media"
payload = {
"filename": "chart.png",
"file_type": "image/png",
"size": 48213
}
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: 'chart.png', file_type: 'image/png', size: 48213})
};
fetch('https://api.superx.so/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.superx.so/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([
'filename' => 'chart.png',
'file_type' => 'image/png',
'size' => 48213
]),
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.superx.so/v1/media"
payload := strings.NewReader("{\n \"filename\": \"chart.png\",\n \"file_type\": \"image/png\",\n \"size\": 48213\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.superx.so/v1/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"chart.png\",\n \"file_type\": \"image/png\",\n \"size\": 48213\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superx.so/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 \"filename\": \"chart.png\",\n \"file_type\": \"image/png\",\n \"size\": 48213\n}"
response = http.request(request)
puts response.read_body{
"data": {
"object_key": "u123/api_1751980800000_9f3a1c2b_chart.png",
"url": "https://media.superx.so/u123/api_1751980800000_9f3a1c2b_chart.png",
"upload_url": "https://<bucket-host>/u123/api_1751980800000_9f3a1c2b_chart.png?X-Amz-...",
"expires_at": "2026-07-08T15:20:00.000Z"
}
}{
"error": {
"code": "unsupported_media_type",
"message": "file_type must be one of: image/jpeg, image/png, image/webp, image/gif. Videos are not supported yet."
}
}{
"error": {
"code": "invalid_api_key",
"message": "Unknown or revoked API key"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This API key is read-only. Create a key with the write scope to use this endpoint."
}
}{
"error": {
"code": "media_quota_exceeded",
"message": "Daily media upload limit reached (100/day). Retry after the indicated delay."
}
}{
"error": {
"code": "internal_error",
"message": "Failed to fetch posts"
}
}{
"error": {
"code": "media_not_configured",
"message": "Media storage is not configured on this server. Try again later."
}
}Presign an image upload
Registers an image upload and returns a presigned upload_url. PUT
the raw file bytes to upload_url within 20 minutes, with the
Content-Type header set to the same file_type you declared here.
Then reference the returned object_key in parts[].media on the
scheduled-posts create/update endpoints.
Images only: image/jpeg, image/png, image/webp (5 MB max each)
and image/gif (15 MB max). The attach step re-checks the real bytes
(size and magic-byte type), so a mismatched upload fails at attach
time. Uploads never attached to a post are deleted after 24 hours.
Needs the write scope. Quota: 100 uploads per key per day, on top of
the normal write rate limits. No Idempotency-Key handling: a
duplicate presign is just an unused upload that expires.
curl --request POST \
--url https://api.superx.so/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "chart.png",
"file_type": "image/png",
"size": 48213
}
'import requests
url = "https://api.superx.so/v1/media"
payload = {
"filename": "chart.png",
"file_type": "image/png",
"size": 48213
}
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: 'chart.png', file_type: 'image/png', size: 48213})
};
fetch('https://api.superx.so/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.superx.so/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([
'filename' => 'chart.png',
'file_type' => 'image/png',
'size' => 48213
]),
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.superx.so/v1/media"
payload := strings.NewReader("{\n \"filename\": \"chart.png\",\n \"file_type\": \"image/png\",\n \"size\": 48213\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.superx.so/v1/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"chart.png\",\n \"file_type\": \"image/png\",\n \"size\": 48213\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superx.so/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 \"filename\": \"chart.png\",\n \"file_type\": \"image/png\",\n \"size\": 48213\n}"
response = http.request(request)
puts response.read_body{
"data": {
"object_key": "u123/api_1751980800000_9f3a1c2b_chart.png",
"url": "https://media.superx.so/u123/api_1751980800000_9f3a1c2b_chart.png",
"upload_url": "https://<bucket-host>/u123/api_1751980800000_9f3a1c2b_chart.png?X-Amz-...",
"expires_at": "2026-07-08T15:20:00.000Z"
}
}{
"error": {
"code": "unsupported_media_type",
"message": "file_type must be one of: image/jpeg, image/png, image/webp, image/gif. Videos are not supported yet."
}
}{
"error": {
"code": "invalid_api_key",
"message": "Unknown or revoked API key"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This API key is read-only. Create a key with the write scope to use this endpoint."
}
}{
"error": {
"code": "media_quota_exceeded",
"message": "Daily media upload limit reached (100/day). Retry after the indicated delay."
}
}{
"error": {
"code": "internal_error",
"message": "Failed to fetch posts"
}
}{
"error": {
"code": "media_not_configured",
"message": "Media storage is not configured on this server. Try again later."
}
}Authorizations
A SuperX API key ("sxk_..."), created in the SuperX app under Account > API / MCP / CLI. Keys are server-side secrets.
Body
Response
The registered upload and its presigned PUT URL.
Show child attributes
Show child attributes