> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to delete a community on Twitter via API

> Delete an owned X community by ID and confirmed name. Archive its tweets, members, moderators, and rules, then verify the final write lifecycle state.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-write-delete-community-200">
      ```json theme={null}
      {
        "object": "x_write_action",
        "id": "12345",
        "writeActionId": "12345",
        "action": "delete_community",
        "status": "success",
        "terminal": true,
        "retryable": false,
        "safeToRetry": false,
        "statusUrl": "/api/v1/x/write-actions/12345",
        "pollAfterMs": null
      }
      ```
    </Tab>

    <Tab title="202" id="response-x-write-delete-community-202">
      ```json theme={null}
      {
        "object": "x_write_action",
        "id": "12346",
        "writeActionId": "12346",
        "action": "delete_community",
        "status": "dispatching",
        "terminal": false,
        "retryable": false,
        "safeToRetry": false,
        "statusUrl": "/api/v1/x/write-actions/12346",
        "pollAfterMs": 2000
      }
      ```
    </Tab>

    <Tab title="400" id="response-x-write-delete-community-400">
      ```json theme={null}
      {
        "error": "missing_idempotency_key",
        "message": "Idempotency-Key is required. Generate one unique key for this write.",
        "charged": false,
        "chargedCredits": "0",
        "retryable": false,
        "safeToRetry": true
      }
      ```
    </Tab>

    <Tab title="401" id="response-x-write-delete-community-401">
      ```json theme={null}
      {
        "error": "unauthenticated",
        "message": "Authentication required. Provide a valid API key or bearer token."
      }
      ```
    </Tab>

    <Tab title="402" id="response-x-write-delete-community-402">
      ```json theme={null}
      {
        "error": "insufficient_credits",
        "message": "Insufficient credits. Top up or subscribe to continue."
      }
      ```
    </Tab>

    <Tab title="403" id="response-x-write-delete-community-403">
      ```json theme={null}
      {
        "error": "account_needs_reauth",
        "message": "X account needs re-authentication. Re-add the account."
      }
      ```
    </Tab>

    <Tab title="404" id="response-x-write-delete-community-404">
      ```json theme={null}
      {
        "error": "account_not_found",
        "message": "X account not found. Connect it first at /dashboard/account?tab=x-accounts."
      }
      ```
    </Tab>

    <Tab title="409" id="response-x-write-delete-community-409">
      ```json theme={null}
      {
        "error": "idempotency_conflict",
        "message": "Idempotency-Key was already used with a different request.",
        "charged": false,
        "chargedCredits": "0",
        "retryable": false,
        "safeToRetry": true
      }
      ```
    </Tab>

    <Tab title="422" id="response-x-write-delete-community-422">
      ```json theme={null}
      {
        "error": "x_rejected",
        "message": "X rejected this request. Check what you sent & the account on x.com before you try again."
      }
      ```
    </Tab>

    <Tab title="429" id="response-x-write-delete-community-429">
      ```json theme={null}
      {
        "error": "rate_limit_exceeded",
        "message": "Too many requests. Try again later.",
        "retryAfter": 60
      }
      ```
    </Tab>

    <Tab title="500" id="response-x-write-delete-community-500">
      ```json theme={null}
      {
        "error": "x_write_failed",
        "message": "Write action failed unexpectedly. Contact support if this persists."
      }
      ```
    </Tab>

    <Tab title="503" id="response-x-write-delete-community-503">
      ```json theme={null}
      {
        "error": "write_tracking_unavailable",
        "message": "Write tracking unavailable. Try again.",
        "charged": false,
        "chargedCredits": "0",
        "retryable": true,
        "safeToRetry": true
      }
      ```
    </Tab>
  </Tabs>
</Panel>

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

## How to delete a Twitter community through REST

Call `DELETE /x/communities/{id}` for one community owned by a connected
account. Send its exact `community_name` to confirm the target. This
route removes the community, not the connected X account.

Use [Leave Community](/api-reference/x-write/leave-community) to remove one
account's membership. Use [Delete Tweet](/api-reference/x-write/delete-tweet)
to remove one owned Community post.

