# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/social/posts/sync-external \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"accountId": "acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3"
}'curl --request POST \
--url https://api.aisa.one/apis/v1/social/posts/sync-external \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/posts/sync-external"
payload = { "accountId": "acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3'})
};
fetch('https://api.aisa.one/apis/v1/social/posts/sync-external', 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.aisa.one/apis/v1/social/posts/sync-external",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3'
]),
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://api.aisa.one/apis/v1/social/posts/sync-external"
payload := strings.NewReader("{\n \"accountId\": \"acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.aisa.one/apis/v1/social/posts/sync-external")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/posts/sync-external")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3\"\n}"
response = http.request(request)
puts response.read_body{
"found": true,
"post": {
"analytics": {
"clicks": 123,
"comments": 123,
"engagementRate": 123,
"impressions": 123,
"lastUpdated": "2023-11-07T05:31:56Z",
"likes": 123,
"reach": 123,
"saves": 123,
"sends": 123,
"shares": 123,
"views": 123
},
"content": "<string>",
"isAiGenerated": true,
"isSharedToFeed": true,
"mediaAudioType": "<string>",
"mediaItems": [
{}
],
"mediaProductType": "<string>",
"mediaType": "<string>",
"platform": "<string>",
"platformPostId": "<string>",
"platformPostUrl": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"thumbnailUrl": "<string>"
},
"posts": [
{
"analytics": {
"clicks": 123,
"comments": 123,
"engagementRate": 123,
"impressions": 123,
"lastUpdated": "2023-11-07T05:31:56Z",
"likes": 123,
"reach": 123,
"saves": 123,
"sends": 123,
"shares": 123,
"views": 123
},
"content": "<string>",
"isAiGenerated": true,
"isSharedToFeed": true,
"mediaAudioType": "<string>",
"mediaItems": [
{}
],
"mediaProductType": "<string>",
"mediaType": "<string>",
"platform": "<string>",
"platformPostId": "<string>",
"platformPostUrl": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"thumbnailUrl": "<string>"
}
],
"synced": {
"postsFound": 123,
"postsSynced": 123,
"skipped": true
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}Sync an external post
Analytics. Changes your own setup; needs social:draft. Audited. Ids are yours: accounts acc_…, profiles prf_…, posts pst_…; every other object id is checked against your accounts before the call.
Fetch an account’s latest external posts (published directly on the platform, not through AIsa) on demand. A newly published post is then retrievable within seconds instead of waiting for the background sync, which refreshes each account at most every ~90 minutes.
Primary use case: verifying a submitted post. When a user publishes on the platform and immediately pastes the post URL into your app, call this with accountId plus url (or postId) to confirm the post exists and return its metadata.
Behavior
- Account access and connection state are checked before any platform call, including requests inside the debounce window.
- Inactive accounts or accounts marked
needsReconnectionreturn409with codeads_connection_required. Stop scheduled retries for that account until it is reconnected, then readGET /apis/v1/social/accountsfor its current account ID. - For connected accounts, we fetch the latest posts live from the platform, then match and return the submitted post.
- Requests are debounced per account (~15s): if the account was synced inside that window, the live fetch is skipped.
Account and platforms
accountId is required, because a post URL or id alone cannot be resolved to an account. The account must be connected to AIsa (we use its token to read the platform).
Supported for every platform with a listing API: Instagram, Facebook, TikTok, YouTube, X, Threads, Pinterest, Reddit, Bluesky, Google Business Profile, and LinkedIn organization accounts.
Locating the post
url accepts any format the platform uses, for example:
instagram.com/p/…,instagram.com/reel/…youtu.be/…,youtube.com/shorts/…tiktok.com/@user/video/…,vm.tiktok.comshort linkspinterest.com/pin/…on any regional domain, andpin.itshort links
Pass postId (the platform media/video/pin id) as an alternative locator.
LinkedIn personal profiles
LinkedIn has no listing API for personal profiles, so a url is REQUIRED and imports that single post. Pass any LinkedIn post URL (linkedin.com/posts/…, linkedin.com/feed/update/urn:li:activity:…) or a urn:li:share:… / urn:li:ugcPost:… URN.
It works for posts published outside AIsa and before the account was connected, at any age. The post must be authored by the connected member.
Imported posts return full analytics (impressions, reach, reactions, comments, reshares, saves) and keep refreshing on the background analytics cycle. They carry no content/media, since LinkedIn does not expose them for personal profiles.
publishedAt comes from the post id:
- An activity URL (
linkedin.com/feed/update/urn:li:activity:…) carries the publication time. - A
urn:li:share:…/urn:li:ugcPost:…URN only carries the creation time, which is earlier for a post scheduled in another tool.
Pass the activity URL for the exact publication date. Importing it again for a post already imported by its URN corrects publishedAt on the same record.
Right after an import, the per-post GET /apis/v1/social/analytics?postId= read can show zeros for a few minutes while the metrics are ingested. This endpoint’s response carries the fetched values immediately.
TikTok Business accounts
A postId or TikTok url that the listing has not stored is fetched from TikTok and imported as an external post, at any age, with its current metrics.
Analytics delay
Post-level analytics (reach, impressions) still carry the platform’s own delay (e.g. ~24h on Instagram). This endpoint confirms the post exists and returns its metadata plus basic engagement (likes, comments), not delayed insights.
# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/social/posts/sync-external \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"accountId": "acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3"
}'curl --request POST \
--url https://api.aisa.one/apis/v1/social/posts/sync-external \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/posts/sync-external"
payload = { "accountId": "acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3'})
};
fetch('https://api.aisa.one/apis/v1/social/posts/sync-external', 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.aisa.one/apis/v1/social/posts/sync-external",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3'
]),
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://api.aisa.one/apis/v1/social/posts/sync-external"
payload := strings.NewReader("{\n \"accountId\": \"acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.aisa.one/apis/v1/social/posts/sync-external")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/posts/sync-external")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3\"\n}"
response = http.request(request)
puts response.read_body{
"found": true,
"post": {
"analytics": {
"clicks": 123,
"comments": 123,
"engagementRate": 123,
"impressions": 123,
"lastUpdated": "2023-11-07T05:31:56Z",
"likes": 123,
"reach": 123,
"saves": 123,
"sends": 123,
"shares": 123,
"views": 123
},
"content": "<string>",
"isAiGenerated": true,
"isSharedToFeed": true,
"mediaAudioType": "<string>",
"mediaItems": [
{}
],
"mediaProductType": "<string>",
"mediaType": "<string>",
"platform": "<string>",
"platformPostId": "<string>",
"platformPostUrl": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"thumbnailUrl": "<string>"
},
"posts": [
{
"analytics": {
"clicks": 123,
"comments": 123,
"engagementRate": 123,
"impressions": 123,
"lastUpdated": "2023-11-07T05:31:56Z",
"likes": 123,
"reach": 123,
"saves": 123,
"sends": 123,
"shares": 123,
"views": 123
},
"content": "<string>",
"isAiGenerated": true,
"isSharedToFeed": true,
"mediaAudioType": "<string>",
"mediaItems": [
{}
],
"mediaProductType": "<string>",
"mediaType": "<string>",
"platform": "<string>",
"platformPostId": "<string>",
"platformPostUrl": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"thumbnailUrl": "<string>"
}
],
"synced": {
"postsFound": 123,
"postsSynced": 123,
"skipped": true
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: POST /apis/v1/social/posts/sync-external
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/social/posts/sync-external
{
"operationId": "post_aisa_social_apis_v1_social_posts_sync_external",
"method": "POST",
"path": "/apis/v1/social/posts/sync-external",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"accountId": "acc_7Hq2Lm9Xc4Rt8Vw1Nb6Ks3"
},
"schema": {
"properties": {
"accountId": {
"description": "One of your social accounts (acc_...).",
"pattern": "^acc_[0-9A-Za-z]{22}$",
"type": "string"
},
"postId": {
"description": "The platform post/media/video id to locate, as an alternative to `url`. Optional.",
"type": "string"
},
"url": {
"description": "The post URL to locate. Optional. Provide `url` or `postId` to return a specific post; omit both to refresh and return the account's recent posts.",
"type": "string"
}
},
"required": [
"accountId"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation.Authorizations
Body
Response
Sync result. When url or postId is provided, returns the matched post (or found: false). When neither is provided, returns the account's freshly-synced recent posts.