Only available on hosted Pages CMS.

The REST API lets scripts and services do what an editor can do in Pages CMS: list and edit content, upload media and run actions, with the same permissions. It lives at https://app.pagescms.org/api/v1. For AI assistants, use MCP instead; it exposes the same operations as tools.

Connect

  1. Open Account → Personal access tokens and create a token.
  2. Choose its scopes and expiry, and optionally limit it to specific repositories.
  3. Copy the token. It's shown only once.

Send it as a bearer token. Never put it in a URL.

export API="https://app.pagescms.org/api/v1"
export PAGESCMS_TOKEN="..."

curl "$API/repositories?query=acme/docs" \
  -H "Authorization: Bearer $PAGESCMS_TOKEN"

REST and MCP check the deployment’s email allowlist on each request. If an account is excluded, its credentials cannot be used while that restriction applies.

Revoke tokens under Account → Personal access tokens, and OAuth apps under Account → Connected applications. Revoking stops future requests; it doesn't undo completed ones.

Start with discovery

Use a known repository ID directly, or search for up to five accessible Pages CMS projects. Use a repository name for partial matches or owner/name for an exact lookup. An empty search is rejected.

# 1. Find the repository ID (the GitHub repository ID, as a string)
curl "$API/repositories?query=acme/docs" -H "Authorization: Bearer $PAGESCMS_TOKEN"

# 2. List branches
curl $API/repositories/123/branches -H "Authorization: Bearer $PAGESCMS_TOKEN"

# 3. Read the content model: collections, files, media, actions and their fields
curl $API/repositories/123/branches/main/model -H "Authorization: Bearer $PAGESCMS_TOKEN"

URL-encode branch names as one path segment (feature/docs → feature%2Fdocs) and file paths in query strings. Paths are repository-relative, without . or .. segments.

Endpoints

Paths are relative to /api/v1. {b} stands for repositories/{repository}/branches/{branch}.

Endpoint Scope Input Returns
GET /repositories?query=docs read Required repository name or owner/name items: id, source, owner, name
GET /repositories/{repository}/branches read — items: name (up to 1,000)
GET /{b}/model read — collections, files, media, actions, i18n
GET /{b}/usage read — used, limit, resetsAt, readOnly, allowActions
Collections
GET /{b}/collections/{collection}/entries read Query: path, locale, limit, cursor items, nextCursor
GET /{b}/collections/{collection}/entry read Query: path path, revision, source, content, locale
GET /{b}/collections/{collection}/entry/translations read Query: path items with locale, path, exists, revision
POST /{b}/collections/{collection}/entries write source or content; parent, filename, locale, message path, revision, commit
PUT /{b}/collections/{collection}/entry write Query: path. Body: revision, source or content, message path, revision, commit
DELETE /{b}/collections/{collection}/entry write Query: path, revision path, commit
POST /{b}/collections/{collection}/entry/move write Query: path. Body: newPath, revision path, newPath, revision, commit
Files
GET /{b}/files/{file} read Query: locale path, revision, source, content
PUT /{b}/files/{file} write revision (null to create), source or content, locale, message path, revision, commit
Media
GET /{b}/media/{media}/files read Query: path, limit, cursor items with revision, size, contentType; nextCursor
GET /{b}/media/{media}/file read Query: path path, url, expiresAt
POST /{b}/media/{media}/files write filename, content (base64), path, rename path, revision, commit
DELETE /{b}/media/{media}/file write Query: path, revision path, commit
Actions
GET /{b}/actions read — actions, runs
GET /{b}/actions/runs read Query: ids (comma-separated, up to 50) runs
POST /{b}/actions/{action}/runs actions:run inputs, context id, runId, status

{collection}, {file}, {media} and {action} are the names from .pages.yml. Writes accept JSON bodies; GET and DELETE take query parameters. Unknown fields are rejected.

Find translations

List a collection with ?locale=fr to see French entries in a file-per-language collection, or French field values when translations share one file. Omit locale to use the configured default. Keep the same locale when following a pagination cursor.

