Layers

DELETE /v1/leased-accounts/:socialAccountId

Release an assigned account back to the Layers pool. Billing stops at the next billing cycle boundary.

View as Markdown
DELETE/v1/leased-accounts/:socialAccountId
Phase 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
  • socialAccountId
    stringrequired
    Leased account id.
Body
  • reason
    stringoptional
    Free-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

StatusCodeWhen
401UNAUTHENTICATEDMissing or invalid key.
403FORBIDDEN_SCOPEKey lacks leased:write.
404NOT_FOUNDAccount not in your organization, already released, or never existed.
409CONFLICTAccount exists but is BYO, not leased. details.reason = "NOT_LEASED" — use DELETE /v1/social-accounts/:id instead.

See also

On this page