Generate presigned upload URLs for media files
curl --request POST \
--url https://api.so-me.studio/v1/posts/presign-media \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
]
}
'import requests
url = "https://api.so-me.studio/v1/posts/presign-media"
payload = { "files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{filename: '<string>', mimetype: '<string>', size: 123, duration: 43200.05}]
})
};
fetch('https://api.so-me.studio/v1/posts/presign-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.so-me.studio/v1/posts/presign-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([
'files' => [
[
'filename' => '<string>',
'mimetype' => '<string>',
'size' => 123,
'duration' => 43200.05
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.so-me.studio/v1/posts/presign-media"
payload := strings.NewReader("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.so-me.studio/v1/posts/presign-media")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.so-me.studio/v1/posts/presign-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"fileId": "<string>",
"uploadUrl": "<string>",
"s3Prefix": "<string>",
"fileSrc": "<string>"
}
]Posts
Generate presigned upload URLs for media files
Returns presigned S3 URLs for each file. Upload your files directly to S3 using PUT requests, then pass the returned s3Prefix and fileSrc values in the create post request.
POST
/
v1
/
posts
/
presign-media
Generate presigned upload URLs for media files
curl --request POST \
--url https://api.so-me.studio/v1/posts/presign-media \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
]
}
'import requests
url = "https://api.so-me.studio/v1/posts/presign-media"
payload = { "files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{filename: '<string>', mimetype: '<string>', size: 123, duration: 43200.05}]
})
};
fetch('https://api.so-me.studio/v1/posts/presign-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.so-me.studio/v1/posts/presign-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([
'files' => [
[
'filename' => '<string>',
'mimetype' => '<string>',
'size' => 123,
'duration' => 43200.05
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.so-me.studio/v1/posts/presign-media"
payload := strings.NewReader("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.so-me.studio/v1/posts/presign-media")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.so-me.studio/v1/posts/presign-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"fileId": "<string>",
"uploadUrl": "<string>",
"s3Prefix": "<string>",
"fileSrc": "<string>"
}
]Authorizations
Body
application/json
Type of post the media is for
Available options:
TEXT, IMAGE, MULTIPLE_IMAGES, VIDEO, CAROUSEL, REEL, STORY Target social media platform
Available options:
TWITTER, INSTAGRAM, LINKEDIN, LINKEDIN_PAGE, FACEBOOK, TIKTOK, YOUTUBE, THREADS, WHATSAPP Files to generate upload URLs for
Show child attributes
Show child attributes