Skip to main content

GET /api/data/:collectionName

Returns a list of documents from the specified collection. Supports pagination, sorting, and field-level filtering via query parameters.
/api/data/users* is blocked for all keys. Use /api/userAuth/* for user management.

Required header

x-api-key: your pk_live_… or sk_live_… key.

Path parameters

string
required
The name of the collection to query (e.g., posts, comments, inventory).

Query parameters

number
Page number for pagination. Defaults to 1.
number
Number of documents per page. Defaults to 20.
string
Field to sort by. Prefix with - for descending order (e.g., sort=-createdAt for newest first, sort=title for ascending alphabetical).
string
Filter documents by field value. Append an operator suffix to the field name for comparisons (e.g., _gt, _lt, _ne, _in, _regex). For exact matches, use the field name without a suffix. Example: status=published&views_gt=100
boolean
Setting include_deleted to true includes soft-deleted documents; it defaults to false

RLS behavior

If the collection has RLS enabled:
  • public-read mode: anyone can read all documents with a valid x-api-key.
  • private mode: requires Authorization: Bearer <accessToken> — only the owner’s documents are returned.

Response fields

boolean
true when the request succeeded.
object
Object containing the results and pagination metadata.
string
Human-readable status message.

Code examples

Success response

Errors