Create automations

Creates an automation and arms its schedule.

POST /v1/auto/automations

Addresshttps://api.hanzo.ai/v1/auto/automations
MethodPOST
Operationpost_auto_automations
AuthAuthorization: Bearer $HANZO_API_KEY

Creates an automation and arms its schedule. It runs as the caller: their Dev run, in this org, each time it fires. name and instructions are required; no schedule runs it only on demand, no permissions is ask: it proposes what it would do and changes nothing, and enabled: false creates it off, its schedule unarmed.

Request

14 fields, body application/json (required).

FieldInTypeRequiredDescription
enabledbodyboolean—Enabled arms its schedule.
instructionsbodystring—Instructions are what the agent is asked to do each run.
modelbodystring—Model is the model id to think with.
namebodystring—Name is what it is called.
notifybodyboolean—Notify sends a one-line summary when a run ends.
permissionsbodystring—Permissions is auto (works without stopping) or ask (proposes, changes nothing).
postTobodystring[]—PostTo are the connected accounts each run's answer is posted to: x, linkedin, facebook.
projectbodystring—Project is a Dev project's slug to work in.
schedulebodyauto.Schedule—
schedule.atbodystring—At is the local time, HH:MM on a 24-hour clock, for daily, weekdays and weekly.
schedule.cronbodystring—Cron is a five-field cron expression (minute hour day-of-month month day-of-week), for kind cron only, read in TZ.
schedule.daybodystring—Day is the weekday a weekly schedule runs on: mon, tue, wed, thu, fri, sat or sun.
schedule.kindbodystring—Kind is manual, hourly, daily, weekdays, weekly or cron.
schedule.tzbodystring—TZ is the IANA time zone every time here is read in.

Response

StatusBodyMeaning
201auto.Automationcreated
defaultproblem-detailsrefused

201 body — 24 fields.

FieldInTypeAlwaysDescription
createdbodystring—Created and Updated are RFC 3339 UTC.
draftbodyboolean—Draft is a flow with no step yet: it has no instructions, never runs, and becomes an automation when its instructions are saved.
enabledbodyboolean—Enabled is whether its schedule is armed.
idbodystring—ID is the automation's id, which is also its flow's.
instructionsbodystring—Instructions are what the agent is asked to do each run.
lastbodyauto.LastRun—
last.atbodystring—
last.idbodystring—
last.statusbodystring—Status is succeeded, failed, running or queued.
last.summarybodystring—
modelbodystring—Model is the model the agent thinks with; null for the default.
namebodystring—Name is what it is called.
nextbodystring—Next is when it runs next, RFC 3339 UTC; null when manual or disabled.
notifybodyboolean—Notify sends a one-line summary to the automation's person when a run ends.
permissionsbodystring—Permissions is auto (works and uses connectors without stopping) or ask (changes nothing and ends with the actions it proposes; agent.go agentTask).
postTobodystring[]—PostTo are the connected accounts each run's answer is posted to — x, linkedin, facebook — after review when Permissions is ask (post.go).
projectbodystring—Project is the Dev project the run works in, by its slug; null for none.
schedulebodyauto.Schedule—
schedule.atbodystring—At is the local time, HH:MM on a 24-hour clock, for daily, weekdays and weekly.
schedule.cronbodystring—Cron is a five-field cron expression (minute hour day-of-month month day-of-week), for kind cron only, read in TZ.
schedule.daybodystring—Day is the weekday a weekly schedule runs on: mon, tue, wed, thu, fri, sat or sun.
schedule.kindbodystring—Kind is manual, hourly, daily, weekdays, weekly or cron.
schedule.tzbodystring—TZ is the IANA time zone every time here is read in.
updatedbodystring—

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.postAutoAutomations({ enabled: false, instructions: "<instructions>" });
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).post_auto_automations(enabled=False, instructions="<instructions>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AutoAPI.PostAutoAutomations(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::post_auto_automations(&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).postAutoAutomations();
curl -X POST https://api.hanzo.ai/v1/auto/automations \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "enabled": false,
       "instructions": "<instructions>"
     }'

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"
         }
       }
     }'

Auto API · All Hanzo APIs · Interactive reference

Was this page useful?