Skip to content

Listing Collections

Auth required: Authorization: <main_api_key> header.

Returns a list of all collections with their names and ID types.

Example

js
const { collections } = await client.listCollections();
// [{ name: "posts", id_type: "number" }, { name: "comments", id_type: "string" }]
js
const res = await fetch("http://localhost:3000/collections", {
  headers: { Authorization: "SecretApiKey" },
});
const { collections } = await res.json();
sh
# GET /collections
#
# Response: 200 OK
# {
#   "collections": [
#     {
#       "name": "posts",
#       "id_type": "number"
#     },
#     {
#       "name": "comments",
#       "id_type": "string"
#     }
#   ]
# }

curl http://localhost:3000/collections \
  -H "Authorization: SecretApiKey"

Endpoint Definition

FieldValue
MethodGET
Path/collections

Response Body

FieldTypeDescription
collectionsarrayList of collections
collections[].namestringCollection name
collections[].id_typestring"number" or "string"

Response: 200 OK