List Collections
Returns every collection in the project as a JSON array. Each item includes field definitions (same payload shape as Get a Collection), ordered by each collection's order value (dashboard order).
Request
GET /api/collections HTTP/1.1
Host: app.nomacms.com
project-id: <project-uuid>
Authorization: Bearer <api-token>
Accept: application/jsonRequires the read ability on the token.
Query parameters
None.
Response (200)
JSON array of collection objects. Empty array if the project has no collections.
Each object includes:
| Field | Type | Description |
|---|---|---|
uuid | string | Collection UUID |
name | string | Display name |
slug | string | URL-safe identifier |
is_singleton | boolean | Whether at most one entry is allowed |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
fields | array | Field definitions for this collection (see below) |
fields array
Each element is one field. Top-level fields appear in order; nested fields from group types are included in the same list (flattened), with parent_field_id pointing at the parent field.
| Field | Type | Description |
|---|---|---|
id | number | Internal field id |
uuid | string | Field UUID |
type | string | Field type (for example text, group) |
label | string | Editor label |
name | string | API / payload key |
description | string | null | Help text |
placeholder | string | null | Placeholder |
options | object | Type-specific options |
validations | object | Validation rules |
order | number | Sort order among siblings |
parent_field_id | number | null | Parent field id when nested under a group |
To fetch only project metadata and optionally collections without hitting this route, use Get Project with with=collections or with=collections,fields. Listing collections via GET /api/collections always returns full field definitions for every collection in one response.
Errors
| Status | When |
|---|---|
| 400 | Missing project-id or project cannot be resolved (see Authentication) |
| 401 | Missing or invalid bearer token |
| 403 | Token does not have read (or *) |
| 404 | No project with that UUID |
| 429 | Rate limited |
Example
import { createClient } from "@nomacms/js-sdk"
const client = createClient({
projectId: process.env.NOMA_PROJECT_ID!,
apiKey: process.env.NOMA_API_KEY!,
})
const collections = await client.collections.list()
console.log(collections)import axios from "axios"
async function main() {
const { data } = await axios.get("https://app.nomacms.com/api/collections", {
headers: {
"project-id": process.env.NOMA_PROJECT_ID!,
Authorization: `Bearer ${process.env.NOMA_API_KEY}`,
Accept: "application/json",
},
})
console.log(data)
}
void main()<?php
$ch = curl_init('https://app.nomacms.com/api/collections');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => [
'project-id: ' . getenv('NOMA_PROJECT_ID'),
'Authorization: Bearer ' . getenv('NOMA_API_KEY'),
'Accept: application/json',
],
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);curl -sS \
-H "project-id: $NOMA_PROJECT_ID" \
-H "Authorization: Bearer $NOMA_API_KEY" \
-H "Accept: application/json" \
"https://app.nomacms.com/api/collections"package main
import (
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://app.nomacms.com/api/collections", nil)
if err != nil {
panic(err)
}
req.Header.Set("project-id", os.Getenv("NOMA_PROJECT_ID"))
req.Header.Set("Authorization", "Bearer "+os.Getenv("NOMA_API_KEY"))
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
_, _ = io.Copy(os.Stdout, res.Body)
}require "net/http"
require "uri"
uri = URI("https://app.nomacms.com/api/collections")
req = Net::HTTP::Get.new(uri)
req["project-id"] = ENV.fetch("NOMA_PROJECT_ID")
req["Authorization"] = "Bearer #{ENV.fetch('NOMA_API_KEY')}"
req["Accept"] = "application/json"
Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
puts http.request(req).body
endimport os
import urllib.request
url = "https://app.nomacms.com/api/collections"
req = urllib.request.Request(
url,
headers={
"project-id": os.environ["NOMA_PROJECT_ID"],
"Authorization": f"Bearer {os.environ['NOMA_API_KEY']}",
"Accept": "application/json",
},
)
with urllib.request.urlopen(req) as res:
print(res.read().decode())Related
- Authentication - Headers and abilities
- Get Project - Project metadata and optional
with=collections,fields - Get a Collection - One collection by slug (same response shape as one element here)
- JavaScript SDK -
collections.list