Skip to main content
PATCH
Patch workflow head files

Authorizations

X-Asteroid-Agents-Api-Key
string
header
required

Path Parameters

agentId
string<uuid>
required

The ID of the agent

Body

application/json

The file writes and deletes to apply

Request to patch the editable head's file representation. The server classifies each path: structural files re-derive the structured workflow, the agent's own files (memory, uploads, node scripts) go to their blob store β€” the client just writes files. Rev-guarded by baseRev: a stale value is rejected with 409.

baseRev
integer
required

The revision this edit is based on. The patch only applies when it still matches the stored head revision; otherwise it is rejected with 409.

deletes
string[]
required

Paths of files to delete.

writes
object[]
required

Files to upsert.

Response

The request has succeeded.

A workflow (commit) representing an immutable snapshot of agent configuration

agentId
string<uuid>
required

The agent ID this workflow belongs to

createdAt
string<date-time>
required

When this workflow was created. For the editable head this is restamped on each in-place edit, so it doubles as the last-edited time.

files
object[]
required

The files stored on this workflow version. Empty when the workflow has no files.

graph
object
required

The workflow graph

id
string<uuid>
required

The unique ID of this workflow

inputs
object[]
required

Typed input definitions for workflow execution. Includes names referenced in prompts, which default to optional strings.

isPublished
boolean
required

Whether this snapshot is the agent's published version (the API default). At most one snapshot per agent is published.

rev
integer
required

Monotonic optimistic-concurrency revision. Only meaningful for the editable head: supply it as baseRev on the next head patch; a stale baseRev is rejected with 409. Frozen snapshots never receive in-place patches.

rules
string
required

The rules/instructions for this workflow

settings
object
required

The settings for this workflow

version
integer
required

The monotonic per-agent snapshot version number.

author
string

The email of the user who created this workflow.

environmentTemplate
object

Optional environment template. Defaults to browser/anchor if not provided.

parentId
string<uuid>

The ID of the parent workflow this was derived from (for lineage tracking)