Create cron

Reads a schedule said in words — "every 5 minutes", "weekdays at 8:30", "every monday at 9am", "tomorrow at 7pm", "in 20 minutes", or a five-field cron expression — in your time zone, and answers the schedule an automation takes, said back in plain words, with when it would first run.

POST /v1/auto/cron

Addresshttps://api.hanzo.ai/v1/auto/cron
MethodPOST
Operationpost_auto_cron
AuthAuthorization: Bearer $HANZO_API_KEY

Reads a schedule said in words — "every 5 minutes", "weekdays at 8:30", "every monday at 9am", "tomorrow at 7pm", "in 20 minutes", or a five-field cron expression — in your time zone, and answers the schedule an automation takes, said back in plain words, with when it would first run. Nothing is created: send the schedule to POST /v1/auto/automations. A phrase that no rule reads is read by a model; a phrase that names no schedule answers 422.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
textbodystring—Text is when it runs, as a person says it: "every monday at 9am".
tzbodystring—TZ is the IANA zone the words are read in.

Response

StatusBodyMeaning
200auto.whenOutok
defaultproblem-detailsrefused

200 body — 8 fields.

FieldInTypeAlwaysDescription
nextbodystring—Next is when it would first run, RFC 3339 UTC; null when it runs only on demand.
saysbodystring—Says is the schedule said back in plain words.
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, cron or once.
schedule.tzbodystring—TZ is the IANA time zone every time here is read in.

Failure carries the platform error shape — see Errors.

Examples

hanzo auto cron
import { Configuration, AutoApi } from 'hanzoai';

const api = new AutoApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postAutoCron({ text: "<text>", tz: "<tz>" });
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_cron(text="<text>", tz="<tz>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AutoAPI.PostAutoCron(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_cron(&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).postAutoCron();
curl -X POST https://api.hanzo.ai/v1/auto/cron \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "text": "<text>",
       "tz": "<tz>"
     }'

MCP reaches auto through the auto tool, which names its 26 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_automations"
         }
       }
     }'

Auto API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.