get_account_health
Reports connections whose access token has expired or is close to expiring, and which therefore need the user to reconnect. Worth checking before scheduling anything far out: a post queued onto a dead connection fails at publish time, not at scheduling time.
On this page
- Category
- Channels
- REST
- POST/api/tools/get_account_health
Parameters
workspaceIdstringoptional
Workspace to act on, from list_workspaces. Omit to use the default workspace on the key.
Example request
curl -X POST "https://api.postmcpai.com/api/tools/get_account_health" \
-H "Content-Type: application/json" \
-H "x-api-key: $POSTMCPAI_API_KEY"Response
healthy is true when every connection is fine; connections[] lists the ones that are not.
{
"healthy": false,
"message": "1 connection(s) need attention before they are posted to.",
"connections": [
{
"platform": "instagram",
"profileId": "ig_5540912",
"username": "acme.studio",
"needsReconnect": true,
"expired": true,
"daysLeft": 0,
"reason": "Refresh token was revoked by the user"
}
]
}