Update automations
Changes an automation, for the person it runs as or an admin of the org: any field it was created with, and enabled, which arms or disarms its schedule.
PATCH /v1/auto/automations/{id}
| Address | https://api.hanzo.ai/v1/auto/automations/{id} |
| Method | PATCH |
| Operation | patch_auto_automations_by_id |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Changes an automation, for the person it runs as or an admin
of the org: any field it was created with, and
enabled, which arms or disarms its schedule. A field the request omits is
left alone; project or model sent as null (or "") clears it. Any change
but enabled makes the caller the person it runs as from then on. A draft is
finished by saving its instructions: it becomes an automation in place, on
unless enabled says otherwise.
Request
16 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the automation, from the path. |
enabled | body | boolean | — | Enabled arms or disarms its schedule. |
id | body | string | — | ID is the automation, from the path. |
instructions | body | string | — | |
model | body | string | — | |
name | body | string | — | |
notify | body | boolean | — | |
permissions | body | string | — | |
postTo | body | string[] | — | |
project | body | string | — | |
schedule | body | auto.Schedule | — | |
schedule.at | body | string | — | At is the local time, HH:MM on a 24-hour clock, for daily, weekdays and weekly. |
schedule.cron | body | string | — | Cron is a five-field cron expression (minute hour day-of-month month day-of-week), for kind cron only, read in TZ. |
schedule.day | body | string | — | Day is the weekday a weekly schedule runs on: mon, tue, wed, thu, fri, sat or sun. |
schedule.kind | body | string | — | Kind is manual, hourly, daily, weekdays, weekly or cron. |
schedule.tz | body | string | — | TZ is the IANA time zone every time here is read in. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | auto.Automation | ok |
default | problem-details | refused |
200 body — 24 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
created | body | string | — | Created and Updated are RFC 3339 UTC. |
draft | body | boolean | — | Draft is a flow with no step yet: it has no instructions, never runs, and becomes an automation when its instructions are saved. |
enabled | body | boolean | — | Enabled is whether its schedule is armed. |
id | body | string | — | ID is the automation's id, which is also its flow's. |
instructions | body | string | — | Instructions are what the agent is asked to do each run. |
last | body | auto.LastRun | — | |
last.at | body | string | — | |
last.id | body | string | — | |
last.status | body | string | — | Status is succeeded, failed, running or queued. |
last.summary | body | string | — | |
model | body | string | — | Model is the model the agent thinks with; null for the default. |
name | body | string | — | Name is what it is called. |
next | body | string | — | Next is when it runs next, RFC 3339 UTC; null when manual or disabled. |
notify | body | boolean | — | Notify sends a one-line summary to the automation's person when a run ends. |
permissions | body | string | — | Permissions is auto (works and uses connectors without stopping) or ask (changes nothing and ends with the actions it proposes; agent.go agentTask). |
postTo | body | string[] | — | PostTo are the connected accounts each run's answer is posted to — x, linkedin, facebook — after review when Permissions is ask (post.go). |
project | body | string | — | Project is the Dev project the run works in, by its slug; null for none. |
schedule | body | auto.Schedule | — | |
schedule.at | body | string | — | At is the local time, HH:MM on a 24-hour clock, for daily, weekdays and weekly. |
schedule.cron | body | string | — | Cron is a five-field cron expression (minute hour day-of-month month day-of-week), for kind cron only, read in TZ. |
schedule.day | body | string | — | Day is the weekday a weekly schedule runs on: mon, tue, wed, thu, fri, sat or sun. |
schedule.kind | body | string | — | Kind is manual, hourly, daily, weekdays, weekly or cron. |
schedule.tz | body | string | — | TZ is the IANA time zone every time here is read in. |
updated | body | string | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, AutoApi } from 'hanzoai';
const api = new AutoApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.patchAutoAutomationsById({ id: 'id', enabled: false, id: "<id>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AutoApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AutoApi(client).patch_auto_automations_by_id(id='id', enabled=False, id="<id>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.AutoAPI.PatchAutoAutomationsById(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, auto_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = auto_api::patch_auto_automations_by_id(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AutoApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new AutoApi(client).patchAutoAutomationsById();curl -X PATCH https://api.hanzo.ai/v1/auto/automations/<id> \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": false,
"id": "<id>"
}'MCP reaches auto through the auto tool, which names its 14 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_auto_flows"
}
}
}'