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

# Fetch Drafts

> Get the authenticated user's draft entities

<Note>
  **Requires the `entities` bundle.** A project without the entities bundle returns `403 database/tables-not-available`. See [Bundles](/v8/bundles).
</Note>

Returns a paginated list of draft entities belonging to the authenticated user. Drafts are invisible to all other users and excluded from all other entity list endpoints until published.

**Authentication required.**

## Query Parameters

<ParamField query="page" type="number" default="1">
  Page number (1-indexed). A whole number of at least `1` — `0`, a negative number or a non-integer value returns `400 entity/invalid-query`.
</ParamField>

<ParamField query="limit" type="number" default="10">
  Number of drafts per page. A whole number of at least `1` — `0`, a negative number or a non-integer value returns `400 entity/invalid-query`. Maximum `100` — larger values are treated as `100`.
</ParamField>

<ParamField query="sourceId" type="string">
  Filter drafts by `sourceId`. Pass `"null"` to return drafts with no `sourceId`.
</ParamField>

<ParamField query="spaceId" type="string">
  Filter drafts by space ID.
</ParamField>

<ParamField query="include" type="string">
  Associations to include. Pass it as one comma-separated value (`include=user,space`) or as repeated params (`include=user&include=space`). Values:

  * `user` — the author's user profile
  * `space` — the space the entity belongs to
  * `files` — uploaded file/image attachments
  * `grants` — the [reputation-grant summary](/v8/data-models/reputation-grant#grantsummary) for the entity

  Values are case-insensitive. Drafts have no comments and aren't saved, so `topComments` and `saved` aren't accepted here: any other value returns `400 entity/invalid-query`.
</ParamField>

## Response

Returns a paginated response:

```json theme={null}
{
  "data": [ ...Entity[] ],
  "pagination": {
    "page": 1,
    "pageSize": 10,
    "totalPages": 1,
    "totalItems": 3,
    "hasMore": false
  }
}
```

Each item is an [Entity](/v8/data-models/entity) with `isDraft: true`. Results are ordered by most recently updated.

## Error Responses

<AccordionGroup>
  <Accordion title="Invalid Query — 400">
    Returned when `page` or `limit` is below `1` or not a whole number, or `include` contains a value that isn't accepted here.

    ```json theme={null}
    { "error": "page: Page must be a positive integer", "code": "entity/invalid-query" }
    ```
  </Accordion>

  <Accordion title="Unauthorized — 401">
    Returned when no user is authenticated.
  </Accordion>
</AccordionGroup>


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