The published documents of a collection, newest first
const url = 'http://localhost:3000/api/v1/collections/example/documents?limit=20&sort=-publishedDate';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:3000/api/v1/collections/example/documents?limit=20&sort=-publishedDate'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”The nextCursor of the previous page. Opaque.
Only the documents with this tag in a tags field.
publishedAt or a simple field (text, textarea, slug, date, number, select, boolean).
A leading - reverses the order. Default: the order of the collection.
Responses
Section titled “Responses”One page of documents.
object
object
The URL of the document on the site.
The published version. Null in a preview.
The field values. A media field is a Media object or null. A richText field is the
TipTap JSON plus html, the sanitized HTML, or null. A blocks field is a list of objects with _id, _type and
the block fields. A relation field is a RelatedDocument or null, or with multiple a list of RelatedDocument:
published targets only.
object
The number of documents that match, on all pages.
Example generated
{ "documents": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "collection": "example", "slug": "example", "path": "example", "versionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "publishedAt": "2026-04-15T12:00:00Z", "data": {} } ], "total": 1, "nextCursor": "example"}Headers
Section titled “Headers”Send it back in If-None-Match to get a 304.
The ETag in If-None-Match is current. No body.
A query parameter is not valid.
object
Example
{ "error": "bad_request"}No such collection, published document or media.
object
Example
{ "error": "bad_request"}Too many requests from this address.
object
Example
{ "error": "bad_request"}