DELETE /v1/social-accounts/:socialAccountId
Revoke a social account. Cancels any scheduled posts on it.
/v1/social-accounts/:socialAccountId- Auth
- Bearer
- Scope
- social:write
Disconnect a social account. Layers drops the stored token, marks the account disconnected (with disconnectedReason = "revoked_by_partner"), and cancels every queued post targeting it. Already-published posts stay on the platform — we don't delete upstream content.
Use this when the end-customer asks to disconnect, or as part of offboarding a customer. For leased accounts, DELETE /v1/leased-accounts/:id is the better endpoint — it releases the billing as well.
Revoking cancels all queued scheduled posts on this account in a single transaction. The response's canceledScheduledPosts count is your audit trail. If that number surprises you, stop and re-check before moving on.
socialAccountIdstringrequiredAccount to revoke.
This endpoint takes no request body. The cancellation reason is recorded internally as revoked_by_partner.
Example request
curl -X DELETE https://api.layers.com/v1/social-accounts/sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A \
-H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..."const result = await layers.social.revoke({
socialAccountId: "sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A",
});
console.log(`Canceled ${result.canceledScheduledPosts} queued posts.`);result = layers.social.revoke(
social_account_id="sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A",
)Response
{
"socialAccountId": "sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A",
"status": "disconnected",
"disconnectedReason": "revoked_by_partner",
"canceledScheduledPosts": 4,
"disconnectedAt": "2026-04-18T19:15:02Z"
}Errors
| Status | Code | When |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 403 | FORBIDDEN_SCOPE | Key lacks social:write. |
| 404 | NOT_FOUND | Account not in your organization, or already disconnected. |
| 429 | RATE_LIMITED | Write budget exhausted. |
For leased accounts, prefer DELETE /v1/leased-accounts/:id — it releases the billing relationship in addition to disconnecting. Calling this endpoint on a leased account succeeds (the account is marked disconnected) but does not release the lease.
See also
GET /v1/projects/:id/social-accounts— check status before revokingDELETE /v1/leased-accounts/:id— release leased accounts