For a file-per-language collection, pass an entry’s repository-relative path to look up its translations:

curl "$API/repositories/123/branches/main/collections/posts/entry/translations?path=content%2Fposts%2Fhello.en.md" \
  -H "Authorization: Bearer $PAGESCMS_TOKEN"

The response lists each configured locale in order, including its expected path. Missing translations have exists: false and revision: null. You need read access to every translated path. Collections with shared-file translations or no localization return an empty items array.

Writing content

Read before you write: updates, moves and deletes need the current revision, which makes concurrent edits fail with 409 conflict instead of overwriting each other.

curl -X PUT "$API/repositories/123/branches/main/collections/posts/entry?path=content%2Fposts%2Fhello.md" \
  -H "Authorization: Bearer $PAGESCMS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: update-hello-2026-11-01" \
  --data '{"revision":"0123456789abcdef0123456789abcdef01234567","content":{"title":"Hello"}}'
  • Send either content, structured fields matching the model, or source, the raw file text, up to 5 MiB.
  • Creates and uploads fail if the destination already exists.
  • Media uploads are one file up to 4 MiB, base64 without a data: prefix. Delete media with the revision from a listing or upload; reading a media file doesn't return one.
  • PUT /files/{file} with "revision": null creates a configured file that doesn't exist yet.

Idempotency and retries

Every write needs an Idempotency-Key header: 8–200 letters, digits, ., _, : or -. To retry a write, resend it with the same key and the same body. You'll get the original result, with Idempotent-Replayed: true, and it won't count twice. Keys last 24 hours.

If a request is interrupted, its outcome can be unknown: the response is operation_in_progress or operation_outcome_unknown. Don't blindly retry with a new key. Read the current state first, then decide whether to submit a new change.

Permissions and controls

A token acts as its owner and can never do more than its owner can in Pages CMS, including any role restrictions. Scopes narrow it further:

  • read: repositories, branches, the model, content, media and actions
  • write: creating, updating, moving and deleting content and media
  • actions:run: running actions

The API can't edit configuration, create branches, manage collaborators, roles or billing, or read files outside what .pages.yml exposes.

Managers control API and MCP access per repository under API & MCP:

  • Access: everyone with access, managers only, or off.
  • Read-only: blocks all writes and actions through the API and MCP.
  • Allow action execution: turns running actions on or off.

These apply to every token, managers' included, and don't affect editing in Pages CMS.

Usage limits

Each repository has a monthly allowance shared by every user, token, branch, REST call and MCP tool call: 1,000 operations on Free and 100,000 on Pro. It resets at the start of each UTC month, and usage is shown under API & MCP and by GET /{b}/usage.

A read, model request, write or upload counts as one operation. Discovering repositories, checking usage or run status, and idempotent replays are free. Invalid or unauthorized requests don't count. Rate limits also apply; a 429 response includes Retry-After when available. Editing in Pages CMS never counts.

Pagination

Lists take limit (default 50, max 200) and return nextCursor; pass it back as cursor until it's null. Pages reflect live data, so changes between requests can shift results.

Errors

Errors return { "error": { "code", "message", "requestId", "details" } }. Every response includes X-Request-Id.

Status Codes
400 invalid_request, invalid_cursor, idempotency_key_required
401 invalid_token
403 insufficient_scope, forbidden, integrations_disabled, managers_only, repository_read_only, action_execution_disabled, feature_unavailable
404 repository_not_found, not_found, unknown_operation
405 invalid_request (unsupported method)
409 conflict, busy, operation_in_progress, operation_outcome_unknown
413 invalid_request (body too large)
422 idempotency_key_reused, configuration_invalid
429 rate_limited, quota_exceeded
500 internal_error
503 upstream_unavailable, operation_outcome_unknown

OAuth

Apps that act on behalf of other users should use OAuth instead of personal tokens. Discover the endpoints from the protected resource metadata at /.well-known/oauth-protected-resource/api/v1, and request tokens for the /api/v1 resource. Unauthenticated responses include a WWW-Authenticate header pointing there.