curl --request PATCH \
--url https://api.social-api.ai/v1/posts/{pid} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"first_comment": "<string>",
"hidden": false,
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"platform_data": {},
"scheduled_at": "2026-04-02T14:00:00Z",
"segments": [
{
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"text": "And here's the second post in the thread."
}
],
"skip_validation": false,
"targets": [
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"board_id": "8828",
"first_comment": "<string>",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"page_id": "sapi_page_01JRQX...",
"platform_data": {},
"scheduled_at": "2026-04-01T10:00:00Z",
"text": "Platform-specific version of the post",
"title": "Custom title for LinkedIn",
"visibility": "public"
}
],
"text": "Updated post content",
"title": "Updated Title",
"visibility": "public"
}
EOFimport requests
url = "https://api.social-api.ai/v1/posts/{pid}"
payload = {
"first_comment": "<string>",
"hidden": False,
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": ["<string>"],
"platform_data": {},
"scheduled_at": "2026-04-02T14:00:00Z",
"segments": [
{
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": ["<string>"],
"text": "And here's the second post in the thread."
}
],
"skip_validation": False,
"targets": [
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"board_id": "8828",
"first_comment": "<string>",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": ["<string>"],
"page_id": "sapi_page_01JRQX...",
"platform_data": {},
"scheduled_at": "2026-04-01T10:00:00Z",
"text": "Platform-specific version of the post",
"title": "Custom title for LinkedIn",
"visibility": "public"
}
],
"text": "Updated post content",
"title": "Updated Title",
"visibility": "public"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_comment: '<string>',
hidden: false,
media: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
type: 'image'
}
],
media_ids: ['<string>'],
platform_data: {},
scheduled_at: '2026-04-02T14:00:00Z',
segments: [
{
media: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
type: 'image'
}
],
media_ids: ['<string>'],
text: 'And here\'s the second post in the thread.'
}
],
skip_validation: false,
targets: [
{
account_id: 'acc_01HZ9X3Q4R5M6N7P8V2K0W1J',
board_id: '8828',
first_comment: '<string>',
media: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
type: 'image'
}
],
media_ids: ['<string>'],
page_id: 'sapi_page_01JRQX...',
platform_data: {},
scheduled_at: '2026-04-01T10:00:00Z',
text: 'Platform-specific version of the post',
title: 'Custom title for LinkedIn',
visibility: 'public'
}
],
text: 'Updated post content',
title: 'Updated Title',
visibility: 'public'
})
};
fetch('https://api.social-api.ai/v1/posts/{pid}', 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.social-api.ai/v1/posts/{pid}",
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([
'first_comment' => '<string>',
'hidden' => false,
'media' => [
[
'source' => '550e8400-e29b-41d4-a716-446655440000',
'source_type' => 'media_id',
'type' => 'image'
]
],
'media_ids' => [
'<string>'
],
'platform_data' => [
],
'scheduled_at' => '2026-04-02T14:00:00Z',
'segments' => [
[
'media' => [
[
'source' => '550e8400-e29b-41d4-a716-446655440000',
'source_type' => 'media_id',
'type' => 'image'
]
],
'media_ids' => [
'<string>'
],
'text' => 'And here\'s the second post in the thread.'
]
],
'skip_validation' => false,
'targets' => [
[
'account_id' => 'acc_01HZ9X3Q4R5M6N7P8V2K0W1J',
'board_id' => '8828',
'first_comment' => '<string>',
'media' => [
[
'source' => '550e8400-e29b-41d4-a716-446655440000',
'source_type' => 'media_id',
'type' => 'image'
]
],
'media_ids' => [
'<string>'
],
'page_id' => 'sapi_page_01JRQX...',
'platform_data' => [
],
'scheduled_at' => '2026-04-01T10:00:00Z',
'text' => 'Platform-specific version of the post',
'title' => 'Custom title for LinkedIn',
'visibility' => 'public'
]
],
'text' => 'Updated post content',
'title' => 'Updated Title',
'visibility' => 'public'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.social-api.ai/v1/posts/{pid}"
payload := strings.NewReader("{\n \"first_comment\": \"<string>\",\n \"hidden\": false,\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-02T14:00:00Z\",\n \"segments\": [\n {\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"text\": \"And here's the second post in the thread.\"\n }\n ],\n \"skip_validation\": false,\n \"targets\": [\n {\n \"account_id\": \"acc_01HZ9X3Q4R5M6N7P8V2K0W1J\",\n \"board_id\": \"8828\",\n \"first_comment\": \"<string>\",\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"page_id\": \"sapi_page_01JRQX...\",\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-01T10:00:00Z\",\n \"text\": \"Platform-specific version of the post\",\n \"title\": \"Custom title for LinkedIn\",\n \"visibility\": \"public\"\n }\n ],\n \"text\": \"Updated post content\",\n \"title\": \"Updated Title\",\n \"visibility\": \"public\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://api.social-api.ai/v1/posts/{pid}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_comment\": \"<string>\",\n \"hidden\": false,\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-02T14:00:00Z\",\n \"segments\": [\n {\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"text\": \"And here's the second post in the thread.\"\n }\n ],\n \"skip_validation\": false,\n \"targets\": [\n {\n \"account_id\": \"acc_01HZ9X3Q4R5M6N7P8V2K0W1J\",\n \"board_id\": \"8828\",\n \"first_comment\": \"<string>\",\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"page_id\": \"sapi_page_01JRQX...\",\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-01T10:00:00Z\",\n \"text\": \"Platform-specific version of the post\",\n \"title\": \"Custom title for LinkedIn\",\n \"visibility\": \"public\"\n }\n ],\n \"text\": \"Updated post content\",\n \"title\": \"Updated Title\",\n \"visibility\": \"public\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.social-api.ai/v1/posts/{pid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_comment\": \"<string>\",\n \"hidden\": false,\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-02T14:00:00Z\",\n \"segments\": [\n {\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"text\": \"And here's the second post in the thread.\"\n }\n ],\n \"skip_validation\": false,\n \"targets\": [\n {\n \"account_id\": \"acc_01HZ9X3Q4R5M6N7P8V2K0W1J\",\n \"board_id\": \"8828\",\n \"first_comment\": \"<string>\",\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"page_id\": \"sapi_page_01JRQX...\",\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-01T10:00:00Z\",\n \"text\": \"Platform-specific version of the post\",\n \"title\": \"Custom title for LinkedIn\",\n \"visibility\": \"public\"\n }\n ],\n \"text\": \"Updated post content\",\n \"title\": \"Updated Title\",\n \"visibility\": \"public\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-03-14T09:00:00Z",
"hidden": false,
"id": "p_01HZ9X3Q4R5M6N7P8V2K0W1J",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"published_at": "2026-04-01T10:00:05Z",
"retry_count": 0,
"scheduled_at": "2026-04-01T10:00:00Z",
"status": "published",
"targets": [
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"board_id": "8828",
"error": {
"category": "validation",
"caused_by": "user",
"code": "platform.tiktok.media_required",
"message": "Video posts require at least one media URL"
},
"first_comment": "<string>",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"media_type": "reel",
"metadata": {},
"metrics": {
"comments": 23,
"extra": {},
"likes": 142,
"saves": 31,
"shares": 8
},
"metrics_synced_at": "2026-04-01T12:00:00Z",
"page_id": "sapi_page_01HZ9X3Q4R5M6N7P8V2K0W1J",
"permalink": "https://www.instagram.com/p/ABC123/",
"platform": "instagram",
"platform_post_id": "17895695668004550",
"published_at": "2026-04-01T10:00:05Z",
"scheduled_at": "2026-04-01T10:00:00Z",
"status": "published",
"text": "<string>",
"title": "<string>",
"visibility": "public"
}
],
"text": "Check out our new product launch!",
"title": "Exciting News",
"updated_at": "2026-03-14T09:00:00Z",
"visibility": "public"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Update a post
Updates the text, media, schedule time, targets, or hidden status of a pending post.
Only posts in draft, scheduled, or failed status can be updated.
curl --request PATCH \
--url https://api.social-api.ai/v1/posts/{pid} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"first_comment": "<string>",
"hidden": false,
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"platform_data": {},
"scheduled_at": "2026-04-02T14:00:00Z",
"segments": [
{
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"text": "And here's the second post in the thread."
}
],
"skip_validation": false,
"targets": [
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"board_id": "8828",
"first_comment": "<string>",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"page_id": "sapi_page_01JRQX...",
"platform_data": {},
"scheduled_at": "2026-04-01T10:00:00Z",
"text": "Platform-specific version of the post",
"title": "Custom title for LinkedIn",
"visibility": "public"
}
],
"text": "Updated post content",
"title": "Updated Title",
"visibility": "public"
}
EOFimport requests
url = "https://api.social-api.ai/v1/posts/{pid}"
payload = {
"first_comment": "<string>",
"hidden": False,
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": ["<string>"],
"platform_data": {},
"scheduled_at": "2026-04-02T14:00:00Z",
"segments": [
{
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": ["<string>"],
"text": "And here's the second post in the thread."
}
],
"skip_validation": False,
"targets": [
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"board_id": "8828",
"first_comment": "<string>",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": ["<string>"],
"page_id": "sapi_page_01JRQX...",
"platform_data": {},
"scheduled_at": "2026-04-01T10:00:00Z",
"text": "Platform-specific version of the post",
"title": "Custom title for LinkedIn",
"visibility": "public"
}
],
"text": "Updated post content",
"title": "Updated Title",
"visibility": "public"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_comment: '<string>',
hidden: false,
media: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
type: 'image'
}
],
media_ids: ['<string>'],
platform_data: {},
scheduled_at: '2026-04-02T14:00:00Z',
segments: [
{
media: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
type: 'image'
}
],
media_ids: ['<string>'],
text: 'And here\'s the second post in the thread.'
}
],
skip_validation: false,
targets: [
{
account_id: 'acc_01HZ9X3Q4R5M6N7P8V2K0W1J',
board_id: '8828',
first_comment: '<string>',
media: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
type: 'image'
}
],
media_ids: ['<string>'],
page_id: 'sapi_page_01JRQX...',
platform_data: {},
scheduled_at: '2026-04-01T10:00:00Z',
text: 'Platform-specific version of the post',
title: 'Custom title for LinkedIn',
visibility: 'public'
}
],
text: 'Updated post content',
title: 'Updated Title',
visibility: 'public'
})
};
fetch('https://api.social-api.ai/v1/posts/{pid}', 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.social-api.ai/v1/posts/{pid}",
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([
'first_comment' => '<string>',
'hidden' => false,
'media' => [
[
'source' => '550e8400-e29b-41d4-a716-446655440000',
'source_type' => 'media_id',
'type' => 'image'
]
],
'media_ids' => [
'<string>'
],
'platform_data' => [
],
'scheduled_at' => '2026-04-02T14:00:00Z',
'segments' => [
[
'media' => [
[
'source' => '550e8400-e29b-41d4-a716-446655440000',
'source_type' => 'media_id',
'type' => 'image'
]
],
'media_ids' => [
'<string>'
],
'text' => 'And here\'s the second post in the thread.'
]
],
'skip_validation' => false,
'targets' => [
[
'account_id' => 'acc_01HZ9X3Q4R5M6N7P8V2K0W1J',
'board_id' => '8828',
'first_comment' => '<string>',
'media' => [
[
'source' => '550e8400-e29b-41d4-a716-446655440000',
'source_type' => 'media_id',
'type' => 'image'
]
],
'media_ids' => [
'<string>'
],
'page_id' => 'sapi_page_01JRQX...',
'platform_data' => [
],
'scheduled_at' => '2026-04-01T10:00:00Z',
'text' => 'Platform-specific version of the post',
'title' => 'Custom title for LinkedIn',
'visibility' => 'public'
]
],
'text' => 'Updated post content',
'title' => 'Updated Title',
'visibility' => 'public'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.social-api.ai/v1/posts/{pid}"
payload := strings.NewReader("{\n \"first_comment\": \"<string>\",\n \"hidden\": false,\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-02T14:00:00Z\",\n \"segments\": [\n {\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"text\": \"And here's the second post in the thread.\"\n }\n ],\n \"skip_validation\": false,\n \"targets\": [\n {\n \"account_id\": \"acc_01HZ9X3Q4R5M6N7P8V2K0W1J\",\n \"board_id\": \"8828\",\n \"first_comment\": \"<string>\",\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"page_id\": \"sapi_page_01JRQX...\",\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-01T10:00:00Z\",\n \"text\": \"Platform-specific version of the post\",\n \"title\": \"Custom title for LinkedIn\",\n \"visibility\": \"public\"\n }\n ],\n \"text\": \"Updated post content\",\n \"title\": \"Updated Title\",\n \"visibility\": \"public\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://api.social-api.ai/v1/posts/{pid}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_comment\": \"<string>\",\n \"hidden\": false,\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-02T14:00:00Z\",\n \"segments\": [\n {\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"text\": \"And here's the second post in the thread.\"\n }\n ],\n \"skip_validation\": false,\n \"targets\": [\n {\n \"account_id\": \"acc_01HZ9X3Q4R5M6N7P8V2K0W1J\",\n \"board_id\": \"8828\",\n \"first_comment\": \"<string>\",\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"page_id\": \"sapi_page_01JRQX...\",\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-01T10:00:00Z\",\n \"text\": \"Platform-specific version of the post\",\n \"title\": \"Custom title for LinkedIn\",\n \"visibility\": \"public\"\n }\n ],\n \"text\": \"Updated post content\",\n \"title\": \"Updated Title\",\n \"visibility\": \"public\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.social-api.ai/v1/posts/{pid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_comment\": \"<string>\",\n \"hidden\": false,\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-02T14:00:00Z\",\n \"segments\": [\n {\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"text\": \"And here's the second post in the thread.\"\n }\n ],\n \"skip_validation\": false,\n \"targets\": [\n {\n \"account_id\": \"acc_01HZ9X3Q4R5M6N7P8V2K0W1J\",\n \"board_id\": \"8828\",\n \"first_comment\": \"<string>\",\n \"media\": [\n {\n \"source\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source_type\": \"media_id\",\n \"type\": \"image\"\n }\n ],\n \"media_ids\": [\n \"<string>\"\n ],\n \"page_id\": \"sapi_page_01JRQX...\",\n \"platform_data\": {},\n \"scheduled_at\": \"2026-04-01T10:00:00Z\",\n \"text\": \"Platform-specific version of the post\",\n \"title\": \"Custom title for LinkedIn\",\n \"visibility\": \"public\"\n }\n ],\n \"text\": \"Updated post content\",\n \"title\": \"Updated Title\",\n \"visibility\": \"public\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-03-14T09:00:00Z",
"hidden": false,
"id": "p_01HZ9X3Q4R5M6N7P8V2K0W1J",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"published_at": "2026-04-01T10:00:05Z",
"retry_count": 0,
"scheduled_at": "2026-04-01T10:00:00Z",
"status": "published",
"targets": [
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"board_id": "8828",
"error": {
"category": "validation",
"caused_by": "user",
"code": "platform.tiktok.media_required",
"message": "Video posts require at least one media URL"
},
"first_comment": "<string>",
"media": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"type": "image"
}
],
"media_ids": [
"<string>"
],
"media_type": "reel",
"metadata": {},
"metrics": {
"comments": 23,
"extra": {},
"likes": 142,
"saves": 31,
"shares": 8
},
"metrics_synced_at": "2026-04-01T12:00:00Z",
"page_id": "sapi_page_01HZ9X3Q4R5M6N7P8V2K0W1J",
"permalink": "https://www.instagram.com/p/ABC123/",
"platform": "instagram",
"platform_post_id": "17895695668004550",
"published_at": "2026-04-01T10:00:05Z",
"scheduled_at": "2026-04-01T10:00:00Z",
"status": "published",
"text": "<string>",
"title": "<string>",
"visibility": "public"
}
],
"text": "Check out our new product launch!",
"title": "Exciting News",
"updated_at": "2026-03-14T09:00:00Z",
"visibility": "public"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Authorizations
Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...
Path Parameters
Post ID
Body
Updated content
FirstComment replaces the auto-first-comment.
Hidden archives the post from default list views when true.
false
Media is the ordered, agnostic media list. Each item is a url, a media_id, or a platform_attachment_id; order and mixing are preserved. Supersedes media_ids.
Show child attributes
Show child attributes
MediaIDs replaces the attached media files.
Deprecated: use Media with source_type "media_id". Ignored when media is set.
PlatformData passes platform-specific fields keyed by platform name (e.g. {"instagram": {"content_type": "feed"}}). Folded into each matching target; a target's own platform_data wins on conflicts.
Show child attributes
Show child attributes
ScheduledAt changes the scheduled publication time (RFC3339).
"2026-04-02T14:00:00Z"
Segments are continuation posts that publish as a native thread on X. Threads chaining is temporarily unavailable.
Show child attributes
Show child attributes
SkipValidation bypasses pre-publish validation. The post is scheduled/published as-is and may fail at the platform.
false
Targets replaces or updates per-platform target configuration.
Show child attributes
Show child attributes
Text replaces the post body. Only for draft/scheduled/failed posts.
"Updated post content"
Title replaces the post title.
"Updated Title"
Visibility changes who can see the post.
public, private, connections_only, logged_in "public"
Response
Post updated
"2026-03-14T09:00:00Z"
false
"p_01HZ9X3Q4R5M6N7P8V2K0W1J"
Show child attributes
Show child attributes
Deprecated: use media.
"2026-04-01T10:00:05Z"
0
"2026-04-01T10:00:00Z"
draft, scheduled, publishing, published, partial, failed, cancelled "published"
Show child attributes
Show child attributes
"Check out our new product launch!"
"Exciting News"
"2026-03-14T09:00:00Z"
public, private, connections_only, logged_in "public"