> ## Documentation Index
> Fetch the complete documentation index at: https://www.agent37.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Templates

> Name an image once, then create every instance from that name.

A template is a named image, plus (optionally) the port its main service listens on. Instances are always created from template names: pass `template` on [`POST /v1/instances`](https://www.agent37.com/docs/agents-api/instances), or omit it for the default `agent37-base`. Direct image references are rejected with `400 invalid_request`; register a template first, then pass its name.

```bash curl wrap theme={null}
curl -X POST https://api.agent37.com/v1/instances \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "template": "agent37-hermes" }'
```

Templates come in two scopes. `system` templates are the built-in catalog, the same for every workspace and read-only. `workspace` templates are ones you register from your own image, either a registry reference (public, or private with `registry_auth`) or a [cloud build](https://www.agent37.com/docs/agents-api/custom-image.md#build-it-in-the-cloud), and they are visible only to your workspace unless you [make one public](#share-a-template-with-other-workspaces).

> [!NOTE]
>
> Registering a workspace template copies your image once into private storage and pins it by digest. That snapshot is what instances run: registration takes up to a few minutes for a large image, the image is stored privately and never republished, and re-pushing the same registry tag later has no effect until you [update the template](#update-a-template).

## System catalog

The `agent37-` prefix is reserved for system templates. The available templates are:

| Template | What it runs |
| - | - |
| `agent37-base` | A plain Linux sandbox: Node, Python, git, build tools, and a terminal. No agent. The default. |
| `agent37-hermes` | Hermes, the general agent: chat, browsing, code, files. |
| `agent37-openclaw` | OpenClaw, the general agent: chat, headless browsing, code, files. |
| `agent37-claude-code` | Claude Code, Anthropic's coding agent, on your own Anthropic account: chat, code, files, shell. No browser or desktop. |
| `agent37-codex` | Codex, OpenAI's coding agent, on your own OpenAI account: chat, code, files, shell. No browser or desktop. |
| `agent37-grok` | Grok, xAI's coding agent, on your own xAI API key: chat, code, files, shell. No browser or desktop. |
| `agent37-opencode` | OpenCode, SST's open-source coding agent, on the managed model out of the box: chat, code, files, shell. No browser or desktop. |
| `agent37-pi` | Pi, the minimal open-source agent harness, on the managed model out of the box: chat, code, files, shell. No browser or desktop. |
| `agent37-n8n` | n8n, the workflow automation tool, on its own always-on instance: visual editor, webhooks, app integrations, with the managed model ready for its AI nodes. Not an agent harness. |
| `agent37-ubuntu` | Ubuntu with Docker, Compose, and buildx on a real kernel: containers, Compose stacks, Kubernetes, databases, and Android emulators, plus a desktop in the browser. Not an agent harness, and only runs as a [VM instance](https://www.agent37.com/docs/agents-api/vm-instances.md). |
| `agent37-android` | An Android phone: the Android 14 emulator, ADB, and a live screen in the browser. Not an agent harness, and only runs as a [VM instance](https://www.agent37.com/docs/agents-api/vm-instances.md). |

Every template offers the same four CPU/RAM shapes. Most templates default to 2 vCPU / 4 GB on the default instance type at \$4.76 per month. The VM-only templates have different defaults and pricing: `agent37-ubuntu` defaults to 2 vCPU / 4 GB / 12 GB disk, and `agent37-android` to 4 vCPU / 8 GB / 12 GB disk. See [sizing](https://www.agent37.com/docs/agents-api/instance-sizing.md) and [VM pricing](https://www.agent37.com/docs/agents-api/vm-instances.md#sizing-and-price).

`agent37-claude-code` runs on your own Anthropic account: connect it before the first chat turn; see [Host Claude Code](https://www.agent37.com/docs/agents-api/claude-code.md). `agent37-codex` runs on your own OpenAI account, same rule; see [Host Codex](https://www.agent37.com/docs/agents-api/codex.md). `agent37-grok` runs on your own xAI API key, same rule; see [Host Grok](https://www.agent37.com/docs/agents-api/grok.md). `agent37-opencode` runs on the managed model out of the box, no account or key needed; point it at your own provider when you want a specific model, see [Host OpenCode](https://www.agent37.com/docs/agents-api/opencode.md). `agent37-pi` is the same out of the box, and takes a provider key or a Claude, ChatGPT or Copilot subscription when you want your own; see [Host Pi](https://www.agent37.com/docs/agents-api/pi.md). `agent37-n8n` runs a web app, not an agent: there is no chat API on it, and its editor gets a public URL on create; see [Host n8n](https://www.agent37.com/docs/agents-api/n8n.md). `agent37-ubuntu` is a whole machine rather than a sandbox: create it with `"type": "vm"`, and get in over SSH or through its desktop; see [VM instances](https://www.agent37.com/docs/agents-api/vm-instances.md). `agent37-android` is a separate image with Android, ADB, and a browser screen, without the Ubuntu template's Docker daemon or XFCE desktop; see [Host an Android phone](https://www.agent37.com/docs/agents-api/android.md).

> [!NOTE]
>
> Passing any other `agent37-` name on instance create returns `400 invalid_request`, because the prefix is reserved for system templates.

On agent harness templates, port `3737` is the gateway: the [chat API](https://www.agent37.com/docs/agents-api/chat.md) at `https://{instanceId}.agent37.app`. Any other port an instance serves, including the built-in dashboard, terminal, and file browser, is reachable at its derivable `https://{instanceId}-{port}.agent37.app` URL; see [Instance and preview URLs](https://www.agent37.com/docs/agents-api/urls.md). The base, app, and VM templates have no Agent API: `agent37-base` serves its terminal on port `7681` and has no default service port, `agent37-n8n` serves its editor on port `5678` through a public URL, `agent37-android` serves its authenticated screen on port `6901`, and `agent37-ubuntu` has no default service port. Use [exec](https://www.agent37.com/docs/agents-api/exec.md) or [SSH](https://www.agent37.com/docs/agents-api/ssh.md) to run commands on these instances.

System templates track the newest platform image: their `image_ref` moves forward as new versions ship, and each create uses whatever the template points at in that moment. Existing instances are unaffected: an instance keeps the image it was created from until you [update it](https://www.agent37.com/docs/agents-api/instances/update.md).

Every system template is built from a public Dockerfile in [agent37-platform/templates](https://github.com/agent37-platform/templates), so you, or your coding agent, can read exactly what an instance runs: what the image installs and how its entrypoint configures the agent at boot. Each published version is a git tag there named `<key>/<tag>`, for example `b2b-hermes/<tag>` for `agent37-hermes@<tag>`; the repo's README maps every template to its key. `main` can be ahead of what your instances run, so read the tag in your instance's image.

## Pin a template version

If you need every instance you create to be identical (say a setup script runs after each create and depends on exact paths or versions), pin the version: append `@<tag>` (system templates) or `@<revision>` (workspace templates) to the template name on create.

```bash curl wrap theme={null}
curl -X POST https://api.agent37.com/v1/instances \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "template": "agent37-hermes@<tag>" }'
```

Every release is an immutable dated tag, never republished, so a pin is a freeze. The published tags are on GHCR: [hermes](https://github.com/orgs/agent37-platform/packages/container/package/hermes), [openclaw](https://github.com/orgs/agent37-platform/packages/container/package/openclaw), [claude-code](https://github.com/orgs/agent37-platform/packages/container/package/claude-code), [codex](https://github.com/orgs/agent37-platform/packages/container/package/codex), [opencode](https://github.com/orgs/agent37-platform/packages/container/package/opencode); the current tag is the one in each template's `image_ref` on `GET /v1/templates`. An unpublished tag returns `400 invalid_request`, and so does `@latest`, because the bare name already follows the latest release. To check a version before creating from it, `GET /v1/templates/agent37-hermes@<tag>`: it returns the template with the pinned `image_ref`, or `404` if that version isn't published.

Workspace templates pin by revision number: every image publish (a changed `image_ref` or a successful [cloud build](#build-an-image-in-the-cloud)) appends a release, `GET /v1/templates/{name}` lists them under [`revisions`](#the-template-object), and `my-agent@2` freezes revision `2`. `GET /v1/templates/my-agent@2` probes one the same way as a system tag, returning `404` if it was never published, and an unpublished revision on create or update returns `400 invalid_request` naming the published ones.

The pin sticks: the instance object's `template` field carries it (`"agent37-hermes@2026.10.05a"`, `"my-agent@2"`), and every lifecycle operation, including [`update`](https://www.agent37.com/docs/agents-api/instances/update), stays on the pinned version. To pin an existing instance, move its pin, or clear it, pass a `template` to update: the name with an `@<tag>` or `@<revision>` sets or switches the pin, the bare name clears it and follows latest again.

## Endpoints

| Method | Path | Returns |
| - | - | - |
| `GET` | `/v1/templates` | `200` `{ "data": [...] }`, system catalog first, then your workspace templates sorted by name |
| `POST` | `/v1/templates` | `201` with the new workspace template |
| `GET` | `/v1/templates/{name}` | `200` with one template, system or workspace |
| `PATCH` | `/v1/templates/{name}` | `200` with the updated workspace template |
| `DELETE` | `/v1/templates/{name}` | `200` `{ "name": "...", "deleted": true }` |
| `POST` | `/v1/template-builds` | `201` with a new cloud build and a presigned URL for its build context |
| `POST` | `/v1/template-builds/{id}/start` | `200` with the build now `building` |
| `GET` | `/v1/template-builds/{id}` | `200` with the build, including the published template once it succeeds |
| `GET` | `/v1/template-builds/{id}/logs` | `200` with the build plus an incremental chunk of its build log |

```bash curl wrap theme={null}
curl -X GET \
  https://api.agent37.com/v1/templates \
  -H "Authorization: Bearer sk_live_..."
```

```python Python wrap theme={null}
import requests

response = requests.get(
    "https://api.agent37.com/v1/templates",
    headers={
        "Authorization": "Bearer sk_live_..."
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
const response = await fetch(
  "https://api.agent37.com/v1/templates",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer sk_live_..."
    },
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

```bash curl wrap theme={null}
curl -X GET \
  https://api.agent37.com/v1/templates/my-agent \
  -H "Authorization: Bearer sk_live_..."
```

```python Python wrap theme={null}
import requests

response = requests.get(
    "https://api.agent37.com/v1/templates/my-agent",
    headers={
        "Authorization": "Bearer sk_live_..."
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
const response = await fetch(
  "https://api.agent37.com/v1/templates/my-agent",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer sk_live_..."
    },
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

## Build an image in the cloud

To publish a local or private image, you don't upload the image; you upload a small **build context** (a `Dockerfile` plus the files it `COPY`s) and Agent37 builds the image on its own infrastructure. No local Docker needed, and nothing has to be public except what the build fetches. The supported path is the Agent37 CLI:

```bash wrap theme={null}
export AGENT37_API_KEY=sk_live_...
npx agent37 templates build ./my-agent --name my-agent
```

The directory defaults to `.` and must have a `Dockerfile` at its root. The CLI packs the **whole folder**, minus `.git` and your `.dockerignore` patterns (plain patterns only; `!` negations are ignored), gzips it (1 GB cap), and streams the live build log to your terminal; on failure it exits non-zero with the failing step visible. Every unexcluded file ships with the context, a stray `.env` included, and a `COPY . .` bakes it into the image, so check the folder, or add a `.dockerignore`, before you build. `--name` defaults to the folder name, and `--default-port <port>` sets the published template's default port. Re-building an existing name publishes a new template revision; existing instances never change. Ctrl-C does not cancel the build; it keeps running server-side. `--secret id=NAME` hands a value to `RUN --mount=type=secret,id=NAME` steps and `--registry-auth HOST=USER:PASSWORD` lets `FROM` pull from a private registry; see [build secrets](https://www.agent37.com/docs/agents-api/custom-image.md#build-secrets).

See [Build a custom image](https://www.agent37.com/docs/agents-api/custom-image.md) for the walkthrough. The raw flow below is for clients scripting the same thing without the CLI.

### 1. Create a build

`POST /v1/template-builds` with the template name and the exact byte count of your gzipped context:

**name** `string` *required*

The template the build publishes, following the same rules as [template names](#register-a-workspace-template). A new name is created at revision `1` when the build succeeds; an existing name gets a new revision.

**size\_bytes** `integer` *required*

Exact size of the gzipped context, from `1` through `1,000,000,000` bytes (1 GB).

**default\_port** `integer`

Applied to the published template, with the same semantics as on [`POST /v1/templates`](#register-a-workspace-template).

**description** `string`

Optional free-text description for the published template.

Pack the context first, then choose a client below. The curl examples also use `jq`; all three clients read `AGENT37_API_KEY` from your environment and save the response to `build.json` for the upload and start steps.

```bash wrap theme={null}
tar --exclude-vcs -czf context.tar.gz -C ./my-agent .
```

```bash curl wrap theme={null}
BYTES=$(wc -c < context.tar.gz | tr -d ' ')

jq -n --argjson size_bytes "$BYTES" '{
  name: "my-agent",
  size_bytes: $size_bytes,
  default_port: 8000,
  description: "My agent"
}' | curl --fail-with-body -sS -X POST \
  https://api.agent37.com/v1/template-builds \
  -H "Authorization: Bearer $AGENT37_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- > build.json
```

```python Python wrap theme={null}
import json
import os
from pathlib import Path
import requests

response = requests.post(
    "https://api.agent37.com/v1/template-builds",
    headers={
        "Authorization": f"Bearer {os.environ['AGENT37_API_KEY']}",
        "Content-Type": "application/json"
    },
    json={
        "name": "my-agent",
        "size_bytes": Path("context.tar.gz").stat().st_size,
        "default_port": 8000,
        "description": "My agent"
    },
)
response.raise_for_status()
Path("build.json").write_text(json.dumps(response.json()))
```

```javascript Node wrap theme={null}
import fs from "node:fs/promises";

const response = await fetch(
  "https://api.agent37.com/v1/template-builds",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.AGENT37_API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "my-agent",
      "size_bytes": (await fs.stat("context.tar.gz")).size,
      "default_port": 8000,
      "description": "My agent"
    }),
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
await fs.writeFile("build.json", JSON.stringify(await response.json()));
```

```json response wrap theme={null}
{
  "id": "tb_7d3a90b81f264bc2a113",
  "name": "my-agent",
  "status": "created",
  "upload_url": "https://uploads.example.com/...signed...",
  "expires_at": 1784192400,
  "max_bytes": 1000000000
}
```

**id** `string`

The workspace-scoped build id, `tb_` followed by 20 lowercase hex characters.

**upload\_url** `string`

A presigned `PUT` URL for the gzipped context, valid for one hour. It is a bearer credential: send no Agent37 key to it, and do not log or share it.

**expires\_at** `integer`

When `upload_url` expires, in epoch seconds.

**max\_bytes** `integer`

The context cap: exactly `1,000,000,000` bytes (1 GB).

### 2. Upload the context

`PUT` the gzipped tar to `upload_url`. The archive must have `Dockerfile` at its root: pack the folder's contents, not the folder. Clear curl's default `Expect: 100-continue` header; it is incompatible with these presigned uploads:

```bash curl wrap theme={null}
curl --fail-with-body -X PUT \
  "$(jq -r '.upload_url' build.json)" \
  -H 'Expect:' \
  --data-binary @context.tar.gz
```

```python Python wrap theme={null}
import json
from pathlib import Path
import requests

build = json.loads(Path("build.json").read_text())
with open("context.tar.gz", "rb") as context:
    response = requests.put(
        build["upload_url"],
        data=context,
    )
response.raise_for_status()
```

```javascript Node wrap theme={null}
import fs from "node:fs/promises";

const build = JSON.parse(await fs.readFile("build.json", "utf8"));
const response = await fetch(build.upload_url, {
  method: "PUT",
  body: await fs.readFile("context.tar.gz"),
});
if (!response.ok) {
  throw new Error(await response.text());
}
```

### 3. Start the build

The body is optional. Send one when a `RUN` step needs a credential or `FROM` pulls from a private registry; both are used for this build only and are not stored.

**secrets** `object`

Build secrets, `{ "<id>": "<value>" }`. Each id (1 to 64 letters, digits, `_`, `.` or `-`, starting with a letter or `_`) is mounted for `RUN --mount=type=secret,id=<id>` steps at `/run/secrets/<id>` during that step only and never written into the image. Up to 32 entries, 256 KB in total.

**registry\_auth** `object`

Registry logins for `FROM`, keyed by host: `{ "registry.acme.com": { "username": "...", "password": "..." } }`. Up to 8 registries.

Set `GITHUB_TOKEN` and `REGISTRY_PASSWORD` in your environment and replace `registry.acme.com` with your registry. Omit either object when the build does not need it.

```bash curl wrap theme={null}
BUILD_ID=$(jq -r '.id' build.json)

jq -n \
  --arg github_token "$GITHUB_TOKEN" \
  --arg registry_password "$REGISTRY_PASSWORD" '{
    secrets: {
      GITHUB_TOKEN: $github_token
    },
    registry_auth: {
      "registry.acme.com": {
        username: "bot",
        password: $registry_password
      }
    }
  }' | curl --fail-with-body -sS -X POST \
  "https://api.agent37.com/v1/template-builds/$BUILD_ID/start" \
  -H "Authorization: Bearer $AGENT37_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @-
```

```python Python wrap theme={null}
import json
import os
from pathlib import Path
import requests

build = json.loads(Path("build.json").read_text())
response = requests.post(
    f"https://api.agent37.com/v1/template-builds/{build['id']}/start",
    headers={
        "Authorization": f"Bearer {os.environ['AGENT37_API_KEY']}",
        "Content-Type": "application/json"
    },
    json={
        "secrets": {
            "GITHUB_TOKEN": os.environ["GITHUB_TOKEN"]
        },
        "registry_auth": {
            "registry.acme.com": {
                "username": "bot",
                "password": os.environ["REGISTRY_PASSWORD"]
            }
        }
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
import fs from "node:fs/promises";

const build = JSON.parse(await fs.readFile("build.json", "utf8"));
const response = await fetch(
  `https://api.agent37.com/v1/template-builds/${build.id}/start`,
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.AGENT37_API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "secrets": {
        "GITHUB_TOKEN": process.env.GITHUB_TOKEN
      },
      "registry_auth": {
        "registry.acme.com": {
          "username": "bot",
          "password": process.env.REGISTRY_PASSWORD
        }
      }
    }),
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

```json response wrap theme={null}
{ "id": "tb_7d3a90b81f264bc2a113", "status": "building" }
```

Starting a build whose context was never uploaded, or is over 1 GB, returns `400 invalid_request`; so does a malformed `secrets` or `registry_auth`. Up to three builds run at once per workspace: a build that already started, or a start while three are already running, returns `409 build_conflict`. If no build machine came up, the start returns `503 try_again` and the build is marked `failed`: upload the context to a new build and start that one.

### 4. Poll it and tail the log

`GET /v1/template-builds/{id}` returns the build; `GET /v1/template-builds/{id}/logs?offset=N` returns the same fields plus a chunk of build log starting at `offset`. Pass the returned `offset` back to tail incrementally. Poll rather than wait silently: the poll that finds the build finished is what triggers template registration (an unpolled build is still completed by a platform sweep within about five minutes).

Read the build status:

```bash curl wrap theme={null}
BUILD_ID=$(jq -r '.id' build.json)

curl -X GET \
  "https://api.agent37.com/v1/template-builds/$BUILD_ID" \
  -H "Authorization: Bearer $AGENT37_API_KEY"
```

```python Python wrap theme={null}
import json
import os
from pathlib import Path
import requests

build = json.loads(Path("build.json").read_text())
response = requests.get(
    f"https://api.agent37.com/v1/template-builds/{build['id']}",
    headers={
        "Authorization": f"Bearer {os.environ['AGENT37_API_KEY']}"
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
import fs from "node:fs/promises";

const build = JSON.parse(await fs.readFile("build.json", "utf8"));
const response = await fetch(
  `https://api.agent37.com/v1/template-builds/${build.id}`,
  {
    method: "GET",
    headers: {
      "Authorization": `Bearer ${process.env.AGENT37_API_KEY}`
    },
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

Read a log chunk, starting at byte `0` on the first request:

```bash curl wrap theme={null}
BUILD_ID=$(jq -r '.id' build.json)

curl -X GET \
  "https://api.agent37.com/v1/template-builds/$BUILD_ID/logs" \
  --url-query "offset=0" \
  -H "Authorization: Bearer $AGENT37_API_KEY"
```

```python Python wrap theme={null}
import json
import os
from pathlib import Path
import requests

build = json.loads(Path("build.json").read_text())
response = requests.get(
    f"https://api.agent37.com/v1/template-builds/{build['id']}/logs",
    headers={
        "Authorization": f"Bearer {os.environ['AGENT37_API_KEY']}"
    },
    params={
        "offset": 0
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
import fs from "node:fs/promises";

const build = JSON.parse(await fs.readFile("build.json", "utf8"));
const query = new URLSearchParams({
  "offset": "0"
});

const response = await fetch(
  `https://api.agent37.com/v1/template-builds/${build.id}/logs` + "?" + query,
  {
    method: "GET",
    headers: {
      "Authorization": `Bearer ${process.env.AGENT37_API_KEY}`
    },
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

```json response wrap theme={null}
{
  "id": "tb_7d3a90b81f264bc2a113",
  "name": "my-agent",
  "status": "succeeded",
  "template": {
    "name": "my-agent",
    "revision": 1,
    "image_digest": "sha256:9b2e...c41f"
  },
  "created": 1784190000,
  "started": 1784190010,
  "finished": 1784190190,
  "offset": 5120,
  "data": "#8 exporting layers\n#8 DONE 1.2s\n"
}
```

**status** `string`

`created` (waiting for the context and `start`), `building` (the Docker build is running), `ingesting` (build done; the image is being copied into private storage), `succeeded`, or `failed`.

**error** `object`

On `failed`, the reason as `{ "code", "message" }`. See [the failure codes](#build-limits-and-failures).

**template** `object`

On `succeeded`, the published result: the template `name`, its new `revision`, and the pinned `image_digest`.

**created** `integer`

When the build was created, in epoch seconds.

**started** `integer`

When the build started, in epoch seconds. Set once it starts.

**finished** `integer`

When the build finished, in epoch seconds. Set once it succeeds or fails.

**offset** `integer`

Logs endpoint only: the next offset to request.

**data** `string`

Logs endpoint only: the log chunk starting at your offset, the real Docker build output. It stays readable after the build finishes.

### Build limits and failures

Builds are free, on a workspace whose wallet holds a balance. Up to three run at once per workspace, a build times out after 45 minutes, and the gzipped context is capped at 1 GB. The built image is capped at 15 GB decimal, like a registry import; if you need more, [talk to the team](https://cal.com/vishnukool/30min).

Your Dockerfile and files upload straight to the build, so a private codebase never needs a registry. A `FROM` on a private registry takes its login as `registry_auth` on the start call, and a `RUN` step that needs a token (a private repository, a private package index) reads it from a build secret passed the same way; see [build secrets](https://www.agent37.com/docs/agents-api/custom-image.md#build-secrets). A template published by a build has an `image_digest` and no `image_ref`, because no public reference exists.

A failed build carries its reason in `error.code`:

| Code | What happened |
| - | - |
| `build_failed` | A Dockerfile step failed; the failing step is at the end of the build log |
| `build_timeout` | The build ran past the 45-minute limit |
| `invalid_request` | The context is unusable: not a gzipped tar, or no `Dockerfile` at its root |
| `invalid_image_archive` | The built image failed validation: not a readable single `linux/amd64` image |
| `image_too_large` | The built image is over the 15 GB decimal cap |
| `image_ingest_failed` | The copy into private storage failed for a reason on our side; re-run the build, or [contact support](mailto:support@agent37.com) |
| `internal_error` | The build failed for a reason on our side; re-run the build, or [contact support](mailto:support@agent37.com) |
| `try_again` | No build machine was available, so the build never started; upload the context to a new build and start that one |

## Register a workspace template

`POST /v1/templates` registers an amd64 image under a name you choose. The platform runs it as a managed instance with the same lifecycle, billing, [exec](https://www.agent37.com/docs/agents-api/exec.md), and routed port URLs as the catalog; what the image serves on its ports is up to it. The image can be anything, built from scratch or on [the Hermes base image](#build-on-the-hermes-base-image). Give the image as an `image_ref`; for a private registry, add `registry_auth` beside it. An image that exists nowhere yet is a [cloud build](#build-an-image-in-the-cloud) instead, which publishes the template itself, so there is nothing to register afterward. If you need an image larger than the 15 GB cap allows, [talk to the team](https://cal.com/vishnukool/30min).

**name** `string` *required*

2 to 63 characters: lowercase letters, digits, and hyphens, starting with a letter (`^[a-z][a-z0-9-]{1,62}$`). The `agent37-` prefix is reserved. A name that already exists returns `409 template_conflict`.

**image\_ref** `string` *required*

A fully qualified image reference with a registry or namespace path, like `ghcr.io/acme/my-agent:v1`. Up to 255 characters. The image must be built for `linux/amd64` and at most 15 GB, and either public or reachable with `registry_auth`. On registration the platform pulls it once into private storage and pins it by digest; a reference it cannot pull, one that isn't `linux/amd64`, or one over the cap is rejected then.

**registry\_auth** `object`

The login for the image's registry when it is private: `{ "username": "...", "password": "..." }` (on GHCR, a personal access token with `read:packages` as the password). The platform uses it once for the copy into private storage and does not store it, so a later `PATCH` that changes `image_ref` sends it again. Not accepted for `ghcr.io/agent37-platform/` images, which are public.

**description** `string`

Optional free-text description.

**default\_port** `integer`

The port the bare instance URL (`https://{instanceId}.agent37.app`) routes to. Your service must bind it on `0.0.0.0`, not only localhost. Creation never waits for it to open, so poll [health](https://www.agent37.com/docs/agents-api/health.md) (or your own endpoint) to know when your service is up. An integer 1 to 65535. Only `22022` ([SSH](https://www.agent37.com/docs/agents-api/ssh.md)) is rejected, because the platform injects its own SSH server there; every other port is yours, `8080` and `3000` included. Omitted, the bare URL falls back to `3737` (right for images built on [the Hermes base image](#build-on-the-hermes-base-image), whose gateway serves it). A private sandbox can listen on nothing and be driven by [exec](https://www.agent37.com/docs/agents-api/exec.md), but its main process must still stay running. Every other port needs no declaration: it is already reachable at `https://{instanceId}-{port}.agent37.app`. With [auto-sleep](https://www.agent37.com/docs/agents-api/instance-auto-sleep.md) on, a sandbox nothing ever requests only wakes by an explicit [`start`](https://www.agent37.com/docs/agents-api/instances/start).

**entrypoint** `string[]`

The command the instance runs, replacing the image's own `ENTRYPOINT` and `CMD`. Exactly what `docker run --entrypoint` does. An array of arguments, not a shell line: `["/bin/sh", "-c", "node server.js"]`. Omitted, the image decides, which is what you want for an image you built. Set it to run a stock image you did not build, like `node:24-slim`, whose own command opens a REPL and exits. Changing it publishes a new [revision](#pin-a-template-version), so a pin freezes the command along with the image.

**public** `boolean` (default: false)

`true` lets any other workspace create instances from this template. See [Share a template with other workspaces](#share-a-template-with-other-workspaces).

The example includes private-registry credentials and a command override. Use your published tag and registry token; omit `registry_auth` for a public image and `entrypoint` to keep the image's own command. If you use the override, `/app/start.sh` must exist in your image.

```bash curl wrap theme={null}
curl -X POST \
  https://api.agent37.com/v1/templates \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-agent",
    "image_ref": "ghcr.io/acme/my-agent:<tag>",
    "registry_auth": {
      "username": "acme",
      "password": "<registry-token>"
    },
    "description": "My agent",
    "default_port": 8000,
    "entrypoint": [
      "/bin/sh",
      "-c",
      "exec /app/start.sh"
    ]
  }'
```

```python Python wrap theme={null}
import requests

response = requests.post(
    "https://api.agent37.com/v1/templates",
    headers={
        "Authorization": "Bearer sk_live_...",
        "Content-Type": "application/json"
    },
    json={
        "name": "my-agent",
        "image_ref": "ghcr.io/acme/my-agent:<tag>",
        "registry_auth": {
            "username": "acme",
            "password": "<registry-token>"
        },
        "description": "My agent",
        "default_port": 8000,
        "entrypoint": [
            "/bin/sh",
            "-c",
            "exec /app/start.sh"
        ]
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
const response = await fetch(
  "https://api.agent37.com/v1/templates",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer sk_live_...",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "my-agent",
      "image_ref": "ghcr.io/acme/my-agent:<tag>",
      "registry_auth": {
        "username": "acme",
        "password": "<registry-token>"
      },
      "description": "My agent",
      "default_port": 8000,
      "entrypoint": [
        "/bin/sh",
        "-c",
        "exec /app/start.sh"
      ]
    }),
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

### Run a stock image

An image you did not build usually starts the wrong thing. `node:24-slim` runs `node`, which opens a REPL and exits, so an instance from it would never serve anything. `entrypoint` replaces that without forking the image:

```bash wrap theme={null}
curl -X POST https://api.agent37.com/v1/templates \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-app",
    "image_ref": "docker.io/library/node:24-bookworm-slim",
    "default_port": 8080,
    "entrypoint": ["/bin/sh", "-c", "exec /app/start.sh"]
  }'
```

Instances from this template boot `/app/start.sh`, which you put on the instance's disk with [exec](https://www.agent37.com/docs/agents-api/exec.md) or [SSH](https://www.agent37.com/docs/agents-api/ssh.md). Because the command belongs to the template rather than to a one-off call, it runs again on every start, restart, and wake from [auto-sleep](https://www.agent37.com/docs/agents-api/instance-auto-sleep.md).

Registration copies the image into private storage before it returns, so `POST` and `PATCH` are synchronous and can take up to a few minutes for a large image. A reference the platform cannot pull (private without `registry_auth`, or a wrong login), one that isn't `linux/amd64`, or one over the cap is rejected at registration with `400 invalid_request` or `400 image_too_large`, so a broken image never reaches instance create.

> [!TIP]
>
> Pin a tag on `image_ref`; do not rely on `latest`. A pinned tag makes rollback a one-field `PATCH` and keeps every instance you create reproducible. The template is a snapshot regardless; pinning is about which build you re-register next.

> [!NOTE]
>
> Build for `linux/amd64` even on an Apple Silicon Mac (`docker build --platform linux/amd64 ...`). An arm64 image is rejected during registration.

## Build on the Hermes base image

[`ghcr.io/agent37-platform/hermes-base`](https://github.com/orgs/agent37-platform/packages/container/package/hermes-base) is the published FROM target for custom templates. It ships Hermes with its browser stack (Chromium, Playwright), the gateway that serves the [chat API](https://www.agent37.com/docs/agents-api/chat.md), and a general toolchain: git, Python 3 with uv, Node.js, build tools. The image itself wires no model and no integrations; you add your layers on top. It does not need to carry credentials, because the platform puts a working LLM endpoint and a Composio MCP server in every instance's environment; see [Managed services in your image](https://www.agent37.com/docs/agents-api/managed-services.md). Point your agent at those, or bring your own model keys. Its source is [`images/b2b/hermes/Dockerfile`](https://github.com/agent37-platform/templates/blob/main/images/b2b/hermes/Dockerfile) (`--target base`).

```dockerfile wrap theme={null}
FROM ghcr.io/agent37-platform/hermes-base:latest

USER root
RUN apt-get update && apt-get install -y postgresql-client
USER node
```

Publish it with a [cloud build](#build-an-image-in-the-cloud) (`npx agent37 templates build` from the folder holding the Dockerfile), or build it yourself for `linux/amd64` and push it to a registry. OpenClaw builds have the same shape: the FROM target is [`ghcr.io/agent37-platform/openclaw-base`](https://github.com/orgs/agent37-platform/packages/container/package/openclaw-base), published with the same dated tags as `agent37-openclaw`. So do [Claude Code](https://www.agent37.com/docs/agents-api/claude-code.md) builds: the FROM target is [`ghcr.io/agent37-platform/claude-code-base`](https://github.com/orgs/agent37-platform/packages/container/package/claude-code-base), the clean base with no managed integrations, published with the same dated tags as `agent37-claude-code`. [Codex](https://www.agent37.com/docs/agents-api/codex.md) builds follow suit: the FROM target is [`ghcr.io/agent37-platform/codex-base`](https://github.com/orgs/agent37-platform/packages/container/package/codex-base), published with the same dated tags as `agent37-codex`. [Grok](https://www.agent37.com/docs/agents-api/grok.md) builds as well: the FROM target is [`ghcr.io/agent37-platform/grok-base`](https://github.com/orgs/agent37-platform/packages/container/package/grok-base), published with the same dated tags as `agent37-grok`. [OpenCode](https://www.agent37.com/docs/agents-api/opencode.md) builds too: the FROM target is [`ghcr.io/agent37-platform/opencode-base`](https://github.com/orgs/agent37-platform/packages/container/package/opencode-base), published with the same dated tags as `agent37-opencode`. [Pi](https://www.agent37.com/docs/agents-api/pi.md) as well: the FROM target is [`ghcr.io/agent37-platform/pi-base`](https://github.com/orgs/agent37-platform/packages/container/package/pi-base), published with the same dated tags as `agent37-pi`.

See [Build a custom image](https://www.agent37.com/docs/agents-api/custom-image.md) for the step-by-step walkthrough, and [agent37-platform/custom-agent-image](https://github.com/agent37-platform/custom-agent-image) for a working app that builds its own image and installs a skill into every agent it creates.

The contract:

* Your built image freezes the base it was built from; the FROM tag only matters when you rebuild. `latest` tracks the newest base, so getting-started builds never go stale. For reproducible rebuilds, pin a date tag: `hermes-base` publishes the same dated tags as `agent37-hermes` ([list on GHCR](https://github.com/orgs/agent37-platform/packages/container/package/hermes-base)), and the current one is the tag in `agent37-hermes`'s `image_ref` on `GET /v1/templates`.
* Keep the entrypoint. It starts Hermes and the gateway; a Dockerfile that overrides `ENTRYPOINT` loses the chat API.
* Bake outside `/home/node`. It is a persistent volume, so anything the image writes there is masked at runtime. Use `/usr/local` or `/opt`.
* An image ships binaries, not skills. Hermes reads skills from `~/.hermes/skills`, on that same masked volume, so write them into a running instance over [exec](https://www.agent37.com/docs/agents-api/exec.md) or the [files API](https://www.agent37.com/docs/agents-api/files.md) instead, once per instance, at whatever point your app creates one. They persist across restarts and updates.
* The image runs as the `node` user with passwordless `sudo`. Switch to `USER root` for installs in the Dockerfile and back to `USER node` at the end; installs outside `/home/node` on a running instance reset on the next update.
* Leave the default port to the gateway. The runtime tells the gateway which port to bind (`default_port`, or `3737` when you omit it), so the bare instance URL serves the chat API; do not bind your own service there. Your own services need no declaration: each is reachable at `https://{instanceId}-{port}.agent37.app`.
* Bring your own model keys. Instances boot with no LLM provider configured, and chat returns errors until you add one. Write your provider credentials into `~/.hermes/config.yaml`, Hermes' standard config file, over [exec](https://www.agent37.com/docs/agents-api/exec.md) or the terminal. The file lives on the persistent volume, so it survives restarts and updates.

## Update a template

`PATCH /v1/templates/{name}` changes any of `name`, `image_ref`, `description`, `default_port` (send `null` to clear it back to the `3737` fallback), `entrypoint` (send `null` to go back to the image's own command), or [`public`](#share-a-template-with-other-workspaces). Send at least one field. A changed `image_ref` is copied into private storage (send `registry_auth` again for a private registry), so an image update is synchronous like create, and each successful image update increments the platform-controlled `revision`. Sending the exact same `image_ref` string reuses the existing snapshot and does not increment it; renaming or changing only `description`, `default_port`, or `public` also leaves it unchanged. A changed `entrypoint` does increment it, since it changes what the template runs. To ship a new image on a template published by a [cloud build](#build-an-image-in-the-cloud) (no `image_ref`), run a new build under the same name; every successful build publishes a new revision, even when the built image's digest is unchanged. Renaming onto an existing name returns `409 template_conflict`; system templates return `403`.

This example shows every editable field and the optional registry credentials. Send only the fields you want to change, using a new published tag when updating the image.

```bash curl wrap theme={null}
curl -X PATCH \
  https://api.agent37.com/v1/templates/my-agent \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-agent",
    "image_ref": "ghcr.io/acme/my-agent:<tag>",
    "registry_auth": {
      "username": "acme",
      "password": "<registry-token>"
    },
    "description": "My agent",
    "default_port": 8000,
    "entrypoint": [
      "/bin/sh",
      "-c",
      "exec /app/start.sh"
    ]
  }'
```

```python Python wrap theme={null}
import requests

response = requests.patch(
    "https://api.agent37.com/v1/templates/my-agent",
    headers={
        "Authorization": "Bearer sk_live_...",
        "Content-Type": "application/json"
    },
    json={
        "name": "my-agent",
        "image_ref": "ghcr.io/acme/my-agent:<tag>",
        "registry_auth": {
            "username": "acme",
            "password": "<registry-token>"
        },
        "description": "My agent",
        "default_port": 8000,
        "entrypoint": [
            "/bin/sh",
            "-c",
            "exec /app/start.sh"
        ]
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
const response = await fetch(
  "https://api.agent37.com/v1/templates/my-agent",
  {
    method: "PATCH",
    headers: {
      "Authorization": "Bearer sk_live_...",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "my-agent",
      "image_ref": "ghcr.io/acme/my-agent:<tag>",
      "registry_auth": {
        "username": "acme",
        "password": "<registry-token>"
      },
      "description": "My agent",
      "default_port": 8000,
      "entrypoint": [
        "/bin/sh",
        "-c",
        "exec /app/start.sh"
      ]
    }),
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

To roll back, [pin instances to the earlier revision](#pin-a-template-version) with `POST /v1/instances/{id}/update` and `{ "template": "my-agent@1" }`. No re-publish needed. To make an old release the template's *current* one again, point `image_ref` at the older tag (or, for a build-born template, re-run the [build](#build-an-image-in-the-cloud) from the older source); that publishes it as a new revision. Existing instances keep running on the image they already pulled; [update each instance](https://www.agent37.com/docs/agents-api/instances.md) to recreate it from the template's current image.

Workspace templates start at `revision: 1`. Compare that value with an instance's `template_revision` to find instances that have not installed the current template release.

## Roll out a release to your fleet

After an image update, list your instances and [update](https://www.agent37.com/docs/agents-api/instances/update.md) the ones still on an older revision. An instance's `template_revision` is what it has installed; the template's `revision` is the current release. Missing instance revisions read as `1`.

```bash curl wrap theme={null}
TEMPLATE=my-agent
REV=$(curl -s https://api.agent37.com/v1/templates/$TEMPLATE \
  -H "Authorization: Bearer sk_live_..." | jq .revision)

curl -s https://api.agent37.com/v1/instances \
  -H "Authorization: Bearer sk_live_..." |
  jq -r --arg t "$TEMPLATE" --argjson r "$REV" \
    '.data[] | select(.template == $t and (.template_revision // 1) != $r) | .id' |
  head -n 3 |
  xargs -I{} curl -s -X POST "https://api.agent37.com/v1/instances/{}/update" \
    -H "Authorization: Bearer sk_live_..."
```

The `head -n 3` is the canary: update a small slice first, verify the release on those instances, then rerun without it to finish the fleet. Rerunning is always safe, the filter only picks up instances still behind. A `sleeping` instance is woken by the update and comes back `running`. That is the only way it picks up the release: waking a sleeper on its own restores it on the image it fell asleep with.

## Share a template with other workspaces

Make a template public and any other Agent37 workspace can create instances from it, with nothing to register on their side. Use it to ship one image to customers who each run on their own Agent37 account.

```bash curl wrap theme={null}
curl -X PATCH https://api.agent37.com/v1/templates/my-agent \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "public": true }'
```

They create from it with your workspace ID, a slash, and the template name. The template's panel on the dashboard Templates page shows that full name, ready to copy, once the template is public.

```bash curl wrap theme={null}
curl -X POST https://api.agent37.com/v1/instances \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "template": "<your-workspace-id>/my-agent" }'
```

* The instance runs and bills in the workspace that created it.
* A [revision pin](#pin-a-template-version) works the same way: `<your-workspace-id>/my-agent@2`. Without one, new instances and [updates](https://www.agent37.com/docs/agents-api/instances/update.md) get your current release.
* Your template stays out of their `GET /v1/templates`, and only your workspace can change or delete it.
* Their instance reports the `image_digest`. Your registry address in `image_ref` is not shown to them.
* Anyone with the name can run the image and read every file in it.
* Send `{ "public": false }` to make it private again. Instances already created keep running. New creates and updates from other workspaces return `400 invalid_request`, the same answer as a name that does not exist.

## Delete a template

`DELETE /v1/templates/{name}` removes the workspace template and acts once: the first call returns `200` with `{ "name": "my-agent", "deleted": true }`, and a repeat returns `404`. System templates return `403`. Existing instances created from it keep running, so deletion does not immediately purge the private image copy they still reference. Contact support if you need the stored image purged after its instances are gone.

```bash curl wrap theme={null}
curl -X DELETE \
  https://api.agent37.com/v1/templates/my-agent \
  -H "Authorization: Bearer sk_live_..."
```

```python Python wrap theme={null}
import requests

response = requests.delete(
    "https://api.agent37.com/v1/templates/my-agent",
    headers={
        "Authorization": "Bearer sk_live_..."
    },
)
response.raise_for_status()
print(response.json())
```

```javascript Node wrap theme={null}
const response = await fetch(
  "https://api.agent37.com/v1/templates/my-agent",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer sk_live_..."
    },
  },
);
if (!response.ok) {
  throw new Error(await response.text());
}
console.log(await response.json());
```

## The template object

```json response wrap theme={null}
{
  "name": "agent37-hermes",
  "scope": "system",
  "agents": ["hermes"],
  "revision": null,
  "image_ref": "ghcr.io/agent37-platform/hermes:2026.10.05a",
  "description": "Hermes general agent: browser, code, files.",
  "default_port": 3737,
  "entrypoint": null,
  "created": null,
  "updated": null
}
```

A workspace template registered from a registry reference echoes that reference as `image_ref` and adds the pinned `image_digest`; one published by a [cloud build](#build-an-image-in-the-cloud) has an `image_digest` and no `image_ref`:

```json response wrap theme={null}
{
  "name": "my-agent",
  "scope": "workspace",
  "agents": [],
  "revision": 2,
  "image_digest": "sha256:9b2e...c41f",
  "description": "My agent",
  "default_port": 8000,
  "entrypoint": null,
  "public": false,
  "created": 1752460800,
  "updated": 1752547200,
  "revisions": [
    { "revision": 2, "image_digest": "sha256:9b2e...c41f", "created": 1752547200 },
    { "revision": 1, "image_digest": "sha256:41d8...77aa", "created": 1752460800 }
  ]
}
```

**name** `string`

The name you pass as `template` when creating an instance.

**scope** `string`

`system` for built-in `agent37-` templates, `workspace` for ones you register.

**agents** `string[]`

The agents the template installs: `["hermes"]` on `agent37-hermes`, `["claude-code"]` on `agent37-claude-code`, `["codex"]` on `agent37-codex`, `["grok"]` on `agent37-grok`, `["opencode"]` on `agent37-opencode`, `["pi"]` on `agent37-pi`, and `[]` on `agent37-base` and `agent37-n8n`, which run no agent. Workspace templates report `[]`, because the platform does not inspect what your image installs.

**revision** `integer | null`

The platform-controlled workspace image revision. It starts at `1` and increments for a changed `image_ref` or every successful [cloud build](#build-an-image-in-the-cloud), even when the digest is unchanged. Metadata-only updates and the same exact `image_ref` leave it unchanged. `null` for system templates.

**revisions** `array`

Every published release of a workspace template, newest first: `{ "revision": 2, "image_digest": "sha256:...", "created": 1752547200 }`. [Pin one](#pin-a-template-version) with `name@<revision>` on instance create or update. Returned on `GET /v1/templates/{name}` only; absent from the list endpoint and from system templates. Templates that predate release history list only the revisions published since.

**image\_ref** `string`

For system templates and workspace templates registered from a registry, the image reference. **Absent** on a workspace template published by a [cloud build](#build-an-image-in-the-cloud), whose image lives only in Agent37's private storage, identified by `image_digest`.

**image\_digest** `string`

On workspace templates, the `sha256:...` digest of the private snapshot instances run, the immutable identity of the registered image. Absent on system templates.

**description** `string | null`

Your optional description.

**default\_port** `integer | null`

The declared default port, or `null` when the template relies on the `3737` fallback. See [Instance and preview URLs](https://www.agent37.com/docs/agents-api/urls.md).

**entrypoint** `string[] | null`

The command that replaces the image's own, or `null` when the image decides. A [pinned](#pin-a-template-version) read reports the command that revision was published with, not the current one.

**public** `boolean`

On workspace templates, whether [other workspaces can create from it](#share-a-template-with-other-workspaces). Absent on system templates.

**created** `integer | null`

Creation time in epoch seconds. `null` for system templates.

**updated** `integer | null`

Last update time in epoch seconds. `null` for system templates.

## Errors

| Status | Code | When |
| - | - | - |
| `400` | `invalid_request` | Bad `name`, `image_ref`, `default_port`, `public`, or `entrypoint` (not a non-empty array of non-empty strings); a template create with no `image_ref`; a registry reference the platform cannot pull (private without `registry_auth`, or a wrong login); a malformed `registry_auth`; the legacy `ports` array; a direct image reference passed as `template` on instance create; another workspace's template that is private or does not exist; a bad [pin](#pin-a-template-version) on create or update (unpublished system tag, `@latest`, non-numeric or unpublished workspace revision); a [build](#build-an-image-in-the-cloud) `start` with no uploaded context, one over 1 GB, or a malformed `secrets` or `registry_auth` body |
| `400` | `image_too_large` | The staged image is over the 15 GB decimal cap |
| `402` | `insufficient_balance` | A build create or `start`, or a template create or `image_ref` change that points at an outside registry, while the workspace wallet is empty |
| `403` | `forbidden` | `PATCH` or `DELETE` on a system template: they are read-only |
| `404` | `not_found` | Unknown template name or build id; a pinned `GET` for an unpublished version or revision; repeat `DELETE` |
| `409` | `template_conflict` | Create or rename onto a name that already exists |
| `409` | `build_conflict` | A build `start` on a build that already started, or while three builds are already running in your workspace |
| `502` | `image_ingest_failed` | The copy into private storage failed for a reason on our side; retry, or [contact support](mailto:support@agent37.com) |
| `503` | `try_again` | A build `start` that could not get a build machine; the build is `failed`, so retry on a new build |

A build that fails after starting is not an HTTP error: `GET /v1/template-builds/{id}` returns `200` with `status: "failed"` and the reason in its `error` field. See [build limits and failures](#build-limits-and-failures).

See [Errors](https://www.agent37.com/docs/agents-api/errors.md) for the envelope and the full catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.