List the accounts
Response
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Find the socialAccountId that every posting call needs.
curl https://api.sapt.ai/socials/accounts/$PROJECT_ID \
-H "Authorization: ApiKey $SAPT_API_KEY"
const res = await fetch(
`https://api.sapt.ai/socials/accounts/${projectId}`,
{ headers: { Authorization: `ApiKey ${process.env.SAPT_API_KEY}` } }
)
const { data } = await res.json()
import os, requests
res = requests.get(
f"https://api.sapt.ai/socials/accounts/{project_id}",
headers={"Authorization": f"ApiKey {os.environ['SAPT_API_KEY']}"},
)
accounts = res.json()["data"]["accounts"]
{
"success": true,
"data": {
"accounts": [
{
"id": "9f1c2f7a-4c9e-4a1d-9d0e-8a5b6c7d8e9f",
"platform": "instagram",
"platformAccountId": "17841400000000000",
"username": "yarimonter0",
"displayName": "Yari Montero",
"profilePictureUrl": "https://…/pic.jpg",
"profileUrl": "https://instagram.com/yarimonter0",
"followersCount": 12840,
"isActive": true,
"tokenExpiresAt": "2026-11-04T09:12:00Z",
"createdAt": "2026-03-11T18:22:41Z"
}
]
}
}
| Field | Why you care |
|---|---|
id | This is the socialAccountId every posting and analytics endpoint takes. A Sapt UUID, not a platform id. |
platform | Which platform this account posts to. Pass the same value as platform when creating a post. |
platformAccountId | The platform’s own id — an Instagram Business Account id, a Facebook Page id. Used by comment and analytics endpoints that address platform objects. |
isActive | false means the connection is disabled. Posting to it will fail. |
tokenExpiresAt | When the stored credential lapses. Past this, publishing fails until the account is reconnected in the dashboard. |
id and platformAccountId are different values and are not interchangeable.
Posting endpoints take id; comment and engagement endpoints that address a
platform object (a post, a media item, a comment) take platform-native ids.const usable = accounts.filter(
(a) =>
a.isActive &&
(a.tokenExpiresAt === null || new Date(a.tokenExpiresAt) > new Date())
)