> ## 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 saved tweet drafts by ID with the Xquik API

> Delete one Xquik tweet draft by ID without deleting a published post or native X draft. Handle empty 204 responses and 400, 401, 404 & 429 API errors.

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

    <Tab title="400" id="response-drafts-delete-400">
      ```json theme={null}
      {
        "error": "invalid_input",
        "message": "Invalid input. Check the request body."
      }
      ```
    </Tab>

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

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

    <Tab title="429" id="response-drafts-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>

## Delete one saved tweet draft

Delete one tweet draft from your Xquik account. The request removes its saved
text, optional topic, optional goal, and timestamps. It does not publish the
draft or call an X write route.

This endpoint manages Xquik draft records only. It does not manage drafts under
[X's native Unsent posts](https://help.x.com/en/using-x/how-to-post). It also
does not delete published tweets, scheduled posts, or connected X accounts.

Use the draft ID returned by [Create Draft](/api-reference/drafts/create) or
[List Drafts](/api-reference/drafts/list). Fetch the draft before deletion when
its text must receive human approval.

<Warning>
  Deletion is permanent. Xquik provides no restore endpoint for deleted tweet
  drafts. Confirm the saved text and draft ID before sending this request.
</Warning>

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

<CodeGroup>
  ```bash cURL theme={null}
  curl --include --request DELETE \
    https://xquik.com/api/v1/drafts/42 \
    --header "x-api-key: xq_YOUR_KEY_HERE"
  ```

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

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

  console.log(`Deleted tweet draft ${draftId}`);
  ```

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

  draft_id = "42"
  response = requests.delete(
      f"https://xquik.com/api/v1/drafts/{draft_id}",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )

  if response.status_code != 204:
      problem = response.json()
      raise RuntimeError(
          f'{response.status_code} {problem["error"]}: {problem["message"]}'
      )

  print(f"Deleted tweet draft {draft_id}")
  ```

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

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

  func main() {
      draftID := "42"
      req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/drafts/"+draftID, 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()

      if resp.StatusCode != http.StatusNoContent {
          var problem struct {
              Error   string `json:"error"`
              Message string `json:"message"`
          }
          if err := json.NewDecoder(resp.Body).Decode(&problem); err != nil {
              panic(err)
          }
          panic(fmt.Sprintf("%d %s: %s", resp.StatusCode, problem.Error, problem.Message))
      }

      fmt.Printf("Deleted tweet draft %s\n", draftID)
  }
  ```
</CodeGroup>

## Handle 204 no content

A successful tweet draft deletion returns `204 No Content`. The response has no
JSON, text, or deletion object. Check the status before parsing the body.

Calling `response.json()` after a successful deletion throws an end-of-input
error. Parse JSON only for `400`, `401`, `404`, or `429` responses.

The `204` status confirms that Xquik deleted the matching draft record. It does
not return the deleted text. Fetch and store any needed review copy first.

## Confirm the correct tweet draft

Use a read-before-delete flow for dashboards, agents, and scheduled cleanup
jobs.

1. Fetch the draft through `GET /drafts/{id}`.
2. Compare its `id`, `text`, `topic`, `goal`, and timestamps.
3. Ask for confirmation when a person owns the draft.
4. Send `DELETE /drafts/{id}` once.
5. Accept only `204` as a successful deletion.
6. Remove the draft from your local queue.
7. List drafts again when reconciliation matters.

Do not guess draft IDs. Use an ID returned to the authenticated account. A
numeric ID owned by another account returns `404` without exposing ownership.

## Understand what deletion changes

| Resource | Result | Reason |
| - | - | - |
| Matching Xquik draft | Deleted permanently | This route targets one stored draft ID. |
| Draft text, topic, and goal | Deleted with the draft | These fields belong to that record. |
| Native X or Twitter draft | Unchanged | Xquik cannot edit the X compose box. |
| Published tweet or thread | Unchanged | Use a separate X write route for live posts. |
| Scheduled post | Unchanged | Draft deletion does not cancel a schedule. |
| Connected X account | Unchanged | The request changes no account connection. |

A saved Xquik tweet draft is not a published tweet. It has an Xquik draft ID,
not a public tweet ID. Deleting one cannot remove replies, reposts, likes, or
media attached to a published post.

## Recover from draft deletion errors

| Status | Error | Cause | Fix |
| - | - | - | - |
| `204` | No body | Xquik deleted the draft | Stop. Do not parse JSON. |
| `400` | `invalid_id` | The path value is not a parseable draft ID | Copy an ID from Create Draft or List Drafts. |
| `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. |
| `404` | `draft_not_found` | The draft is absent or belongs to another account | Verify the ID and authenticated account. |
| `429` | `rate_limit_exceeded` | Too many requests reached the route | Wait for `Retry-After`, then retry once. |

A second deletion of the same ID returns `404`. The first request already
removed the record. Treat that result as success only when your workflow
allows it.

Never retry `400`, `401`, or `404` without changing the request. The same
request fails the same way. It cannot restore a deleted draft.

## Tweet draft deletion questions

### Does this delete a published tweet?

No. This route deletes one saved Xquik draft. Use the documented tweet deletion
route for a live post owned by the connected account.

### Does this delete my native X draft?

No. Native X drafts appear under Unsent posts. Xquik draft IDs identify separate
records stored for API composition workflows.

### Can I restore a deleted tweet draft?

No restore route exists. Save an approved copy before deletion when retention
rules require one.

### Can I delete every draft in one request?

No bulk deletion route exists. List drafts, confirm each target, and delete each
ID separately. Apply your own concurrency and rate-limit controls.

### Why does a successful delete return no JSON?

HTTP `204` means the deletion succeeded without response content. Check the
status code instead of parsing a body.

### Why does a retry return 404?

The first successful request removed the draft. Later requests cannot find the
same account-owned record.

### Does deleting a draft consume credits?

No. This authenticated route is free and consumes no Xquik credits.

## Path parameters

<ParamField path="id" type="string" required>
  The unique Xquik draft ID. Copy it from [Create Draft](/api-reference/drafts/create) or [List Drafts](/api-reference/drafts/list).
</ParamField>

## Headers

<ParamField header="x-api-key" type="string">
  Your Xquik API key. Generate one from the [dashboard](https://xquik.com/dashboard).
</ParamField>

<ParamField header="Authorization" type="string">
  An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both.
</ParamField>

## Response

<Tabs>
  <Tab title="204 No content">
    Xquik deleted the draft. Do not parse a response body.
  </Tab>

  <Tab title="400 Invalid ID">
    ```json theme={null}
    { "error": "invalid_id", "message": "Invalid ID format." }
    ```

    The provided draft ID is not a valid format.
  </Tab>

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

    Missing or invalid API key.
  </Tab>

  <Tab title="404 Not found">
    ```json theme={null}
    { "error": "draft_not_found", "message": "Draft not found." }
    ```

    No draft exists with this ID, 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 Drafts](/api-reference/drafts/list) to verify the draft was removed, or [Create Draft](/api-reference/drafts/create) to save a new one.
</Note>


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