GET /api/data/:collectionName
Returns a list of documents from the specified collection. Supports pagination, sorting, and field-level filtering via query parameters.
Required Header
x-api-key: your pk_live_… or sk_live_… key.
Path Parameters
The name of the collection to query (e.g.,
posts, comments, inventory).Query Parameters
Page number for pagination. Defaults to
1.Number of documents per page. Defaults to
20.Field to sort by. Prefix with
- for descending order (e.g., sort=-createdAt for newest
first, sort=title for ascending alphabetical).Filter documents by field value. Replace
field with the document field name and op with
a comparison operator. Example: filter[status][eq]=published&filter[views][gt]=100RLS Behavior
If the collection has RLS enabled:public-readmode: anyone can read all documents with a validx-api-key.privatemode: requiresAuthorization: Bearer <accessToken>— only the owner’s documents are returned.
Response Fields
true when the request succeeded.Array of document objects matching the query. Each document includes its
_id and all stored fields.Human-readable status message.
Code Examples
Success Response
Errors
| Status | Cause |
|---|---|
401 Unauthorized | Missing/invalid API key, or missing Bearer token on a private collection |
403 Forbidden | pk_live write attempt without RLS, or quota exceeded |
404 Not Found | Collection does not exist |
