Build
BuildResource
Methods
Submit a container image build from an uploaded build context and return the created build record.
The request is multipart form data: a tar.gz context_archive with the Dockerfile at its root is
streamed to cloud object storage, along with the target image_name, an optional image_tag
(defaults to latest), optional Docker build_args supplied as a JSON string, and an optional
target platform. Exactly one of agent_name or agent_id must be provided: pass agent_name to
create a brand-new agent for a first-time build (rejected if an agent with that name already exists),
or agent_id to build for an agent that already exists. The build is handed to the configured cloud
build provider and runs asynchronously, so the returned record reflects the build's initial status
(typically queued or running) rather than a finished image; poll Get Build or follow Stream Build
Logs to observe progression to a terminal state. The request is rejected if the archive is missing or
empty, exceeds 500MB, or if build_args is not valid JSON.
Retrieve a single build by its ID, including its current lifecycle status.
Because builds run asynchronously after submission, the status returned here reflects the latest known state and may still be queued or running; call this endpoint again to observe progression to a terminal state such as success, failed, cancelled, or timed out. Responds with a not-found error if no such build exists for the caller's account.
List container image build records for the caller's account as a paginated collection.
Each entry is one individual build with its current lifecycle status; pass agent_name,
source_commit, or working_tree_hash to return only matching builds. Archived builds are
excluded, and results are limited to builds the caller is permitted to read. Use this to
enumerate individual builds; to instead list agents that have been built but not yet
deployed, use GET /v5/builds/undeployed.
Filter builds by agent name
Filter builds by source git commit
Filter builds by build-context content hash
The unique identifier of the entity.
The ID of the account that owns the given entity.
The name of the agent that this build belongs to
The current build lifecycle status
The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.
The date and time when the entity was created in ISO format.
The identity that created the entity.
The name of the container image to build.
The tag for the container image.
Git commit the build context was at, when a git work tree.
Whether the work tree had uncommitted changes at build time (null outside git).
Git branch or tag for source_commit, when resolvable.
Normalized git remote the build context came from (host/path, no credentials).
Build-context path relative to the repo root (which agent, in a monorepo).
Deterministic SHA-256 content hash of the build inputs (not the tarball).
The UUID of the agent that this build belongs to
When the cloud provider finished the build
When the cloud provider started the build
The URL of the container image. This is not guaranteed to be present until the build is complete.
Stream a build's logs as Server-Sent Events.
The response has content-type text/event-stream; each event carries one log line as an
AgentexCloudBuildLogLine object, delivered as lines become available from the cloud build provider.
The stream ends when the provider stops producing output. Responds with a not-found error if no such
build exists for the caller's account.
Request cancellation of a build and return 202 Accepted.
Cancellation runs asynchronously: the endpoint verifies the build exists and then hands it off to a background workflow that marks the build as cancelling, asks the cloud build provider to stop it, and polls until the build reaches a terminal state before recording the final status. Only builds that are still queued or running are actually cancelled; if the build has already finished, or cancellation is already in progress, the request is still accepted but has no effect. The returned record reflects the build's state at the time of the call, so it will not yet show the pending cancellation. The request is rejected if no such build exists for the caller's account.
List agents that exist only as cloud builds and have no healthy deployment yet.
Unlike listing builds, this aggregates by agent: it returns one entry per distinct agent name whose
builds have never reached a healthy deploy, each carrying that agent's most recent build and its total
build count. The result is a plain list (not paginated) and is limited to builds the caller is
permitted to read. Use this to surface agents that were built but still need to be deployed; use
GET /v5/builds when you need the individual build records instead.
Domain types
A single log line from the build process.