Skip to content
Crons

Feature

An AI agent API for creating and running scheduled agents from code

Short answer

An AI agent API lets your own software create, start and inspect AI agents instead of clicking through a dashboard. Crons offers a REST API, inbound webhooks with a shared secret, an MCP server for AI assistants and sandboxed code steps, all on Pro and Teams, so scheduled agents fit into the systems you already run.

Developer wiring a webhook in a terminal on a dual monitor setup

Four ways to drive Crons from other systems

Most teams start in the dashboard. Once a cron proves useful, they want to trigger it from their product, start it when a form is submitted, or let an AI assistant manage it. Crons gives developers four entry points, each with its own job.

Developer features and the plans that include them
FeatureWhat it doesStarterProTeams
REST API Create, update, run and read crons and run logs No Yes Yes
Inbound webhooks Start a cron when another system sends an event No Yes Yes, with IP allowlist
MCP server Let AI assistants list, create and run crons No Yes Yes
Code steps Run sandboxed JavaScript or Python inside a cron No Yes Yes
Webhooks out Send run results as JSON to your endpoint Yes Yes Yes

Everything you do through these interfaces counts against the same plan limits as the dashboard: runs, AI calls and browser minutes per billing period. Compare limits on the Crons pricing page.

The REST API for crons and runs

The REST API covers the objects you see in the dashboard. You can create a cron from a plain English description, read the parsed schedule and steps, update it, pause it, start a run with input parameters and read the full run log, including every step input, output, retry and timing. Requests authenticate with API keys you create in workspace settings and can revoke at any time.

As an illustrative example, starting a run looks like a single request such as POST /api/v1/crons/{id}/runs with a small JSON body of inputs, and the response returns a run ID you can poll or receive later through an outgoing webhook. The exact paths and fields are listed in the API reference inside your workspace.

  • Create crons from text so your product can offer scheduled agents to its own users
  • Pass inputs per run, such as a company domain or a date range
  • Read run logs to show results inside your internal tools
  • Pause and resume crons from your deploy or incident tooling

Inbound webhooks with a shared secret

Not every job belongs on a clock. An inbound webhook gives a cron its own URL. When a form tool, a billing system or your own backend sends a request to that URL, the cron starts with the request body as input. Each webhook has a secret, and requests without the matching secret are rejected and logged.

On Teams you can also restrict inbound webhooks to an IP allowlist, so only your known servers can start runs. A cron can have both a schedule and an inbound webhook, for example a weekly full review plus an instant run whenever a new enterprise lead is created in HubSpot.

The MCP server for AI assistants and MCP scheduled tasks

Crons runs an MCP server, so AI assistants that support the Model Context Protocol can work with your crons directly. From the assistant you can list crons, read the latest results, create a new cron from a sentence and start a run. This is the simplest way to get MCP scheduled tasks: the assistant hands the job to Crons, and Crons keeps running it on schedule long after the chat window is closed.

  1. 1Create an API key with the permissions the assistant should have.
  2. 2Add the Crons MCP server to your assistant with that key.
  3. 3Ask the assistant to list your crons or create one, for example "every morning summarize new support tickets tagged billing".
  4. 4Review the created cron in the dashboard, including approval gates, before it runs for real.

Approval gates still apply to anything started through MCP. An assistant can draft a customer email inside a cron, but the email waits for a person to approve it. Learn more about the agent side on the scheduled AI agents page.

Code steps when you need exact logic

AI steps are great at reading messy pages and writing summaries. Some logic should be exact, such as currency conversion, a scoring formula or reshaping a JSON payload for your warehouse. Code steps run sandboxed JavaScript or Python inside the cron, with the previous step output as input and no access to other workspaces. Their output appears in the run log like any other step.

A common pattern is fetch, AI extraction, code step for calculation, memory diff, then delivery. The code is deterministic, so the same input gives the same result every run.

Security for programmatic access

  • API keys are scoped to one workspace and can be revoked at any moment
  • Webhook secrets are shown once and can be rotated without editing the cron
  • IP allowlist for inbound webhooks on Teams
  • SSO with SAML and an audit log of workspace changes on Teams
  • Run logs record which key, webhook or assistant started each run

Read the full overview on the security page.

Frequently asked questions

Which plans include the API?

The REST API, inbound webhooks, the MCP server and code steps are included on Pro and Teams. Starter includes outgoing webhooks and all integrations.

Can I create a cron from plain English through the API?

Yes. You send the description and Crons returns the parsed schedule and steps, the same way the dashboard does. You can then adjust and activate it.

How are inbound webhooks protected?

Each webhook has its own secret and requests without it are rejected and logged. On Teams you can add an IP allowlist.

What can an AI assistant do through the MCP server?

It can list crons, read recent results, create a cron from a description and start a run. Approval gates still apply to any critical step.

Do API runs count toward plan limits?

Yes. Runs, AI calls and browser minutes count the same way whether a run starts from the schedule, the dashboard, a webhook, the API or MCP.

Which languages can code steps use?

Code steps run sandboxed JavaScript or Python on Pro and Teams.

Related pages

Run scheduled agents from your own code

Create your account, pick Pro or Teams and generate your first API key.

See pricing
Build my cron