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

# List drafts

> Retrieve saved tweet drafts with cursor-based pagination

<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** - does not consume credits
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://xquik.com/api/v1/drafts?limit=20" \
    -H "x-api-key: xq_YOUR_KEY_HERE" | jq
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/drafts?limit=20", {
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
    },
  });
  const data = await response.json();
  ```

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

  response = requests.get(
      "https://xquik.com/api/v1/drafts",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
      params={"limit": 20},
  )
  data = response.json()
  ```

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

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

  func main() {
      req, err := http.NewRequest("GET", "https://xquik.com/api/v1/drafts?limit=20", 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()

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

## Query parameters

<ParamField query="limit" type="number">
  Results per page. Default `50`, max `50`.
</ParamField>

<ParamField query="afterCursor" type="string">
  Pagination cursor from a previous response. Pass the `nextCursor` value to fetch the next page.
</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="200 OK">
    <ResponseField name="drafts" type="object[]">Array of draft objects, ordered by creation date (newest first).</ResponseField>
    <ResponseField name="drafts[].id" type="string">Unique draft ID.</ResponseField>
    <ResponseField name="drafts[].text" type="string">The draft tweet text.</ResponseField>
    <ResponseField name="drafts[].topic" type="string">Topic the tweet is about. Omitted if not set.</ResponseField>
    <ResponseField name="drafts[].goal" type="string">Optimization goal. Omitted if not set.</ResponseField>
    <ResponseField name="drafts[].createdAt" type="string">ISO 8601 creation timestamp.</ResponseField>
    <ResponseField name="drafts[].updatedAt" type="string">ISO 8601 last update timestamp.</ResponseField>
    <ResponseField name="hasMore" type="boolean">`true` if additional pages exist beyond this result set.</ResponseField>
    <ResponseField name="nextCursor" type="string">Pagination cursor. Pass as the `afterCursor` query parameter to fetch the next page. Present only when `hasMore` is `true`.</ResponseField>

    ```json theme={null}
    {
      "drafts": [
        {
          "id": "42",
          "text": "Just shipped dark mode. What feature should we build next?",
          "topic": "product update",
          "goal": "conversation",
          "createdAt": "2026-02-24T10:30:00.000Z",
          "updatedAt": "2026-02-24T10:30:00.000Z"
        },
        {
          "id": "38",
          "text": "3 things I learned building a real-time data platform:",
          "goal": "authority",
          "createdAt": "2026-02-23T16:15:00.000Z",
          "updatedAt": "2026-02-23T16:15:00.000Z"
        }
      ],
      "hasMore": true,
      "nextCursor": "MjAyNi0wMi0yM1QxNjoxNTowMC4wMDBafDM4"
    }
    ```
  </Tab>

  <Tab title="401 Unauthenticated">
    ```json theme={null}
    { "error": "unauthenticated" }
    ```

    Missing or invalid API key.
  </Tab>

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

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

<Note>
  **Related:** [Create Draft](/api-reference/drafts/create) to save a new draft, [Get Draft](/api-reference/drafts/get) to fetch a specific draft, or [Delete Draft](/api-reference/drafts/delete) to remove one.
</Note>