<Callout icon="coins" color="#5c3327">
  **10 credits per call** · [All plans](https://xquik.com/#pricing) from \$0.00012/credit
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://xquik.com/api/v1/x/communities/1893726451023847424 \
    -H "x-api-key: xq_YOUR_KEY_HERE" \
    -H "Idempotency-Key: community-delete-1895432178065391234" \
    -H "Content-Type: application/json" \
    -d '{
      "account": "myxhandle",
      "community_name": "Crypto Traders Hub"
    }' | jq
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/x/communities/1893726451023847424", {
    method: "DELETE",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
      "Idempotency-Key": "community-delete-1895432178065391234",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      account: "myxhandle",
      community_name: "Crypto Traders Hub",
    }),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.delete(
      "https://xquik.com/api/v1/x/communities/1893726451023847424",
      headers={
          "x-api-key": "xq_YOUR_KEY_HERE",
          "Idempotency-Key": "community-delete-1895432178065391234",
      },
      json={
          "account": "myxhandle",
          "community_name": "Crypto Traders Hub",
      },
  )
  data = response.json()
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      body, _ := json.Marshal(map[string]interface{}{
          "account":        "myxhandle",
          "community_name": "Crypto Traders Hub",
      })

      req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/x/communities/1893726451023847424", bytes.NewReader(body))
      if err != nil {
          panic(err)
      }
      req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")
      req.Header.Set("Idempotency-Key", "community-delete-1895432178065391234")
      req.Header.Set("Content-Type", "application/json")

      resp, err := http.DefaultClient.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var data map[string]interface{}
      if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
          panic(err)
      }
      fmt.Println(data)
  }
  ```
</CodeGroup>

## Archive records before you delete a Twitter community

Confirm the community ID, owner, exact name, reason, and approver. Create one
`Idempotency-Key` for that deletion. Reuse it only during unchanged network
recovery. Xquik has no restore route. Plan for permanent removal.

Archive required records before approval:

* Save the name, description, rules, creator, and policies from [Community Info](/api-reference/x/community-info).
* Follow every [Community Tweets](/api-reference/x/community-tweets) cursor. Store tweet IDs, authors, text, timestamps, media URLs, replies, reposts, and likes.
* Follow every [Community Members](/api-reference/x/community-members) cursor. Store stable user IDs and the final `hasMore` value.
* Export [Community Moderators](/api-reference/x/community-moderators) separately. Member rows do not prove moderator roles.

X says Community posts remain after you delete their Community. Review the
[X Communities guide](https://help.x.com/en/using-x/communities) before
removal. Keep your archive even when those posts remain visible elsewhere.

## Verify permanent community deletion

Store the action ID after `200` or `202`. Poll while `terminal` is `false`.
After terminal success, call [Community Info](/api-reference/x/community-info).
An unavailable community confirms removal. A temporary read failure does not.
Repeat the read before starting another deletion.

## Fix Twitter community deletion errors

Fix invalid fields after `400`. Replace credentials after `401`. Add credits
after `402`. Reconnect the owner after `403`. Verify the account and community
after `404`. Resolve key conflicts after `409`. Review rejected requests after
`422`. Honor `Retry-After` after `429`. Check `safeToRetry` after `500` or `503`.

## Delete Twitter community questions

### Can you delete a Twitter community?

Yes. Send the community ID and exact name through the connected owner. Xquik
then returns a tracked write action.

### Does deletion affect the owner's X profile?

No profile field appears in the request body. The route targets one community ID.
It does not disconnect or delete the owner's X account.

### Can a deleted community be restored?

Xquik documents no restore endpoint. Archive first and treat deletion as
permanent within this API workflow.

### Can I transfer ownership instead?

This route has no ownership-transfer field. Complete any supported transfer in
X before deletion, then verify the intended owner.

### What happens to members and community posts?

Members lose access to the deleted Community. X says it keeps existing Community posts
when you delete the Community. Archive required posts before removal. Use
Delete Tweet for an owned post.

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://xquik.com/dashboard).
</ParamField>

<ParamField header="Idempotency-Key" type="string" required>
  Unique key for this intended write. Reuse it only when every field remains unchanged after interruption.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

## Path parameters

<ParamField path="id" type="string" required>
  The ID of the community to delete.
</ParamField>

## Body

<ParamField body="account" type="string" required>
  The connected X account that owns the community. Must be a username you have connected to your Xquik account.
</ParamField>

<ParamField body="community_name" type="string" required>
  The exact community name. Send it to avoid deleting a different Community.
</ParamField>

## Response

<Tabs>
  <Tab title="404 Account not found">
    Connect the requested account, then submit a newly approved write.
  </Tab>
</Tabs>

## Durable write recovery

<Warning>
  Send one unique `Idempotency-Key` per intended write.
  Replay the same account, target, payload, and media after a lost response.
  Keep the original key for that replay.
</Warning>

1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`.
2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`.
3. Retry only when `safeToRetry` is `true`.
4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`.

### 200 terminal or 202 active

* After HTTP `200`, store the result and settled billing.
* After HTTP `202`, poll the same action. Never submit another write.
* After HTTP `400`, fix the named field. Use a new idempotency key.
* After HTTP `401`, fix authentication. Do not retry unchanged.
* After HTTP `402`, fund the account before another write.
* After HTTP `403`, reconnect the account.
* After HTTP `409`, keep the original action. Use a new key for new input.
* After HTTP `422`, fix the rejected request before retrying.
* After HTTP `429`, wait for `Retry-After`. Follow `nextAction`.

See [Get Write Action Status](/api-reference/x-write/get-write-action-status)
for every lifecycle field, terminal state, billing field, and retry rule.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.