Skip to main content
A Task is a standing instruction you give Crevio’s AI: a prompt, an agent, a schedule, and an autonomy level — persisted on your account and run automatically. Where a single API call does one thing once, a Task does it on the trigger you choose (now, on an interval, on a cron schedule, once at a time, or whenever an event fires) and records every execution as a Task Run you can inspect, approve, or feed input into. This is how the agent becomes a workforce instead of a one-shot tool. Tasks have the prefix task_ (object type task); runs have the prefix trun_ (object type task_run).
Tasks consume credits. Every run is one or more AI operations (messages, media generation, web research, calls), all metered pay-per-call. The Task object tracks lifetime spend in total_credits_consumed; each run reports its own credits_consumed. Check your balance with GET /usage.

Anatomy of a Task

POST /v1/tasks accepts these fields (params are top-level — no task wrapper):
string
The task’s display name.
string
An optional human description.
string
required
What you want the agent to do — the instruction it runs every time.
enum
required
One of immediate, cron, interval, once, event. See below.
enum
business (default) or engineering. Business operates your account through the API; engineering writes and ships code on a Site.
enum
autonomous, supervised, or read_only. Controls how much human oversight each run requires.
array
Where results are delivered: any of notification, email, telegram, discord, slack.
object
For event triggers: filters that must match the incoming event for the task to fire. See Events.
string
The Site (site_...) the task works on. Its repo is mounted as the agent’s workspace. Defaults to your account’s default site. Most relevant for the engineering agent.
string
Override the model used for the run.
string
Cron schedule (for trigger_type: cron).
integer
Seconds between runs (for trigger_type: interval).
date-time
When to run (for trigger_type: once).
string
Timezone for cron/scheduled_at, e.g. America/New_York.
date-time
After this time the task stops running.
boolean
Whether the task is enabled. Set false to pause without deleting.
A created Task also returns scheduling and accounting state: next_run_at, last_run_at, total_runs_count, consecutive_failure_count, and total_credits_consumed.

Choosing an agent

Triggers

trigger_type decides when a task runs. There are five, each with its own scheduling field.

immediate — run once, right now

Fires a single run the moment you create the task. Good for kicking off ad-hoc work asynchronously.

cron — run on a cron schedule

Recurring, calendar-based. Pair cron_expression with a timezone.

interval — run every N seconds

Fixed cadence, independent of the wall clock. Set interval_seconds.

once — run a single time at a future moment

Schedule a one-off with scheduled_at.

event — run when something happens

The task lies dormant until a matching event fires (e.g. order.paid). Constrain which events trigger it with event_conditions.
See the Events guide for the full list of subscribable events and how event_conditions works.

Autonomy: approval_mode

approval_mode is the human-in-the-loop dial. It decides whether a run can act on its own, must pause for your approval, or can only observe.

The supervised loop

A supervised run pauses instead of acting, which fires the task_run.needs_input webhook event (and notifies you via your delivery_methods). You review it in the Crevio dashboard — approving the pending action or giving the agent direction — and it resumes from where it stopped. The cycle:
1

Run starts and reaches a checkpoint

The agent does its work until it hits an action that needs approval (or it needs information from you).
2

Run pauses in needs_input

The Task Run status becomes needs_input; task_run.needs_input fires and you’re notified.
3

You review and respond in the dashboard

Approve the pending action or give the agent more direction from the Crevio dashboard or notification. (Over the API you can read run state and update its status/summary — see below.)
4

Run resumes

The agent continues from the checkpoint and completes (or pauses again at the next one).

Task Runs

Each execution of a Task is a Task Run (trun_, object type task_run). Runs are read-mostly: you list and get them to inspect what happened, and PATCH them to update their status/summary.

The run object

List and get runs

List responses use the standard envelope: { "object": "list", "data": [...], "has_more": bool }.

Updating a run’s state

PATCH /v1/task_runs/{id} updates a run’s state. The body accepts:
enum
pending, running, completed, failed, or needs_input.
string | null
The run’s summary text.
string | null
An error message for a failed run.
integer
Recorded input token count.
integer
Recorded output token count.
For a run paused in needs_input, you resume or close it out by PATCHing status (and optionally summary/error_message) — for example set status to running to release it, or to completed/failed to close it.
The API lets you read run state and update status/summary — there is no field for sending free-form instructions back to the agent. The interactive back-and-forth for a supervised run (approving a pending action or giving the agent more direction in plain English) happens in the Crevio dashboard and notifications, not over the API.
Don’t poll for paused runs — subscribe to the task_run.needs_input, task_run.completed, and task_run.failed webhook events and react as they arrive.

Managing tasks

A delete returns { "id": "task_abc123", "object": "task", "deleted": true }.

Limits

Every value below is also returned live by GET /v1/status under limits, so you can read the current numbers rather than hard-coding these.

Concurrency

“Active” means pending, running, or needs_input — a run parked on an approval still occupies its slot, so resolve or cancel it to free capacity.

Runtime

A turn itself is deliberately uncapped below that 4-hour ceiling — a site build can legitimately run for a long time. The ceiling exists so a wedged run can’t spin forever, and it is reported as timed_out rather than failed so you can tell “it never finished” from “it broke”.

Truncation

Values a run produces are bounded before they reach the model, so a large result is trimmed rather than rejected:

Next steps

Events & Event Sources

Fire event-Tasks from internal events and third-party apps.

AI & Agents overview

How Tasks fit into Crevio’s broader agentic model.

Webhooks

Get notified when runs complete, fail, or need your input.

Usage & credits

See how task runs are metered and check your balance.