Agent
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
POST | |
GET | |
GET | |
DELETE | |
POST | |
GET | |
POST | |
POST | |
GET | |
GET | |
DELETE | |
POST |
Create agent applications revisions bundle import
Bulk-merge a set of .md files into a draft revision.
Sets agent_md on the draft bundle if present. skills[] are
store-backed and merge by id: an id already referenced by the
draft publishes a new version of its store skill; an unreferenced
id attaches the store skill of that name (publishing the payload's
body to it), or creates it when no such skill exists — and each
ref is (re-)pinned to the published version. Skills not mentioned
are left alone, so the import is safe to retry. Draft-only;
non-draft revisions return 409 untouched.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
Request parameters
- agent_mdstring
- skillsarray
Response
Example request
POST /api /projects /:project_id /agent_applications /:application_id /revisions /:id /bundle /importExample response
Status 200
Status 409 The revision is frozen (ready/live/archived); clone a new draft and edit that instead.
Create agent applications revisions clone from
Copy every file from source_revision_id into this revision.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
Request parameters
- source_revision_idstring
Response
Example request
POST /api /projects /:project_id /agent_applications /:application_id /revisions /:id /clone_fromExample response
Status 200
Create agent applications revisions cron fire
Fire one cron job out-of-band — the same execution path the scheduler walks, but on demand. Authoring UX: the user iterates on a cron prompt by clicking 'Fire now' rather than waiting for the next scheduled firing. Without this, 'did my prompt do the right thing?' is unanswerable until the cron actually fires.
Idempotent via request_id: repeat clicks with the same id resolve
to the same session id rather than firing N times.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
Request parameters
- cron_namestring
- request_idstringnull
Response
Example request
POST /api /projects /:project_id /agent_applications /:application_id /revisions /:id /cron /fireExample response
Status 200 Cron job was fired (or deduped to an existing session).
List all agent revisions env keys
List the names of secrets currently set on this revision.
Returns names only — values stay server-side under
EncryptedTextField. Use this to drive the "set / unset" badge next to
a declared secret in the editor UI.
Required API key scopes
agents:readPath parameters
- application_idstring
- idstring
Response
Example request
GET /api /projects /:project_id /agent_applications /:application_id /revisions /:id /env_keysExample response
Status 200
Retrieve agent revisions env keys
GET / PUT / DELETE one secret by name on this revision.
GET→{ key, is_set }(never returns the value).PUT→ upserts{ value }into the env block.DELETE→ removes the key. No-op when it wasn't set.
Per-method scope: GET is treated as a write action so the single action name maps to one consistent scope; reading whether a secret is set is restricted to writers in any case.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
- keystring
Response
Example request
GET /api /projects /:project_id /agent_applications /:application_id /revisions /:id /env_keys /:keyExample response
Status 200
Delete agent revisions env keys
GET / PUT / DELETE one secret by name on this revision.
GET→{ key, is_set }(never returns the value).PUT→ upserts{ value }into the env block.DELETE→ removes the key. No-op when it wasn't set.
Per-method scope: GET is treated as a write action so the single action name maps to one consistent scope; reading whether a secret is set is restricted to writers in any case.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
- keystring
Example request
DELETE /api /projects /:project_id /agent_applications /:application_id /revisions /:id /env_keys /:keyExample response
Status 204 No response body
Create agent applications revisions freeze
Freeze the bundle: draft → ready, stamps sha256 on the row.
Django is a thin proxy here: resolve template refs into the bundle, ask the janitor to seal it (the janitor returns the sha
- the spec it derived from the typed resources), then stamp the
row. No
transaction.atomic()— the janitor's freeze is idempotent (on retry it re-reads the existing.frozenmarker + re-derives spec), so a partial failure here is recoverable by re-calling freeze, not by transactional rollback. Holding an atomic block across the janitor HTTP call previously deadlocked the agent_revision row against the janitor's spec write — that's moved off the janitor side as part of the same fix.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
Response
Example request
POST /api /projects /:project_id /agent_applications /:application_id /revisions /:id /freezeExample response
Status 200
Retrieve agent applications revisions manifest
List every file in this revision's bundle (path, size, sha256).
Required API key scopes
agents:readPath parameters
- application_idstring
- idstring
Response
Example request
GET /api /projects /:project_id /agent_applications /:application_id /revisions /:id /manifestExample response
Status 200
Create agent applications revisions promote
ready → live. Sets the parent application's live_revision.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
Response
Example request
POST /api /projects /:project_id /agent_applications /:application_id /revisions /:id /promoteExample response
Status 200
Create agent applications revisions set env
Replace this revision's encrypted env block.
The body is { "env": { "<KEY>": "<value>", ... } }. The encrypted
text is stored on AgentRevision.encrypted_env; the worker decrypts it
at session start via the same Fernet schedule (see
agent-shared/src/runtime/encryption.ts).
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
Request parameters
- envobject
Response
Example request
POST /api /projects /:project_id /agent_applications /:application_id /revisions /:id /set_envExample response
Status 200
Retrieve agent applications revisions slack
Build a Slack app manifest for this revision's slack trigger.
Deterministic: the OAuth scopes and bot event subscriptions are derived
from the slack trigger config (mention_only / auto_resume_threads /
ack_reaction) and the agent's Slack tools, so the manifest already
subscribes to exactly the events the config needs. 400 if the revision
has no slack trigger.
Required API key scopes
agents:readPath parameters
- application_idstring
- idstring
Response
Example request
GET /api /projects /:project_id /agent_applications /:application_id /revisions /:id /slack_manifestExample response
Status 200
Retrieve agent applications revisions system
Return the fully-assembled system prompt for this revision.
Authoring tools call this to preview what the model will actually
see at session start — the platform framework preamble plus the
bundle's agent.md plus the skills index. Useful for debugging
author-vs-framework precedence conflicts and verifying
spec.framework_prompt.omit overrides took effect.
Required API key scopes
agents:readPath parameters
- application_idstring
- idstring
Response
Example request
GET /api /projects /:project_id /agent_applications /:application_id /revisions /:id /system_promptExample response
Status 200
Delete agent applications revisions tools
Revisions of an agent. Created in draft, promoted through
ready → live once the bundle has been uploaded + frozen.
URLs (nested under an application):
Model CRUD:
GET .../revisions/ list
POST .../revisions/ create draft
GET .../revisions/<id>/ retrieve
PATCH .../revisions/<id>/ update spec (draft only)
Lifecycle:
POST .../revisions/<id>/promote/ ready → live
POST .../revisions/<id>/archive/ → archived
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
POST .../revisions/<id>/clone_from/ copy bundle from another rev
POST .../revisions/new_draft/ create draft + clone_from atomically
Bundle authoring (proxied to the janitor):
GET .../revisions/<id>/manifest/ list paths + sha256
GET .../revisions/<id>/file/?path=… read one file
PUT .../revisions/<id>/file/?path=… write one file (draft)
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
GET .../revisions/<id>/bundle/ bulk pull all files
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
- tool_idstring
Example request
DELETE /api /projects /:project_id /agent_applications /:application_id /revisions /:id /tools /:tool_idExample response
Status 204 No response body
Create agent applications revisions tools dry run
Execute one persisted custom tool in a single-shot sandbox.
Authoring loop's "test this tool" button. The tool's source must
already be PUT (compiled.js is what runs); this just invokes it
with the caller-supplied args and a stubbed ctx. No real secrets
leave Django — mock_secrets is a {name → placeholder} map.
Required API key scopes
agents:writePath parameters
- application_idstring
- idstring
- tool_idstring
Request parameters
- args
- mock_secretsobject
Response
Example request
POST /api /projects /:project_id /agent_applications /:application_id /revisions /:id /tools /:tool_id /dry_run