> ## 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.

# Delete cached Twitter writing style profile

> Delete a cached Twitter writing-style profile and its stored tweet samples by username. The X account and every live tweet stay. Includes error recovery.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="204" id="response-styles-delete-204">
      ```text theme={null}
      No response body.
      ```
    </Tab>

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

    <Tab title="404" id="response-styles-delete-404">
      ```json theme={null}
      {
        "error": "not_found",
        "message": "Resource not found."
      }
      ```
    </Tab>

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

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

<Callout icon="circle-check" color="#16a34a">
  **Free.** This endpoint does not consume credits.
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://xquik.com/api/v1/styles/elonmusk \
    -H "x-api-key: xq_YOUR_KEY_HERE" -w "\n%{http_code}"
  ```

  ```javascript Node.js theme={null}
  const username = "elonmusk";
  const response = await fetch(`https://xquik.com/api/v1/styles/${username}`, {
    method: "DELETE",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
    },
  });
  console.log(response.ok); // true on success (204 No Content)
  ```

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

  username = "elonmusk"
  response = requests.delete(
      f"https://xquik.com/api/v1/styles/{username}",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  response.raise_for_status()  # 204 No Content on success
  ```

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

  import (
      "fmt"
      "net/http"
  )

  func main() {
      username := "elonmusk"
      req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/styles/"+username, nil)
      if err != nil {
          panic(err)
      }
      req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")

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

      fmt.Println(resp.StatusCode) // 204 on success
  }
  ```
</CodeGroup>

## Delete a cached Twitter writing style

Delete a style when its sampled tweets no longer represent the intended voice.
The request removes one cached writing-style profile owned by your Xquik
account. It also removes the tweet samples stored with that profile.

Use the `xUsername` returned by [List Styles](/api-reference/styles/list).
Place that username in the `{id}` path segment. The examples use `elonmusk`.
Do not include the leading `@` character.

| Deleted record | Unchanged record |
| - | - |
| Cached X username | The connected X account |
| Stored tweet samples | Every live tweet on X |
| Cache metadata (`tweetCount`, `fetchedAt`, `isOwnAccount`) | X profile name, bio, avatar, and banner |
| Custom style examples saved under that label | Followers, following, replies, likes, and reposts |

<Warning>
  Deletion is permanent. Xquik does not provide a restore endpoint for deleted
  style profiles. Analyze the username again to build a new cache.
</Warning>

## Handle a 204 response without JSON

A successful deletion returns `204 No Content`. The response body is empty.
Check `response.status === 204` or `response.ok`. Do not call
`response.json()` after a successful request.

```javascript Node.js theme={null}
const username = "elonmusk";
const response = await fetch(`https://xquik.com/api/v1/styles/${username}`, {
  method: "DELETE",
  headers: { "x-api-key": "xq_YOUR_KEY_HERE" },
});

if (response.status !== 204) {
  const error = await response.json();
  throw new Error(`${error.error}: ${error.message}`);
}
```

Call [List Styles](/api-reference/styles/list) after deletion when reconciliation
matters. The removed username should no longer appear in that account's list.

## Recover from style deletion errors

| Status | Meaning | Recovery |
| - | - | - |
| `204` | Xquik deleted the cached style | Stop. Do not parse a body. |
| `401` | Authentication failed | Replace the missing or invalid credential. |
| `404` | No matching cached style belongs to this account | Check the username with List Styles. |
| `429` | The request exceeded the rate limit | Wait for `Retry-After`, then retry once. |

A repeated deletion returns `404` after the cache is gone. Treat that result as
success only when your workflow allows it. Never retry `404` in a loop.

### Does this delete tweets from X?

No. This route deletes Xquik's cached samples only. The source tweets remain
on X. The connected X account also remains available for approved workflows.

### Can I restore a deleted Twitter writing style?

No restore route exists. Use [Analyze & Cache Style](/api-reference/styles/analyze)
to fetch current tweets and create a fresh writing-style profile.

## Path parameters

<ParamField path="id" type="string" required>
  Style profile ID or X username whose cached style to delete.
</ParamField>

## Headers

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

## Response

<Tabs>
  <Tab title="204 No content">
    Empty response body. Xquik deleted the style.
  </Tab>

  <Tab title="401 Unauthenticated">
    ```json theme={null}
    { "error": "unauthenticated", "message": "Missing or invalid API key" }
    ```

    Missing or invalid API key.
  </Tab>

  <Tab title="404 Not found">
    ```json theme={null}
    { "error": "style_not_found", "message": "No cached style found for this username" }
    ```

    No cached style exists for this username, or it belongs to a different account.
  </Tab>

  <Tab title="429 Rate limited">
    ```json theme={null}
    { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }
    ```

    Too many requests. Wait for the `Retry-After` header before retrying.
  </Tab>
</Tabs>

<Note>
  **Related.** [List Styles](/api-reference/styles/list) to verify the removal, or [Analyze & Cache Style](/api-reference/styles/analyze) to cache a new style.
</Note>


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