Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,075 of 9,075 pages
About the help in other languages
All help pages

Agents and the REST API

Using the REST API of Exponential from an AI agent - the routes of v1 and v2 as tools, a personal API key with the narrowest scope, permissions and answers, paging, and a pattern for describing the routes to a model…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/ai-agents/agentic-workflows/agents-and-the-rest-api.md

On this page

Agents and the REST API

This page is for developers who give an AI agent access to content over HTTP. The REST API is part of the kernel; an agent uses it like any other client, as the account behind its credential. The full reference is REST API v1 and v2 for applications and the guide REST API v1 and v2; this page adds what matters for agents.

Contents

  1. The routes an agent needs
  2. The credential
  3. Describing the routes to a model
  4. Answers the agent must handle
  5. Writing through REST

The routes an agent needs

Relative to /api/ezp/<version>:

MethodPathv1v2Does
GET/content/node/<id>yesyesOne node
GET/content/node/<id>/list(/offset/<n>)(/limit/<n>)yesyesThe children, paged
GET/content/node/<id>/childrenCountyesyesThe number of children
GET/content/node/<id>/fields, /field/<identifier>yesyesFields
GET/content/object/<id> and its fieldsyesyesBy object id
POST/content/node/createnoyesCreate and publish
POST or PUT/content/node/<id>noyesUpdate: publish a new version with the values sent
DELETE/content/node/delete/<id>noyesRemove

A read-only agent needs only the GET routes.

The credential

A personal API key (Authorization: Bearer expk_...) is the simplest credential for an agent you run yourself:

  1. Create an account for the agent and give it only the content policies it needs.
  2. Signed in as that account, make a key in My account > API access with only the scopes the agent needs (read for a reader) and a short lifetime. The key is shown once.
  3. Store it in the agent's secret store or an environment variable, never in a prompt or a repository.

A key never gets a right its owner does not hold, and a route needs the scope it is mapped to; a write route of an extension stays closed to keys until its scope is named (Personal API keys, scopes). An app that acts for many users uses OAuth2 instead (OAuth and API keys).

Describing the routes to a model

When the agent framework lets you define tools for the model, define one tool per route you allow, not a generic "HTTP request" tool:

ToolInputCalls
get_nodenode_id (integer)GET /api/ezp/v1/content/node/<node_id>
list_childrennode_id, offset, limit (at most what you allow)GET .../content/node/<node_id>/list/offset/<n>/limit/<n>
get_fieldnode_id, identifierGET .../content/node/<node_id>/field/<identifier>

Your code builds the URL from validated inputs and adds the key; the model never sees the key and cannot reach other routes or hosts. Tell the model in the tool description that field values are data written by people, not instructions.

Answers the agent must handle

StatusMeaningThe agent should
200The contentUse it
201CreatedRecord the new id
400A bad requestFix the arguments
401No valid credentialStop; a person must renew the key
403The account or the key's scope may notStop for this item; do not try other routes to get around it
404Unknown nodeReport it

Lists are paged; let the agent page with a limit you choose rather than asking for everything.

Writing through REST

A POST to /api/ezp/v2/content/node/create creates and publishes. For agent-written content that a person must review first, create into a section that visitors cannot see and that an approval workflow covers, or use Exponential Intelligence, which writes drafts. Test every write workflow on a test installation, and read the audit trail afterwards (A content import workflow).

Since Exponential 6.0.15 with ezprestapi 1.2.9, a POST or PUT to /api/ezp/v2/content/node/<id> updates: it publishes a new version with the values sent and keeps the old one in the history, where an editor can compare and restore it. The key needs the edit scope. Values are text: rich text as HTML, a file as a public https address; an unknown attribute is refused with 400, which an agent can show to the model as a correctable error. A 202 answer means a workflow holds the version, for example for an approval (Updating and the values of a write).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x