Noma

List Collections

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/json

Requires 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:

FieldTypeDescription
uuidstringCollection UUID
namestringDisplay name
slugstringURL-safe identifier
is_singletonbooleanWhether at most one entry is allowed
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp
fieldsarrayField 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.

FieldTypeDescription
idnumberInternal field id
uuidstringField UUID
typestringField type (for example text, group)
labelstringEditor label
namestringAPI / payload key
descriptionstring | nullHelp text
placeholderstring | nullPlaceholder
optionsobjectType-specific options
validationsobjectValidation rules
ordernumberSort order among siblings
parent_field_idnumber | nullParent 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

StatusWhen
400Missing project-id or project cannot be resolved (see Authentication)
401Missing or invalid bearer token
403Token does not have read (or *)
404No project with that UUID
429Rate 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
end
import 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())
  • 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

Search documentation

Find guides and reference pages