DELETE /v1/leased-accounts/:socialAccountId
Release an assigned account back to the Layers pool. Billing stops at the next billing cycle boundary.
DELETE
/v1/leased-accounts/:socialAccountIdPhase 1stable
- Auth
- Bearer
- Scope
- leased:write
Give a leased account back to Layers. The account goes back into the warmed pool, future monthly charges stop, and any queued scheduled posts on it are canceled.
Release is the right way to stop billing on a leased account. DELETE /v1/social-accounts/:id will refuse to operate on leased accounts because it doesn't touch billing — you'll get 409 CONFLICT pointing you here.
Release is immediate. The account stops being yours the moment this call returns. We do not prorate the current month — you've already paid for it, and there's no partial refund. Releasing just before the next renewal saves you the next charge, not the current one.
Path
socialAccountIdstringrequiredLeased account id.
Body
reasonstringoptionalFree-form note stored on the audit log. Helps ops gauge demand.
Example request
curl -X DELETE https://api.layers.com/v1/leased-accounts/sa_01HXZS8N3C5R6STUV7WXYZ9AB \
-H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..." \
-H "Content-Type: application/json" \
-d '{ "reason": "Customer churned — shutting down their project." }'const result = await layers.leasedAccounts.release({
socialAccountId: "sa_01HXZS8N3C5R6STUV7WXYZ9AB",
reason: "Customer churned — shutting down their project.",
});result = layers.leased_accounts.release(
social_account_id="sa_01HXZS8N3C5R6STUV7WXYZ9AB",
reason="Customer churned — shutting down their project.",
)Response
200Released
{
"socialAccountId": "sa_01HXZS8N3C5R6STUV7WXYZ9AB",
"status": "disconnected",
"disconnectedReason": "released_by_partner",
"disconnectedAt": "2026-04-18T19:27:03Z"
}Errors
| Status | Code | When |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 403 | FORBIDDEN_SCOPE | Key lacks leased:write. |
| 404 | NOT_FOUND | Account not in your organization, already released, or never existed. |
| 409 | CONFLICT | Account exists but is BYO, not leased. details.reason = "NOT_LEASED" — use DELETE /v1/social-accounts/:id instead. |
See also
GET /v1/projects/:id/leased-accounts— checknextRenewalAtbefore releasingPOST /v1/projects/:id/leased-accounts/request— request replacements