# DELETE /v1/social-accounts/:socialAccountId (/docs/api/reference/social-accounts/revoke-social-account)



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

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`](/docs/api/reference/leased-accounts/release-leased-account) is the better endpoint — it releases the billing as well.

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

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

This endpoint takes no request body. The cancellation reason is recorded internally as `revoked_by_partner`.

## Example request [#example-request]

<Tabs items="['curl', 'TypeScript', 'Python']">
  <Tab value="curl">
    ```bash
    curl -X DELETE https://api.layers.com/v1/social-accounts/sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A \
      -H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..."
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const result = await layers.social.revoke({
      socialAccountId: "sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A",
    });

    console.log(`Canceled ${result.canceledScheduledPosts} queued posts.`);
    ```
  </Tab>

  <Tab value="Python">
    ```python
    result = layers.social.revoke(
        social_account_id="sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A",
    )
    ```
  </Tab>
</Tabs>

## Response [#response]

<Response status="200" description="Revoked">
  ```json
  {
    "socialAccountId": "sa_01HXZ9P2M4N5KLM6TUV7WXYZ9A",
    "status": "disconnected",
    "disconnectedReason": "revoked_by_partner",
    "canceledScheduledPosts": 4,
    "disconnectedAt": "2026-04-18T19:15:02Z"
  }
  ```
</Response>

## Errors [#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`](/docs/api/reference/leased-accounts/release-leased-account) — 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 [#see-also]

* [`GET /v1/projects/:id/social-accounts`](/docs/api/reference/social-accounts/list-social-accounts) — check status before revoking
* [`DELETE /v1/leased-accounts/:id`](/docs/api/reference/leased-accounts/release-leased-account) — release leased accounts
