Overview
The Automation API surfaces Gizzi Code’s cron/routine/loop runtime through the Allternit platform API. A goal is a platform-owned objective that can own routines (persistent scheduled jobs) and loops (session-scoped recurring jobs). Routines and loops can execute locally or in the cloud via the Gizzi cron daemon.Base URL
Authentication
All automation routes require a valid bearer token. See Authentication.Data models
Goal
Routine
The local scheduler keeps these keys in
metadata:
Loop
Endpoints
Goals
Routines
Loops
Local scheduler
Create a goal
Request body
Example request
Example response
Create a routine
Request body
Example request
Example response
Routines and bots
A local routine runs as a turn in its bot’s chat, so it must have a bot.POST /routineswithoutagent_idfor a local routine returns400with{"error": "agent_required", "message": "..."}. Anagent_idthat names no agent returns400agent_not_found.- Local routines that have no bot (created before this rule) are never run. The scheduler sets
metadata.needsAgent = trueand clearsnext_run_at; the Bots UI lists them under Needs a bot.
Assign a routine to a bot
needsAgent, consecutiveFailures and autoPaused, and resets next_run_at so the scheduler arms the next run from the schedule. Other fields are unchanged. An empty agent_id means no change; a routine cannot be unassigned.
Pause, resume and automatic pause
PUT with {"status": "paused"} pauses a routine; {"status": "active"} resumes it and clears consecutiveFailures and autoPaused, so it gets 3 more tries. After 3 failed runs in a row the scheduler sets status to paused, records metadata.autoPaused, and appends a routine.paused event to the bot’s activity ledger (next to the routine.failed event for each failed run).
Trigger a routine
{"status": "running", "routineId": "...", "domain": "local"}; the result lands in the run history and the bot’s chat. A local routine with no bot returns 409 agent_required; one that is already running returns 409 already_running. Cloud routines run through the Gizzi cron daemon.
List routine runs
metadata.sessionId.
Example response
Create a loop
session_id and expires_at.
List local schedules
execution_domain is local.