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

# Get bookmark folders

> List bookmark folders from the authenticated X account

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

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

<Note>
  Requires a connected X account. Use folder IDs from this response with
  `GET /x/bookmarks?folderId=...` to read tweets saved inside a folder.
</Note>

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

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/x/bookmarks/folders", {
    headers: { "x-api-key": "xq_YOUR_KEY_HERE" },
  });
  const data = await response.json();
  const folderRows = data.folders.map((folder) => ({
    folder_id: folder.id,
    folder_name: folder.name,
    bookmarks_endpoint: `/x/bookmarks?folderId=${encodeURIComponent(folder.id)}`,
    has_more_folders: data.has_next_page,
  }));

  for (const row of folderRows) {
    process.stdout.write(`${JSON.stringify(row)}\n`);
  }
  ```

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

  response = requests.get(
      "https://xquik.com/api/v1/x/bookmarks/folders",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  data = response.json()
  folder_rows = [
      {
          "folder_id": folder["id"],
          "folder_name": folder["name"],
          "bookmarks_endpoint": f"/x/bookmarks?folderId={folder['id']}",
          "has_more_folders": data["has_next_page"],
      }
      for folder in data["folders"]
  ]

  for row in folder_rows:
      print(json.dumps(row))
  ```
</CodeGroup>

The Node.js and Python snippets shape durable bookmark folder rows instead of
printing the full response page. Persist `folderRows` or `folder_rows` so a
worker can pass `folder_id` into `GET /x/bookmarks?folderId=...`.

## Direct bookmark folder handoff

Use `GET /x/bookmarks/folders` when a saved-tweet workflow, CRM enrichment job,
research queue, or agent needs the current bookmark folder IDs for the
authenticated X account.

Store `folder_id` and `folder_name`. The current route returns one folder page
with `has_next_page: false` and `next_cursor: ""`; use each `folder_id` with
[Bookmarks](/api-reference/x/bookmarks) to fetch the saved tweets inside that
folder.

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key. Session cookie authentication is also supported.
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="folders" type="object[]">
      Array of bookmark folders.

      <Expandable title="folder object">
        <ResponseField name="id" type="string">Folder ID.</ResponseField>
        <ResponseField name="name" type="string">Folder name.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="has_next_page" type="boolean">
      Always `false` for the current bookmark folder route.
    </ResponseField>

    <ResponseField name="next_cursor" type="string">
      Always an empty string for the current bookmark folder route.
    </ResponseField>

    ```json theme={null}
    {
      "folders": [
        { "id": "1234567890", "name": "Tech" },
        { "id": "1234567891", "name": "Design" }
      ],
      "has_next_page": false,
      "next_cursor": ""
    }
    ```
  </Tab>

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

    Missing or invalid API key.
  </Tab>

  <Tab title="402 Subscription required">
    ```json theme={null}
    { "error": "no_subscription" }
    ```

    No active subscription or insufficient credits. Possible error values: `no_subscription`, `subscription_inactive`, `no_credits`, `insufficient_credits`.
  </Tab>

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

    The API key, user, or plan tier is sending requests too quickly. Respect the `Retry-After` header before retrying.
  </Tab>

  <Tab title="502 X API unavailable">
    ```json theme={null}
    { "error": "x_api_unavailable" }
    ```

    The read service returned an error. Retry after a short delay.
  </Tab>

  <Tab title="424 Dependency Failed">
    ```json theme={null}
    { "error": "x_api_unavailable" }
    ```

    Returned when you opt into the normalized v1 response contract and the read service is unavailable.
  </Tab>
</Tabs>

<Note>
  **Related:** [Bookmarks](/api-reference/x/bookmarks) · [Timeline](/api-reference/x/timeline)
</Note>
