Skip to content

Postman / API collection

A ready-to-run Postman collection covering every cms-api endpoint -- the admin block (/admin/v1), the auth routes, and the worker-facing public v2 block (/public/v2) -- ships in the repo at:

postman/cms-api.postman_collection.json

It is a Collection v2.1 file with 20 folders and 133 requests, each carrying a realistic example payload so it works as import-and-run, not just a route index.

The two auth schemes

Both blocks authenticate with Authorization: Bearer <token>, but the token differs, so the collection uses two auth scopes:

  • Admin (/admin/v1) -- a JWT minted by POST /admin/v1/auth/login (OAuth2 password grant, application/x-www-form-urlencoded). The collection's top-level auth is Bearer {{token}}, so every admin request inherits it.
  • Public v2 (/public/v2) -- a static worker API key. The Public v2 folder overrides the collection auth to send Bearer {{worker_key}} instead.

Run Auth > Login first. Its test script parses the response and writes access_token into the token collection variable (and refresh_token into refresh_token), so the rest of the admin requests are authorized automatically.

Collection variables

Set these in the collection's Variables tab (or an environment) before running. admin_password and worker_key are intentionally blank -- fill them from your own credentials, never commit them.

Variable Example Purpose
base_url http://cms-api-stg.skyneto.com API host (no trailing slash).
admin_email admin@example.com Login username (OAuth2 username).
admin_password (blank) Login password.
worker_key (blank) Worker API key for /public/v2.
site_acronym FRDEV A site acronym for {site}-keyed reads.
site_id 207 A site id for {site_id}-keyed routes.
token (auto) Access JWT, populated by the Login test script.
refresh_token (auto) Refresh JWT, populated by Login.

Folders

Folder Requests Covers
Auth 4 login, refresh, me, logout
Sites 5 list/get/create/update, PATCH /{id}/template-style (template_style_id)
Settings 4 site + global settings (navigation, ads_txt, robots_txt)
Taxonomy (categories) 4 list/create/patch/delete site categories
Content 11 list (filters + search), get, create draft, patch (status + SEO), update, duplicate, children, slug check, invalid-blocks 422 example (AISD-205), regeneration candidates -- staleness + provenance filters with response assertions (AISD-291)
Content Types 2 list active content_types lookup (AISD-106) + stored block schema (AISD-205; see Block schemas)
Templates and Blocks 11 templates, template blocks, site block overrides
Styles 5 list/get/create/update/soft-delete
Page types 5 list/get/create/patch/delete
Authors 4 list/get/create/patch
Media 1 presigned S3 upload URL (see Media upload)
Users 8 users + per-site memberships
Websites (init) 1 one-call site + Cloudflare provisioning
Public v2 (worker key) 9 settings, lists, pages, authors, sitemap, template/style CSS, ping
Purge (cache invalidation) 6 site, page-type, path, article, and global purges (AISD-244; see Cache and purge)

Environments

Three ready-made Postman environments ship alongside the collection so you can switch hosts without editing variables:

Environment File domain
Local postman/cms-api-local.postman_environment.json http://localhost:8000
Stage postman/cms-api-stg.postman_environment.json http://cms-api-stg.skyneto.com
Prod postman/cms-api-prd.postman_environment.json (prod host)

Their admin-password / authToken / worker_api_key values are intentionally blank (secret-typed) -- fill them in Postman, never commit them.

Importing

  1. In Postman: Import -> File -> pick docs/postman/cms-api.postman_collection.json (and, optionally, one of the docs/postman/cms-api-*.postman_environment.json environments above).
  2. Open the collection's Variables tab (or select an environment) and set base_url, admin_email, admin_password, worker_key, site_acronym, site_id.
  3. Run Auth > Login once to populate token.
  4. Run any admin request; run Public v2 requests once worker_key is set.

The collection is also runnable headless with the Postman CLI or newman:

newman run docs/postman/cms-api.postman_collection.json \
  --env-var base_url=http://cms-api-stg.skyneto.com \
  --env-var admin_email=... --env-var admin_password=... \
  --env-var worker_key=... --env-var site_id=207 --env-var site_acronym=FRDEV

Keeping it in sync

The collection is hand-maintained alongside the OpenAPI specs (openapi-admin.yaml, openapi-public.yaml). When a route or payload changes, update the matching request here too.