Crm · Social posts
List social posts
Lists an organization’s social posts, scheduled posts or publication history. You can filter by status, account and media, choose the sort direction, and paginate the results. It returns a matching count and posts with account results, a thumbnail and aggregated likes, comments and views.
Permissions
Send an API key of the organization in the path, using the X-API-Key header.
Who may call it
- The caller must have organization access and the
social.readpermission.
Request
Path parameters
-
organizationIdidrequired
Query parameters
-
viewstringdefault
"all"allscheduledhistory -
statusstringscheduledpendingpublishingprocessingpublishedpartiallyPublishedfailedunconfirmed -
accountIdid -
mediastringimagevideonone -
sortBystringdefault
"desc"ascdesc -
offsetintegerat least 0 · default
0 -
limitinteger1–100 · default
30
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
--request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/crm/communication/socialPosts' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/crm/communication/socialPosts", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
},
redirect: 'error',
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`campai HTTP ${response.status}`);
const text = await response.text();
const result = text ? JSON.parse(text) : null;
console.log(JSON.stringify(result, null, 2));<?php
$context = stream_context_create(['http' => [
'method' => 'GET',
'header' => [
'X-API-Key: YOUR_API_KEY',
],
'timeout' => 30,
'follow_location' => 0,
'ignore_errors' => true,
]]);
$text = @file_get_contents('https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/crm/communication/socialPosts', false, $context);
preg_match('/^HTTP\/\S+ (\d{3})/', $http_response_header[0] ?? '', $match);
$status = (int) ($match[1] ?? 0);
if ($text === false || $status < 200 || $status >= 300) {
throw new RuntimeException("campai HTTP $status (0 means no response)");
}
$result = $text === '' ? null : json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
Response
200 Successful response
Content-Type: application/json
-
countintegerat least 0
-
postsobject[]9 properties
-
statusstringscheduledpendingpublishingprocessingpublishedpartiallyPublishedfailedunconfirmed -
scheduledAtstring · date-timenullable -
publicationDatestring · date-time -
postIdid -
textstring -
mediaCountintegerat least 0
-
deliveriesobject[]9 properties
-
statusstringpendingpublishingprocessingpublishedfailedunconfirmed -
urlstringnullable -
errorDetailsobjectnullable6 properties
-
categorystringauthenticationpermissionvalidationrateLimittemporaryunknown -
actionstringreconnectreviewPermissionseditPostretryLatercheckPlatformcontactSupport -
codestringnullable -
reasonstringnullable26 values
apiQuotayoutubeUploadLimitvideoDurationmediaFormatinvalidMediavideoFrameRatemediaDimensionsmediaDownloaduploadAbortedmediaDomainprivacySettingpostingLimitaccountRestrictedduplicateVideocontentRightscontentPolicyverifyEmailmediaTypeemptyPostunconfirmedplatformRejectedwordpressNotPublishedcontainerFailedyoutubeFailedfacebookFailedtiktokFailed -
stagestringpreflightuploadpublishpoll -
occurredAtstring · date-time
-
-
publishedAtstring · date-timenullable -
accountIdid -
canRetryboolean -
canCheckboolean -
canRepublishboolean -
canDismissboolean
-
-
thumbnailobjectnullableposts[].thumbnailis null when the post preview has no media.2 properties
-
urlstring -
kindstringimagevideo
-
-
statisticsobject3 properties
-
likesintegernullableposts[].statistics.likesis null while no listed account has reported the figure. -
commentsintegernullableposts[].statistics.commentsis null while no listed account has reported the figure. -
viewsintegernullableposts[].statistics.viewsis null while no listed account has reported the figure.
-
-
{
"count": 0,
"posts": [
{
"status": "scheduled",
"scheduledAt": "2026-06-15T22:30:00Z",
"publicationDate": "2026-06-15T22:30:00Z",
"postId": "000000000000000000000001",
"text": "string",
"mediaCount": 0,
"deliveries": [
{
"status": "pending",
"url": "string",
"errorDetails": {
"category": "authentication",
"action": "reconnect",
"code": "string",
"reason": "apiQuota",
"stage": "preflight",
"occurredAt": "2026-06-15T22:30:00Z"
},
"publishedAt": "2026-06-15T22:30:00Z",
"accountId": "000000000000000000000001",
"canRetry": true,
"canCheck": true,
"canRepublish": true,
"canDismiss": true
}
],
"thumbnail": {
"url": "string",
"kind": "image"
},
"statistics": {
"likes": 1,
"comments": 1,
"views": 1
}
}
]
}
Errors
No errors of its own are known for this endpoint.
Errors nearly every request can meet are listed under Errors.