Account Health — GET /v1/accounts/:id/health
Tells you whether a connected social account is currently usable for publishing — token alive, OAuth grant still valid, no recent terminal failures. Call this BEFORE a critical publish so you can surface a "reconnect needed" prompt instead of letting a publish fail.
Request
curl https://app.posteverywhere.ai/api/v1/accounts/$ACCOUNT_ID/health \
-H "Authorization: Bearer $POSTEVERYWHERE_API_KEY"
Read-only. Requires read scope.
Response
{
"account_id": 5356,
"platform": "instagram",
"account_name": "taxrefundonspot.com.au",
"platform_account_id": "17841451231344189",
"status": "healthy", // healthy | warning | broken
"can_post": true, // boolean — short-circuit for client code
"reasons": [], // empty when healthy; reason codes otherwise
"is_active": true,
"needs_reconnection": false,
"needs_reconnection_since": null,
"token": {
"expires_at": "2026-07-15T...",
"last_refresh": "2026-06-10T...",
"expired": false,
"expiring_soon": false // true if expires within 7 days
},
"activity": {
"last_published_at": "2026-06-11T05:42:17Z",
"failures_last_7d": 2,
"permanent_failures_last_7d": 0,
"queued_count": 12
},
"connected_at": "2025-11-01T..."
}
Status verdict
The status field gives a single answer to "should my client trust this account?":
| Status | can_post | What it means |
|---|---|---|
healthy | true | Token alive, no recent terminal failures. Publish normally. |
warning | true | Account works but watch out — token expires soon OR several recent permanent failures. |
broken | false | Don't publish. Either the account is inactive, the token expired, or needs_reconnection is set. User must reconnect. |
Reason codes (in reasons[])
| Code | Triggers |
|---|---|
account_inactive | is_active = false |
needs_reconnection | needs_reconnection_since is set (token detected dead) |
token_expired | token.expires_at is in the past |
token_expiring_soon | token.expires_at is within 7 days |
recent_permanent_failures | ≥3 permanent failures in last 7 days |
The first matching reason determines status (broken > warning > healthy).
Typical workflow
// Before publishing, check all selected accounts.
const checks = await Promise.all(
accountIds.map(id => client.accounts.health(id))
);
const broken = checks.filter(c => !c.can_post);
if (broken.length > 0) {
showToast(
`Some accounts need attention: ${broken.map(b => b.account_name).join(', ')}`
);
return; // Don't proceed.
}
await client.posts.create({ content, account_ids: accountIds });