---
title: "Read next batch from cursor"
method: PUT
path: "/_fabric/{fabric}/_api/restql/fetch/{id}"
tags: ["Query Workers"]
---

# Read next batch from cursor

`PUT /_fabric/{fabric}/_api/restql/fetch/{id}`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/restql/fetch/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

If the query worker cursor is still valid, returns an object with the following attributes:

- *id*: the *cursor-identifier*
- *result*: a list of documents for the current batch
- *hasMore*: *false* if this was the last batch
- *count*: if present the total number of elements

If *hasMore* returns *true*, the next call might still return no documents. If *hasMore* is *false*, the cursor is exhausted. Once the *hasMore* attribute has a value of *false*, the client can stop.

## Path parameters

- `fabric` string, string, required
- `id` string, string, required

## Response `200`

Successfully fetched the next batch of records.

- QueryWorkersPostRestqlExecuteRc200
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `hasMore` boolean
  - `id` integer
  - `cached` boolean
  - `extra` object
    - `stats` unknown[]
      - unknown
    - `warnings` unknown[]
      - unknown
  - `result` ExamplesIdKeyRevData[]
    - `_id` string: ID of the collection.
    - `_key` string: _key details of collection.
    - `_rev` string: _rev details of collection.
    - `data` string: data in record.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `404`: Failed to find specified query.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
