Skip to content

Recurring Jobs (Daily Tasks)

A Recurring Job (“daily task”) runs a prompt on a schedule, optionally delivering results by email. Use it to keep a daily content-ideas digest flowing, schedule weekly competitor scans, or any other prompt you’d otherwise type into chat each day.

Base URL: https://agent.gen.pro/v1

Same as the rest of the API: pass your API key in the X-API-Key header. JWT authentication (Authorization: Bearer <token>) is also supported. See Authentication for how to mint an API key.

Agent ── RecurringJob "daily ideas" (status=active)
├── job_type: generate_content_ideas
├── prompt: "Generate 5 content ideas"
├── schedule: daily @ 09:00 UTC
├── delivery: chat_only
└── runs at next_run_at → bills against credits → updates last_run_at
  • schedule.cadencedaily, weekly.
  • schedule.days_of_week — array of 06 (0=Mon … 6=Sun). Required when cadence is weekly; omit for daily.
  • delivery.typechat_only, email.
  • delivery.email — recipient address. Required when type is email; omit for chat_only.
  • statusactive, paused, deleted.
  • Management calls are free. Each scheduled run bills at execution time using standard per-job pricing for the relevant job_type. If the workspace has no credits when a run fires, the run is skipped and the job remains scheduled — no deletion, no email — and execution resumes automatically when credits return.

List the agent’s non-deleted recurring jobs (active + paused), newest first.

Terminal window
curl "https://agent.gen.pro/v1/agents/$AGENT_ID/recurring-jobs" \
-H "X-API-Key: $GEN_API_KEY"
import { gen } from "@poweredbygen/gen-sdk";
const { sdk } = gen({ apiKey: process.env.GEN_API_KEY! });
const { recurring_jobs } = await sdk.monitoring.listRecurringJobs(agentId);

POST /v1/agents/:agent_id/recurring-jobs/defaults

Section titled “POST /v1/agents/:agent_id/recurring-jobs/defaults”

Idempotently ensure the agent has the default daily content-ideas job. Returns the existing one if present, otherwise creates it (daily @ 09:00 UTC, chat_only).

Terminal window
curl -X POST "https://agent.gen.pro/v1/agents/$AGENT_ID/recurring-jobs/defaults" \
-H "X-API-Key: $GEN_API_KEY"
const { recurring_jobs, created } = await sdk.monitoring.ensureDefaultRecurringJob(agentId);

Response:

{ "recurring_jobs": [ { ...RecurringJob } ], "created": true }

created is true for a fresh job, false if an existing default job was returned.

Create a custom recurring job.

Terminal window
curl -X POST "https://agent.gen.pro/v1/agents/$AGENT_ID/recurring-jobs" \
-H "X-API-Key: $GEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "weekly retention digest",
"job_type": "generate_content_ideas",
"prompt": "Give me 5 retention-focused hook patterns trending this week",
"schedule": { "cadence": "weekly", "timezone": "America/Los_Angeles", "time_of_day": "09:00", "days_of_week": [0] },
"delivery": { "type": "email", "email": "you@example.com" }
}'
const job = await sdk.monitoring.createRecurringJob(agentId, {
name: "weekly retention digest",
job_type: "generate_content_ideas",
prompt: "Give me 5 retention-focused hook patterns trending this week",
schedule: { cadence: "weekly", timezone: "America/Los_Angeles", time_of_day: "09:00", days_of_week: [0] },
delivery: { type: "email", email: "you@example.com" },
});

Request body:

FieldTypeRequiredDescription
namestringnoDisplay name. Defaults to first 80 chars of prompt.
job_typestringyesJob type. "generate_content_ideas" is the standard default.
promptstringyesNatural-language instruction the agent runs each cycle.
schedule.cadence"daily" | "weekly"yesHow often to run.
schedule.timezonestringyesIANA timezone (e.g. "UTC", "America/Los_Angeles").
schedule.time_of_daystringconditional"HH:MM" 24h local time. Required for daily/weekly cadences.
schedule.days_of_weekinteger[]conditionalDays to run, 06 (0=Mon … 6=Sun). Required when cadence is "weekly"; must be omitted for "daily". No duplicates.
delivery.type"chat_only" | "email"yesWhere to send results.
delivery.emailstringconditionalRecipient address. Required when type is "email"; must be omitted for "chat_only".
next_run_atISO-8601noOverride the first-run timestamp.

GET /v1/agents/:agent_id/recurring-jobs/:job_id

Section titled “GET /v1/agents/:agent_id/recurring-jobs/:job_id”

Fetch one recurring job by id. Returns 404 if deleted.

PATCH /v1/agents/:agent_id/recurring-jobs/:job_id

Section titled “PATCH /v1/agents/:agent_id/recurring-jobs/:job_id”

Update mutable fields. Pass schedule or delivery as a full object — it replaces the existing value.

Terminal window
curl -X PATCH "https://agent.gen.pro/v1/agents/$AGENT_ID/recurring-jobs/$JOB_ID" \
-H "X-API-Key: $GEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Give me 10 hook patterns instead of 5",
"schedule": { "cadence": "weekly", "timezone": "America/Los_Angeles", "time_of_day": "08:00", "days_of_week": [0] }
}'

Updatable fields: name, prompt, schedule, delivery, next_run_at. Use the pause/resume endpoints to change status.

POST /v1/agents/:agent_id/recurring-jobs/:job_id/pause

Section titled “POST /v1/agents/:agent_id/recurring-jobs/:job_id/pause”

Pause the job. status → "paused". The scheduler stops queueing runs; history and configuration are preserved.

Terminal window
curl -X POST "https://agent.gen.pro/v1/agents/$AGENT_ID/recurring-jobs/$JOB_ID/pause" \
-H "X-API-Key: $GEN_API_KEY"
await sdk.monitoring.pauseRecurringJob(agentId, jobId);

POST /v1/agents/:agent_id/recurring-jobs/:job_id/resume

Section titled “POST /v1/agents/:agent_id/recurring-jobs/:job_id/resume”

Resume the job. status → "active".

DELETE /v1/agents/:agent_id/recurring-jobs/:job_id

Section titled “DELETE /v1/agents/:agent_id/recurring-jobs/:job_id”

Soft-delete. status → "deleted". Use pause for reversible stops.

Returns 204 No Content on success.

{
"id": "uuid",
"user_id": 11,
"agent_id": "uuid",
"name": "weekly retention digest",
"job_type": "generate_content_ideas",
"prompt": "Give me 5 retention-focused hook patterns trending this week",
"schedule": {
"cadence": "weekly",
"timezone": "America/Los_Angeles",
"time_of_day": "09:00",
"days_of_week": [0]
},
"delivery": { "type": "email", "email": "you@example.com" },
"status": "active",
"next_run_at": "2026-06-03T16:00:00Z",
"last_run_at": null,
"created_at": "2026-05-27T19:00:00Z",
"updated_at": "2026-05-27T19:00:00Z"
}
StatusCodeDescription
401unauthorizedMissing or invalid API key
404not_foundAgent or recurring job not found / deleted
422validation_errorRequest body failed validation