curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl", "scheduleDate": "2023-07-08T12:30:00Z", scheduledPause: true}' \
-X PATCH https://api.ayrshare.com/api/post
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl", // required
scheduleDate: "2023-07-08T12:30:00Z",
scheduledPause: true
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl',
'scheduleDate': '2023-07-08T12:30:00Z'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.patch('https://api.ayrshare.com/api/post',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'id' => 's8k2jsk0pl', // Replace with your actual post ID
'scheduleDate' => '2023-07-08T12:30:00Z'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace PostUpdatePOSTRequest_csharp
{
class PostUpdate
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post";
using (var httpClient = new HttpClient())
{
try
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
string json = "{\"id\":\"s8k2jsk0pl\"," +
"\"scheduleDate\":\"2023-07-08T12:30:00Z\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PatchAsync(url, content);
var responseBody = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(responseBody);
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
if (ex.InnerException != null)
{
Console.WriteLine("Error details: " + ex.InnerException.Message);
}
}
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl",
"scheduleDate": "2023-07-08T12:30:00Z"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PATCH", "https://api.ayrshare.com/api/post",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
{
"status": "success",
"id": "ZSU1tnnuykDy25wA6kvX", // Ayrshare Post ID
"scheduleDate": "2025-07-08T12:30:00Z",
"scheduledPaused": true
}
{
"action": "update",
"status": "error",
"code": 305,
"message": "Error updating post. Post ID not found."
}on
{
"action": "post",
"status": "error",
"code": 104,
"message": "Invalid schedule date format for scheduleDate. .../ayrshare.com/rest-api/endpoints/post#send-a-post"
}
Post
Update a Post
スケジュール済み投稿のメタデータを更新します
PATCH
/
post
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl", "scheduleDate": "2023-07-08T12:30:00Z", scheduledPause: true}' \
-X PATCH https://api.ayrshare.com/api/post
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl", // required
scheduleDate: "2023-07-08T12:30:00Z",
scheduledPause: true
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl',
'scheduleDate': '2023-07-08T12:30:00Z'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.patch('https://api.ayrshare.com/api/post',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'id' => 's8k2jsk0pl', // Replace with your actual post ID
'scheduleDate' => '2023-07-08T12:30:00Z'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace PostUpdatePOSTRequest_csharp
{
class PostUpdate
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post";
using (var httpClient = new HttpClient())
{
try
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
string json = "{\"id\":\"s8k2jsk0pl\"," +
"\"scheduleDate\":\"2023-07-08T12:30:00Z\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PatchAsync(url, content);
var responseBody = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(responseBody);
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
if (ex.InnerException != null)
{
Console.WriteLine("Error details: " + ex.InnerException.Message);
}
}
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl",
"scheduleDate": "2023-07-08T12:30:00Z"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PATCH", "https://api.ayrshare.com/api/post",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
{
"status": "success",
"id": "ZSU1tnnuykDy25wA6kvX", // Ayrshare Post ID
"scheduleDate": "2025-07-08T12:30:00Z",
"scheduledPaused": true
}
{
"action": "update",
"status": "error",
"code": 305,
"message": "Error updating post. Post ID not found."
}on
{
"action": "post",
"status": "error",
"code": 104,
"message": "Invalid schedule date format for scheduleDate. .../ayrshare.com/rest-api/endpoints/post#send-a-post"
}
投稿の
scheduleDate、投稿の approval ステータス、notes、または公開済み YouTube 動画の visibility を更新します。
- 投稿は元々
scheduleDateを持ち、statusが “pending” である必要があります。statusは /history または GET /post エンドポイントで確認できます。 - 可視性を変更するには、YouTube 動画が正常に投稿されている必要があります。
- 承認ワークフロー では、投稿の現在のステータスが “awaiting approval” である必要があります。
ヘッダーパラメータ
ボディパラメータ
元の投稿が承認を必要とし、ステータスが “awaiting approval” の場合、投稿を承認して公開するには
true に設定します。投稿のコメントを有効化または無効化します。
true に設定するとコメントが無効化されます。false に設定するとコメントが有効化されます。サポートされているプラットフォーム: Instagram、LinkedIn。- 有効化または無効化は、スケジュール済み投稿または公開済み投稿のいずれでも実行できます。
- 公開済み投稿でコメントを無効化しても、既存のコメントは削除されません。
- LinkedIn のコメントを無効化すると、スレッド上の既存コメントがすべて削除されます。
- Instagram のコメントは削除されません。
- TikTok のコメントは公開後に変更できません。
将来の投稿をスケジュールする
datetime。UTC 日時を受け付けます。例えば YYYY-MM-DDThh:mm:ssZ 形式を使用し、2026-07-08T12:30:00Z のように送信します。
追加の例は utctime をご覧ください。日時が過去の場合、投稿は即座に送信されます。
スケジュール済み投稿を一時停止/再開します。投稿を再開した際に
scheduleDate が過去の場合、
投稿は即座に公開されます。再開前に scheduleDate の更新を検討してください。visibility フィールドと値 unlisted、private、または public を使用して YouTube 動画の可視性を更新します。description、title、または categoryId を更新します。元々 description または categoryId が設定されていない場合、既定値はそれぞれ "" と 24(Entertainment)です。curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl", "scheduleDate": "2023-07-08T12:30:00Z", scheduledPause: true}' \
-X PATCH https://api.ayrshare.com/api/post
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl", // required
scheduleDate: "2023-07-08T12:30:00Z",
scheduledPause: true
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl',
'scheduleDate': '2023-07-08T12:30:00Z'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.patch('https://api.ayrshare.com/api/post',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'id' => 's8k2jsk0pl', // Replace with your actual post ID
'scheduleDate' => '2023-07-08T12:30:00Z'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace PostUpdatePOSTRequest_csharp
{
class PostUpdate
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post";
using (var httpClient = new HttpClient())
{
try
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
string json = "{\"id\":\"s8k2jsk0pl\"," +
"\"scheduleDate\":\"2023-07-08T12:30:00Z\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PatchAsync(url, content);
var responseBody = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(responseBody);
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
if (ex.InnerException != null)
{
Console.WriteLine("Error details: " + ex.InnerException.Message);
}
}
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl",
"scheduleDate": "2023-07-08T12:30:00Z"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PATCH", "https://api.ayrshare.com/api/post",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
{
"status": "success",
"id": "ZSU1tnnuykDy25wA6kvX", // Ayrshare Post ID
"scheduleDate": "2025-07-08T12:30:00Z",
"scheduledPaused": true
}
{
"action": "update",
"status": "error",
"code": 305,
"message": "Error updating post. Post ID not found."
}on
{
"action": "post",
"status": "error",
"code": 104,
"message": "Invalid schedule date format for scheduleDate. .../ayrshare.com/rest-api/endpoints/post#send-a-post"
}
⌘I
