# DELETE /v1/leased-accounts/:socialAccountId (/docs/api/reference/leased-accounts/release-leased-account)



<Endpoint method="DELETE" path="/v1/leased-accounts/:socialAccountId" auth="Bearer" scope="leased:write" phase="1" />

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`](/docs/api/reference/social-accounts/revoke-social-account) will refuse to operate on leased accounts because it doesn't touch billing — you'll get `409 CONFLICT` pointing you here.

<Callout type="warn">
  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.
</Callout>

<Parameters
  title="Path"
  rows="[
  { name: 'socialAccountId', type: 'string', required: true, description: 'Leased account id.' },
]"
/>

<Parameters
  title="Body"
  rows="[
  { name: 'reason', type: 'string', description: 'Free-form note stored on the audit log. Helps ops gauge demand.' },
]"
/>

## Example request [#example-request]

<Tabs items="['curl', 'TypeScript', 'Python']">
  <Tab value="curl">
    ```bash
    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." }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const result = await layers.leasedAccounts.release({
      socialAccountId: "sa_01HXZS8N3C5R6STUV7WXYZ9AB",
      reason: "Customer churned — shutting down their project.",
    });
    ```
  </Tab>

  <Tab value="Python">
    ```python
    result = layers.leased_accounts.release(
        social_account_id="sa_01HXZS8N3C5R6STUV7WXYZ9AB",
        reason="Customer churned — shutting down their project.",
    )
    ```
  </Tab>
</Tabs>

## Response [#response]

<Response status="200" description="Released">
  ```json
  {
    "socialAccountId": "sa_01HXZS8N3C5R6STUV7WXYZ9AB",
    "status": "disconnected",
    "disconnectedReason": "released_by_partner",
    "disconnectedAt": "2026-04-18T19:27:03Z"
  }
  ```
</Response>

## Errors [#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`](/docs/api/reference/social-accounts/revoke-social-account) instead. |

## See also [#see-also]

* [`GET /v1/projects/:id/leased-accounts`](/docs/api/reference/leased-accounts/list-leased-accounts) — check `nextRenewalAt` before releasing
* [`POST /v1/projects/:id/leased-accounts/request`](/docs/api/reference/leased-accounts/request-lease) — request replacements
