Endpoints
Edit Scheduled Post
Change a scheduled post before any platform starts publishing it.
PATCH
/
api
/
v1
/
posts
/
{id}
Edit a scheduled post before publishing starts
curl --request PATCH \
--url https://mallary.ai/api/v1/posts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision": 2,
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>"
}
],
"comments_under_post": [
"<string>"
],
"scheduled_at": "<string>",
"scheduled_timezone": "<string>",
"auto_reply_enabled": true,
"platform_options": {}
}
'import requests
url = "https://mallary.ai/api/v1/posts/{id}"
payload = {
"expected_revision": 2,
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>"
}
],
"comments_under_post": ["<string>"],
"scheduled_at": "<string>",
"scheduled_timezone": "<string>",
"auto_reply_enabled": True,
"platform_options": {}
}
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({
expected_revision: 2,
message: '<string>',
media: [
{
url: '<string>',
type: '<string>',
thumbnail_url: '<string>',
alt_text: '<string>'
}
],
comments_under_post: ['<string>'],
scheduled_at: '<string>',
scheduled_timezone: '<string>',
auto_reply_enabled: true,
platform_options: {}
})
};
fetch('https://mallary.ai/api/v1/posts/{id}', 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://mallary.ai/api/v1/posts/{id}",
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([
'expected_revision' => 2,
'message' => '<string>',
'media' => [
[
'url' => '<string>',
'type' => '<string>',
'thumbnail_url' => '<string>',
'alt_text' => '<string>'
]
],
'comments_under_post' => [
'<string>'
],
'scheduled_at' => '<string>',
'scheduled_timezone' => '<string>',
'auto_reply_enabled' => true,
'platform_options' => [
]
]),
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://mallary.ai/api/v1/posts/{id}"
payload := strings.NewReader("{\n \"expected_revision\": 2,\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"thumbnail_url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ],\n \"comments_under_post\": [\n \"<string>\"\n ],\n \"scheduled_at\": \"<string>\",\n \"scheduled_timezone\": \"<string>\",\n \"auto_reply_enabled\": true,\n \"platform_options\": {}\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://mallary.ai/api/v1/posts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": 2,\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"thumbnail_url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ],\n \"comments_under_post\": [\n \"<string>\"\n ],\n \"scheduled_at\": \"<string>\",\n \"scheduled_timezone\": \"<string>\",\n \"auto_reply_enabled\": true,\n \"platform_options\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mallary.ai/api/v1/posts/{id}")
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 \"expected_revision\": 2,\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"thumbnail_url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ],\n \"comments_under_post\": [\n \"<string>\"\n ],\n \"scheduled_at\": \"<string>\",\n \"scheduled_timezone\": \"<string>\",\n \"auto_reply_enabled\": true,\n \"platform_options\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"id": 123,
"revision": 1,
"editable": true,
"profile_id": "<string>",
"platforms": [
"twitter"
],
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>"
}
],
"scheduled_at": "<string>",
"batch_id": "<string>",
"job_ids": [
123
],
"edit_block_reason": "<string>",
"destinations": [
{
"job_id": 123,
"platform": "twitter",
"profile_id": "<string>",
"account_name": "<string>",
"account_handle": "<string>"
}
],
"comments_under_post": [
{
"content": "<string>"
}
],
"scheduled_timezone": "<string>",
"auto_reply_enabled": true,
"platform_options": {
"facebook": {
"is_ai_generated": true,
"message": "<string>",
"post_type": "feed",
"link": "<string>",
"pageId": "<string>",
"title": "<string>"
},
"instagram": {
"is_ai_generated": true,
"message": "<string>",
"post_type": "feed",
"shareToFeed": true,
"trialParams": {
"graduationStrategy": "MANUAL"
},
"isPaidPartnership": true,
"brandedContentSponsors": [
"<string>"
]
},
"threads": {
"message": "<string>",
"post_type": "text"
},
"twitter": {
"made_with_ai": true,
"message": "<string>"
},
"x": {
"made_with_ai": true,
"message": "<string>"
},
"linkedin": {
"message": "<string>",
"author_urn": "<string>"
},
"tiktok": {
"message": "<string>",
"post_type": "video",
"media_type": "PHOTO",
"post_mode": "DIRECT_POST",
"source": "FILE_UPLOAD",
"title": "<string>",
"description": "<string>",
"privacy_level": "PUBLIC_TO_EVERYONE",
"disable_comment": true,
"disable_duet": true,
"disable_stitch": true,
"video_cover_timestamp_ms": 1,
"auto_add_music": true,
"brand_content_toggle": true,
"brand_organic_toggle": true,
"is_aigc": true,
"photo_cover_index": 0
},
"youtube": {
"message": "<string>",
"post_type": "regular",
"title": "<string>",
"tags": [
"<string>"
],
"visibility": "public",
"categoryId": "22",
"madeForKids": false,
"containsSyntheticMedia": true,
"playlist_id": "<string>"
},
"pinterest": {
"message": "<string>",
"post_type": "image",
"title": "<string>",
"boardId": "<string>",
"link": "<string>",
"alt_text": "<string>"
},
"reddit": {
"message": "<string>",
"post_type": "text",
"subreddit": "<string>",
"subredditName": "<string>"
},
"bluesky": {
"message": "<string>",
"languages": [
"<string>"
],
"langs": [
"<string>"
]
}
}
}
}First, get the post. Check that
Replace
Use List Connection Profiles to find profile IDs and the platforms connected to each profile. If you send
data.editable is true, and copy data.revision. Then send that number as expected_revision with at least one field to change. Fields you leave out stay the same.
You can change the text, media, first comments, publish time and time zone, auto-reply setting, platform options, and destinations. One edit changes the whole post group. The scheduled time must still be in the future, and no platform in the group may have started publishing.
Change the text
curl -X PATCH 'https://mallary.ai/api/v1/posts/12345' \
-H "Authorization: Bearer $MALLARY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"expected_revision":1,"message":"Updated launch reminder"}'
1 with the revision from the GET response. A successful edit returns the updated post and its new revision.
Change the profile or platforms
Senddestinations with both the target profile’s public profile_id and the complete final platform list. Every platform in the group uses that one profile. A platform left out of the list is removed from the scheduled post.
{
"expected_revision": 1,
"destinations": {
"profile_id": "AbC123xYz90",
"platforms": ["instagram", "linkedin"]
}
}
profile_id in the URL query, it identifies the post’s current profile. Put the new profile in destinations.profile_id.
If you change only the platforms, send the current profile ID in destinations.profile_id. When you move to another profile, Mallary clears saved account choices from the old profile, such as a LinkedIn author or Pinterest board. Send new platform_options if you need those choices.
When sent, media, comments_under_post, and platform_options replace their saved values. Send an empty array to clear media or first comments, or an empty object to clear platform options.
If the API returns 409, get the post again before making another edit. The post may have changed or started publishing.Query Parameters
Body
application/json
Last modified on September 29, 2026
Was this page helpful?
Edit a scheduled post before publishing starts
curl --request PATCH \
--url https://mallary.ai/api/v1/posts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision": 2,
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>"
}
],
"comments_under_post": [
"<string>"
],
"scheduled_at": "<string>",
"scheduled_timezone": "<string>",
"auto_reply_enabled": true,
"platform_options": {}
}
'import requests
url = "https://mallary.ai/api/v1/posts/{id}"
payload = {
"expected_revision": 2,
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>"
}
],
"comments_under_post": ["<string>"],
"scheduled_at": "<string>",
"scheduled_timezone": "<string>",
"auto_reply_enabled": True,
"platform_options": {}
}
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({
expected_revision: 2,
message: '<string>',
media: [
{
url: '<string>',
type: '<string>',
thumbnail_url: '<string>',
alt_text: '<string>'
}
],
comments_under_post: ['<string>'],
scheduled_at: '<string>',
scheduled_timezone: '<string>',
auto_reply_enabled: true,
platform_options: {}
})
};
fetch('https://mallary.ai/api/v1/posts/{id}', 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://mallary.ai/api/v1/posts/{id}",
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([
'expected_revision' => 2,
'message' => '<string>',
'media' => [
[
'url' => '<string>',
'type' => '<string>',
'thumbnail_url' => '<string>',
'alt_text' => '<string>'
]
],
'comments_under_post' => [
'<string>'
],
'scheduled_at' => '<string>',
'scheduled_timezone' => '<string>',
'auto_reply_enabled' => true,
'platform_options' => [
]
]),
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://mallary.ai/api/v1/posts/{id}"
payload := strings.NewReader("{\n \"expected_revision\": 2,\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"thumbnail_url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ],\n \"comments_under_post\": [\n \"<string>\"\n ],\n \"scheduled_at\": \"<string>\",\n \"scheduled_timezone\": \"<string>\",\n \"auto_reply_enabled\": true,\n \"platform_options\": {}\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://mallary.ai/api/v1/posts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": 2,\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"thumbnail_url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ],\n \"comments_under_post\": [\n \"<string>\"\n ],\n \"scheduled_at\": \"<string>\",\n \"scheduled_timezone\": \"<string>\",\n \"auto_reply_enabled\": true,\n \"platform_options\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mallary.ai/api/v1/posts/{id}")
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 \"expected_revision\": 2,\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"thumbnail_url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ],\n \"comments_under_post\": [\n \"<string>\"\n ],\n \"scheduled_at\": \"<string>\",\n \"scheduled_timezone\": \"<string>\",\n \"auto_reply_enabled\": true,\n \"platform_options\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"id": 123,
"revision": 1,
"editable": true,
"profile_id": "<string>",
"platforms": [
"twitter"
],
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>"
}
],
"scheduled_at": "<string>",
"batch_id": "<string>",
"job_ids": [
123
],
"edit_block_reason": "<string>",
"destinations": [
{
"job_id": 123,
"platform": "twitter",
"profile_id": "<string>",
"account_name": "<string>",
"account_handle": "<string>"
}
],
"comments_under_post": [
{
"content": "<string>"
}
],
"scheduled_timezone": "<string>",
"auto_reply_enabled": true,
"platform_options": {
"facebook": {
"is_ai_generated": true,
"message": "<string>",
"post_type": "feed",
"link": "<string>",
"pageId": "<string>",
"title": "<string>"
},
"instagram": {
"is_ai_generated": true,
"message": "<string>",
"post_type": "feed",
"shareToFeed": true,
"trialParams": {
"graduationStrategy": "MANUAL"
},
"isPaidPartnership": true,
"brandedContentSponsors": [
"<string>"
]
},
"threads": {
"message": "<string>",
"post_type": "text"
},
"twitter": {
"made_with_ai": true,
"message": "<string>"
},
"x": {
"made_with_ai": true,
"message": "<string>"
},
"linkedin": {
"message": "<string>",
"author_urn": "<string>"
},
"tiktok": {
"message": "<string>",
"post_type": "video",
"media_type": "PHOTO",
"post_mode": "DIRECT_POST",
"source": "FILE_UPLOAD",
"title": "<string>",
"description": "<string>",
"privacy_level": "PUBLIC_TO_EVERYONE",
"disable_comment": true,
"disable_duet": true,
"disable_stitch": true,
"video_cover_timestamp_ms": 1,
"auto_add_music": true,
"brand_content_toggle": true,
"brand_organic_toggle": true,
"is_aigc": true,
"photo_cover_index": 0
},
"youtube": {
"message": "<string>",
"post_type": "regular",
"title": "<string>",
"tags": [
"<string>"
],
"visibility": "public",
"categoryId": "22",
"madeForKids": false,
"containsSyntheticMedia": true,
"playlist_id": "<string>"
},
"pinterest": {
"message": "<string>",
"post_type": "image",
"title": "<string>",
"boardId": "<string>",
"link": "<string>",
"alt_text": "<string>"
},
"reddit": {
"message": "<string>",
"post_type": "text",
"subreddit": "<string>",
"subredditName": "<string>"
},
"bluesky": {
"message": "<string>",
"languages": [
"<string>"
],
"langs": [
"<string>"
]
}
}
}
}
