Noma

List Entries

List Entries

Returns content entries for a collection, with optional filters, sorting, and pagination. Routes are scoped by collection slug in the path: GET /api/{collection}.

Singleton collections (is_singleton: true) use a different response shape: see Singleton collections below.

Request

GET /api/{collection} HTTP/1.1
Host: app.nomacms.com
project-id: <project-uuid>
Authorization: Bearer <api-token>
Accept: application/json

Replace {collection} with the collection slug (for example blog-posts).

Requires the read ability on the token.

Path parameters

ParamDescription
collectionCollection slug

Query parameters

ParamDescription
statedraft or published. Invalid values are treated as published. Default published.
localeFilter to this locale string. For singleton collections, if omitted and the project has default_locale, the list query uses default_locale.
excludeComma-separated field names to omit from each entry’s fields object (smaller payloads).
whereStructured filters on core columns and custom fields. See Advanced filtering.
sortComma-separated sort keys. Each key is column:ASC or column:DESC (case-insensitive direction). Core columns: id, created_at, updated_at, published_at. Custom field names are supported; with paginate, sorting uses the database (stable tie-break on content_entries.id). Without paginate, a single custom-field sort may be applied in memory after fetch.
limitMax rows when not using paginate.
offsetSkip rows; only applied when limit is set.
paginatePage size. When set, the response is paginated (Laravel pagination JSON with data, links, meta). Use with page.
pagePage number when paginate is set.
countIf present (any value), the response is { "count": <number> } for the current filters instead of a list.
firstIf present, the response is a single entry object (first row). Ignored for singleton collections (they already return one object).
timestampsIf present, each entry includes created_at and updated_at (ISO 8601).

Default ordering when sort is omitted: id descending.

Response (200)

Non-singleton collections

Without paginate

JSON array of entry objects (see Entry object shape).

With paginate

JSON object in Laravel’s pagination format: data (array of entries), plus links and meta (current_page, last_page, per_page, total, and so on).

Singleton collections

JSON object: one entry, or 404 if no row matches filters (Content not found.). Not an array and not paginated.

Entry object shape

Each entry matches ContentEntryResource:

FieldTypeDescription
uuidstringEntry UUID
localestringLocale code
published_atstring | nullISO 8601 timestamp
fieldsobjectValues keyed by field name (respects exclude and fields with hiddenInAPI; password values are omitted)
created_atstringPresent only when timestamps is set
updated_atstringPresent only when timestamps is set

The state (draft / published) is not included in the JSON body; use the state query parameter when listing to choose which revision to return.

Errors

StatusWhen
400Missing project-id or project cannot be resolved (see Authentication)
401Missing or invalid bearer token
403Token does not have read (or *)
404Unknown collection slug, no project with that UUID, or singleton with no matching entry
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 result = await client.content.list("blog-posts", {
  state: "published",
  locale: "en",
  sort: "created_at:DESC",
  paginate: 20,
  page: 1,
})
 
console.log(result)
import axios from "axios"
 
async function main() {
  const { data } = await axios.get("https://app.nomacms.com/api/blog-posts", {
    params: {
      state: "published",
      locale: "en",
      sort: "created_at:DESC",
      paginate: 20,
      page: 1,
    },
    headers: {
      "project-id": process.env.NOMA_PROJECT_ID!,
      Authorization: `Bearer ${process.env.NOMA_API_KEY}`,
      Accept: "application/json",
    },
  })
  console.log(data)
}
 
void main()
<?php
 
$query = http_build_query([
    'state' => 'published',
    'locale' => 'en',
    'sort' => 'created_at:DESC',
    'paginate' => '20',
    'page' => '1',
]);
$url = 'https://app.nomacms.com/api/blog-posts?' . $query;
$ch = curl_init($url);
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 -G "https://app.nomacms.com/api/blog-posts" \
  --data-urlencode "state=published" \
  --data-urlencode "locale=en" \
  --data-urlencode "sort=created_at:DESC" \
  --data-urlencode "paginate=20" \
  --data-urlencode "page=1" \
  -H "project-id: $NOMA_PROJECT_ID" \
  -H "Authorization: Bearer $NOMA_API_KEY" \
  -H "Accept: application/json"
package main
 
import (
	"io"
	"net/http"
	"net/url"
	"os"
)
 
func main() {
	base, err := url.Parse("https://app.nomacms.com/api/blog-posts")
	if err != nil {
		panic(err)
	}
	q := base.Query()
	q.Set("state", "published")
	q.Set("locale", "en")
	q.Set("sort", "created_at:DESC")
	q.Set("paginate", "20")
	q.Set("page", "1")
	base.RawQuery = q.Encode()
 
	req, err := http.NewRequest("GET", base.String(), 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/blog-posts")
uri.query = URI.encode_www_form(
  "state" => "published",
  "locale" => "en",
  "sort" => "created_at:DESC",
  "paginate" => "20",
  "page" => "1"
)
 
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.parse
import urllib.request
 
params = {
    "state": "published",
    "locale": "en",
    "sort": "created_at:DESC",
    "paginate": "20",
    "page": "1",
}
query = urllib.parse.urlencode(params)
url = f"https://app.nomacms.com/api/blog-posts?{query}"
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 an Entry - Single entry by UUID
  • Advanced filtering - where operators
  • JavaScript SDK - content.list

Search documentation

Find guides and reference pages