Create, version, evaluate, promote and trigger agents.
{
"id": "agt_01j9x5c3d4",
"name": "invoice-processor",
"description": "Read supplier invoices, validate, post to accounting.",
"production_version": 7,
"latest_version": 8,
"status": "active",
"triggers": [ { "type": "email.received", "mailbox": "invoices@" } ],
"created_at": "2026-06-10T09:00:00Z"
}
| Method | Path | Purpose |
|---|---|---|
GET | /agents | List |
POST | /agents | Create from a YAML/JSON definition (creates version 1) |
GET | /agents/{id} | Retrieve |
GET | /agents/{id}/versions | List versions |
POST | /agents/{id}/versions | Create a new version from a definition |
GET | /agents/{id}/versions/{n} | Retrieve a version's definition |
POST | /agents/{id}/versions/{n}/evaluate | Run the evaluation set; returns an evaluation object |
POST | /agents/{id}/versions/{n}/promote | Promote to production (blocked if gate fails) |
POST | /agents/{id}/runs | Start a run (manual trigger) with an input |
POST | /agents/{id}/trigger | Webhook trigger (uses the agent's webhook secret) |
POST | /agents/{id}/pause / /resume | Pause or resume triggers |
DELETE | /agents/{id} | Archive |
curl -X POST https://api.brewmycode.com/v1/agents \
-H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/yaml" \
--data-binary @agent.yaml
See Building an agent for the definition format.
curl -X POST https://api.brewmycode.com/v1/agents/agt_01j9x5c3d4/runs \
-H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: inv-2026-0917-0042" \
-d '{ "input": { "document_url": "https://drive.google.com/file/d/…" }, "mode": "production" }'
mode is production (default for live keys) or test (writes simulated). Returns a run.
curl -X POST https://api.brewmycode.com/v1/agents/agt_01j9x5c3d4/trigger \
-H "X-BMC-Webhook-Secret: whsec_…" -H "Content-Type: application/json" \
-d '{ "ticket_id": 48213, "subject": "Invoice mismatch" }'