Skip to content
Content API

Your AI agent pitches in. You hold the key.

A REST API for your whole site, built for agents that make mistakes and retry. With limits you set and a trail of every change.

The interactive API documentation in the back office with the GET /context call expanded and an example response
  • 189

    API operations

    All described in one OpenAPI 3.1 spec. An undocumented route fails the build.

  • 5

    key presets

    From read-only to full project, with draft-only in between.

  • 120

    writes per minute

    Per key, alongside 600 reads. Above that your agent gets a clear Retry-After.

  • 24h

    idempotency

    If your agent resends the same request with the same Idempotency-Key, no duplicate is created.

Safe by design

Agents make mistakes. The API catches them.

Every layer is built for software that retries, guesses and sometimes misreads.

  • One key, one project

    A key belongs to one site and carries an explicit list of rights, with an expiry date if you want one.

  • Presets that fit

    Read-only, draft, publish, media manager or full project. Personal data only in the last one.

  • Publishing stays human

    Without the publish right, everything an agent creates arrives offline. You review it and put it live.

  • Dry run first

    With dryRun=true a change is fully executed and validated, then rolled back. You see the result without risk.

  • No blind overwrites

    Send the ETag in If-Match and a change based on stale content is refused. Your colleagues' work stays intact.

  • Retries without duplicates

    An Idempotency-Key on every create. A repeated request gets the first response back.

  • Every change logged

    Every write lands in the audit log, with the old and new value per field and per language, grouped per agent run.

  • Errors an agent understands

    Stable error codes and every violation in one response, per field. Your agent adjusts its plan instead of guessing.

How an agent works

Discover first, then write.

An agent doesn't need to guess anything. Your site's content model is described by the API itself.

  1. Step 1

    Context

    GET /api/context: which project, which languages, which rights, which modules and which limits.

  2. Step 2

    Schema

    GET /api/website/schema: which blocks are allowed where, with every field described as JSON Schema.

  3. Step 3

    Read

    The page comes back as a tree you can write straight back, with an ETag per block.

  4. Step 4

    Write

    First as a dry run, then for real, with If-Match and an Idempotency-Key. If anything is wrong, you get every error at once and nothing is written.

Try it

Create a key, open the docs, try it out.

A PageSquirrel administrator creates a key for your project, with the preset and expiry date you choose. You see the token once.

  • Swagger UI per project, right in the back office
  • Every call can be tried live, as a dry run too
  • The same spec as a file, a Postman collection and a script
The interactive API documentation in the back office with the GET /context call expanded and an example response
What an agent can do

Your whole site, not just blog posts.

  • Pages and blocks

    Create, fill, sort and move pages, sections and blocks, in every language of your site.

  • Media

    Upload images or import them safely from an https address, with alt text per language.

  • Menus

    Put pages in the main menu, mobile menu or footer, in the right order.

  • Forms

    Change the fields, order and recipients of your forms.

  • Settings

    SEO profile, contact details, cookie banner, Google settings, redirects and languages.

  • Modules

    Blog articles, portfolio, properties and bookings, real estate, products, stock and recipes.

Claude, MCP or your own script.

The API is designed so that a thin tool layer is enough: Claude tools, an MCP server, LangChain or a plain script. Generate them from the OpenAPI spec or start with a handful:

  • get_context and get_schema to discover
  • read_page to read a page with its ETags
  • add_node and patch_node_fields to write
  • upload_image_from_url for images
  • and ?dryRun=true to preview everything first

Every agent's first call: fetch the project context.

curl https://pagesquirrel.com/api/context \
  -H "Authorization: Bearer psq_…" \
  -H "X-Agent-Run-Id: my-run"

Start your agent on a draft-only key. Grant publishing rights only once you trust it.

Tested on ourselves

This site was built by an agent, through the API.

Every page, block, image and menu item on pagesquirrel.com was created through the Content API, by a Claude agent replaying a description of the site.

  • First entirely as a dry run, then for real
  • Every create with an Idempotency-Key, every change with If-Match
  • A second run changes nothing
Terminal output of psq apply: the first run creates 224 items, the second run finds nothing left to change
Questions

What to know before you let an agent loose.

Can an agent break my site?

You decide that with the key. A draft key can't publish or delete anything: everything it creates arrives offline until you put it live. A dry run shows you exactly what would happen beforehand.

Which AI tools does it work with?

With anything that speaks HTTP. Claude with tool use, an MCP server you build on top of the OpenAPI spec, LangChain or your own script. No SDK required.

Who creates the keys?

A PageSquirrel administrator creates the key for your project, with the preset and optional expiry date you choose. A key can never create new keys itself.

Can I undo a change made by an agent?

There is no restore button yet. Every change is in the audit log, though, with the old and new value per field and per language. So you can always see what changed and put it back. That's why we recommend draft-only keys for agents that work on their own.

Can an agent read customer data?

Only with the "full project" preset. Form entries, orders and quote requests are deliberately left out of the read-only, draft and publish presets.

What limits apply?

By default 600 reads and 120 writes per minute per key, images up to 2 MB and 3000 × 3000 pixels (JPEG, PNG or GIF). Every response tells your agent how much headroom is left.

For agencies and developers

See the API live in the back office.

In the demo we create a draft key together and let an agent build a page.