curl --request PATCH \
--url https://app.ocoya.com/api/_public/v1/post/{postId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"caption": "Launching our summer campaign today.",
"scheduledAt": "2024-01-01T00:00:00Z",
"publishNow": true,
"mediaUrls": [
"https://example.com/image.jpg"
],
"addMediaUrls": [
"https://example.com/image.jpg"
],
"clearMedia": false,
"socialProfileIds": [
"clh49poxf008x8kov4ncbjty9"
],
"addSocialProfileIds": [
"clh49poxf008x8kov4ncbjty9"
]
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
caption: 'Launching our summer campaign today.',
scheduledAt: '2024-01-01T00:00:00Z',
publishNow: true,
mediaUrls: ['https://example.com/image.jpg'],
addMediaUrls: ['https://example.com/image.jpg'],
clearMedia: false,
socialProfileIds: ['clh49poxf008x8kov4ncbjty9'],
addSocialProfileIds: ['clh49poxf008x8kov4ncbjty9']
})
};
fetch('https://app.ocoya.com/api/_public/v1/post/{postId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.ocoya.com/api/_public/v1/post/{postId}"
payload = {
"caption": "Launching our summer campaign today.",
"scheduledAt": "2024-01-01T00:00:00Z",
"publishNow": True,
"mediaUrls": ["https://example.com/image.jpg"],
"addMediaUrls": ["https://example.com/image.jpg"],
"clearMedia": False,
"socialProfileIds": ["clh49poxf008x8kov4ncbjty9"],
"addSocialProfileIds": ["clh49poxf008x8kov4ncbjty9"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.ocoya.com/api/_public/v1/post/{postId}",
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([
'caption' => 'Launching our summer campaign today.',
'scheduledAt' => '2024-01-01T00:00:00Z',
'publishNow' => true,
'mediaUrls' => [
'https://example.com/image.jpg'
],
'addMediaUrls' => [
'https://example.com/image.jpg'
],
'clearMedia' => false,
'socialProfileIds' => [
'clh49poxf008x8kov4ncbjty9'
],
'addSocialProfileIds' => [
'clh49poxf008x8kov4ncbjty9'
]
]),
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;
}require 'uri'
require 'net/http'
url = URI("https://app.ocoya.com/api/_public/v1/post/{postId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"caption\": \"Launching our summer campaign today.\",\n \"scheduledAt\": \"2024-01-01T00:00:00Z\",\n \"publishNow\": true,\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"addMediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"clearMedia\": false,\n \"socialProfileIds\": [\n \"clh49poxf008x8kov4ncbjty9\"\n ],\n \"addSocialProfileIds\": [\n \"clh49poxf008x8kov4ncbjty9\"\n ]\n}"
response = http.request(request)
puts response.read_bodyUpdate post
Returns an id of the updated post
curl --request PATCH \
--url https://app.ocoya.com/api/_public/v1/post/{postId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"caption": "Launching our summer campaign today.",
"scheduledAt": "2024-01-01T00:00:00Z",
"publishNow": true,
"mediaUrls": [
"https://example.com/image.jpg"
],
"addMediaUrls": [
"https://example.com/image.jpg"
],
"clearMedia": false,
"socialProfileIds": [
"clh49poxf008x8kov4ncbjty9"
],
"addSocialProfileIds": [
"clh49poxf008x8kov4ncbjty9"
]
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
caption: 'Launching our summer campaign today.',
scheduledAt: '2024-01-01T00:00:00Z',
publishNow: true,
mediaUrls: ['https://example.com/image.jpg'],
addMediaUrls: ['https://example.com/image.jpg'],
clearMedia: false,
socialProfileIds: ['clh49poxf008x8kov4ncbjty9'],
addSocialProfileIds: ['clh49poxf008x8kov4ncbjty9']
})
};
fetch('https://app.ocoya.com/api/_public/v1/post/{postId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.ocoya.com/api/_public/v1/post/{postId}"
payload = {
"caption": "Launching our summer campaign today.",
"scheduledAt": "2024-01-01T00:00:00Z",
"publishNow": True,
"mediaUrls": ["https://example.com/image.jpg"],
"addMediaUrls": ["https://example.com/image.jpg"],
"clearMedia": False,
"socialProfileIds": ["clh49poxf008x8kov4ncbjty9"],
"addSocialProfileIds": ["clh49poxf008x8kov4ncbjty9"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.ocoya.com/api/_public/v1/post/{postId}",
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([
'caption' => 'Launching our summer campaign today.',
'scheduledAt' => '2024-01-01T00:00:00Z',
'publishNow' => true,
'mediaUrls' => [
'https://example.com/image.jpg'
],
'addMediaUrls' => [
'https://example.com/image.jpg'
],
'clearMedia' => false,
'socialProfileIds' => [
'clh49poxf008x8kov4ncbjty9'
],
'addSocialProfileIds' => [
'clh49poxf008x8kov4ncbjty9'
]
]),
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;
}require 'uri'
require 'net/http'
url = URI("https://app.ocoya.com/api/_public/v1/post/{postId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"caption\": \"Launching our summer campaign today.\",\n \"scheduledAt\": \"2024-01-01T00:00:00Z\",\n \"publishNow\": true,\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"addMediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"clearMedia\": false,\n \"socialProfileIds\": [\n \"clh49poxf008x8kov4ncbjty9\"\n ],\n \"addSocialProfileIds\": [\n \"clh49poxf008x8kov4ncbjty9\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Path Parameters
Ocoya post ID.
"cmajvvb9q0003ja5vh0538j6r"
Body
New caption to apply to existing post variations.
"Launching our summer campaign today."
ISO 8601 datetime when the post should be scheduled, or null to make it unscheduled.
"2024-01-01T00:00:00Z"
Publish the existing post immediately without creating a new post.
true
Full replacement set of publicly reachable image or video URLs. Maximum 10. Use an empty array to remove all media.
["https://example.com/image.jpg"]
Publicly reachable image or video URLs to add without removing existing media. Maximum 10 total.
["https://example.com/image.jpg"]
Remove all media from the post. Ignored when mediaUrls is provided.
false
Full replacement set of connected social profile IDs that should receive the post. Get IDs from GET /social-profiles.
["clh49poxf008x8kov4ncbjty9"]
Connected social profile IDs to add without removing profiles already attached to the post.
["clh49poxf008x8kov4ncbjty9"]
Response
Success