For the complete documentation index, see llms.txt. This page is also available as Markdown.

Background Jobs

Preview Cron

post

Validate a CRON expression and return the next 5 fire times.

Used by the Job Creation wizard's "Schedule" step so the user can sanity check the schedule before submitting.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Header parameters
authorizationstring · nullableOptional
Body
cron_expressionstringRequired

5-field CRON: 'minute hour dom month dow'.

timezonestringOptional

IANA tz name used to render the next-run timestamps.

Default: UTC
Responses
200

Successful Response

application/json
validbooleanRequired
errorstring · nullableOptional
human_readablestring · nullableOptional
next_runsstring[]Optional

ISO-8601 timestamps in the requested timezone.

min_interval_minutesintegerOptionalDefault: 5
suggestionstring · nullableOptional
post/api/v1/background_jobs/cron/preview
POST /api/v1/background_jobs/cron/preview HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "cron_expression": "text",
  "timezone": "UTC"
}
{
  "valid": true,
  "error": "text",
  "human_readable": "text",
  "next_runs": [
    "text"
  ],
  "min_interval_minutes": 5,
  "suggestion": "text"
}

Can Create Background Job Endpoint

get

Whether the caller's role can create / trigger background jobs.

Used by the FE to gate the "Schedule a job" entry points (wizard starter button, Run-now / Edit actions, etc.). Returns true for admins, "Power user", and any custom role with can_create_background_job=true.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json

Whether the caller is allowed to create / trigger background jobs.

Field name mirrors CustomAgentSubmitResponse.submitAgent so the FE has a consistent "permission probe" shape across features.

canCreateBackgroundJobbooleanRequired
get/api/v1/background_jobs/user/can-create
GET /api/v1/background_jobs/user/can-create HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "canCreateBackgroundJob": true
}

List Background Jobs Endpoint

get

List jobs in a project.

By default returns only the caller's jobs (matches the LLM tool's behaviour). Pass mine_only=false to see all jobs in the project (useful for project-admin views and the Admin Console).

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Query parameters
project_idintegerRequired

Project whose jobs to list.

mine_onlybooleanOptional

If true, return only the caller's jobs.

Default: true
include_removedbooleanOptional

Include removed jobs.

Default: false
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
totalintegerRequired
get/api/v1/background_jobs
GET /api/v1/background_jobs?project_id=1 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "jobs": [
    {
      "job_id": "text",
      "project_id": 1,
      "project_name": "text",
      "name": "text",
      "agent_name": "text",
      "prompt": "text",
      "trigger_type": "text",
      "cron_expression": "text",
      "timezone": "text",
      "status": "text",
      "creator_username": "text",
      "created_at": "2026-01-01T00:00:00.000Z",
      "last_run_at": "2026-01-01T00:00:00.000Z",
      "last_run_status": "text",
      "last_conversation_id": 1,
      "next_run_at": "2026-01-01T00:00:00.000Z",
      "unread_count": 0,
      "notification_channels": [
        "text"
      ],
      "slack_channel_ids": [
        "text"
      ]
    }
  ],
  "total": 1
}

Create Background Job

post

Create a recurring background job.

Validates the agent + CRON + project membership, persists the row, then registers the schedule in redbeat. Same code path the LLM tool uses.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Header parameters
authorizationstring · nullableOptional
Body
project_idintegerRequired
agent_namestringRequired
promptstring · min: 1 · max: 4000Required
cron_expressionstringRequired
timezonestringOptionalDefault: UTC
namestring · max: 100 · nullableOptional
notification_channelsstring[] · nullableOptional
slack_channel_idsstring[] · nullableOptional
Responses
201

Successful Response

application/json
job_idstringRequired
project_idintegerRequired
project_namestring · nullableOptional
namestring · nullableRequired
agent_namestringRequired
promptstringRequired
trigger_typestring · nullableOptional
cron_expressionstring · nullableOptional
timezonestringRequired
statusstringRequired
creator_usernamestringRequired
created_atstring · date-time · nullableRequired
last_run_atstring · date-time · nullableRequired
last_run_statusstring · nullableRequired
last_conversation_idinteger · nullableRequired
next_run_atstring · date-time · nullableOptional
unread_countintegerOptionalDefault: 0
notification_channelsstring[]Optional
slack_channel_idsstring[]Optional
post/api/v1/background_jobs
POST /api/v1/background_jobs HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 170

{
  "project_id": 1,
  "agent_name": "text",
  "prompt": "text",
  "cron_expression": "text",
  "timezone": "UTC",
  "name": "text",
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}
{
  "job_id": "text",
  "project_id": 1,
  "project_name": "text",
  "name": "text",
  "agent_name": "text",
  "prompt": "text",
  "trigger_type": "text",
  "cron_expression": "text",
  "timezone": "text",
  "status": "text",
  "creator_username": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "last_run_status": "text",
  "last_conversation_id": 1,
  "next_run_at": "2026-01-01T00:00:00.000Z",
  "unread_count": 0,
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}

Admin List All Background Jobs

get

List every background job across all projects with project names.

Role-aware (matches the Data Connectors pattern):

  • Admins see every job in the system.

  • Non-admins see only the jobs they created — across every project they're a member of.

The endpoint path stays /admin/all for backwards compatibility with the existing FE hook; the gating moved from "is admin?" to "filter by creator for non-admins".

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Query parameters
include_removedbooleanOptional

Include removed jobs.

Default: false
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
totalintegerRequired
get/api/v1/background_jobs/admin/all
GET /api/v1/background_jobs/admin/all HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "jobs": [
    {
      "job_id": "text",
      "project_id": 1,
      "project_name": "text",
      "name": "text",
      "agent_name": "text",
      "prompt": "text",
      "trigger_type": "text",
      "cron_expression": "text",
      "timezone": "text",
      "status": "text",
      "creator_username": "text",
      "created_at": "2026-01-01T00:00:00.000Z",
      "last_run_at": "2026-01-01T00:00:00.000Z",
      "last_run_status": "text",
      "last_conversation_id": 1,
      "next_run_at": "2026-01-01T00:00:00.000Z",
      "unread_count": 0,
      "notification_channels": [
        "text"
      ],
      "slack_channel_ids": [
        "text"
      ]
    }
  ],
  "total": 1
}

Get Background Job

get

Fetch a single job. Accessible to any member of the job's project.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
job_idstringRequired
project_idintegerRequired
project_namestring · nullableOptional
namestring · nullableRequired
agent_namestringRequired
promptstringRequired
trigger_typestring · nullableOptional
cron_expressionstring · nullableOptional
timezonestringRequired
statusstringRequired
creator_usernamestringRequired
created_atstring · date-time · nullableRequired
last_run_atstring · date-time · nullableRequired
last_run_statusstring · nullableRequired
last_conversation_idinteger · nullableRequired
next_run_atstring · date-time · nullableOptional
unread_countintegerOptionalDefault: 0
notification_channelsstring[]Optional
slack_channel_idsstring[]Optional
get/api/v1/background_jobs/{job_id}
GET /api/v1/background_jobs/{job_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "job_id": "text",
  "project_id": 1,
  "project_name": "text",
  "name": "text",
  "agent_name": "text",
  "prompt": "text",
  "trigger_type": "text",
  "cron_expression": "text",
  "timezone": "text",
  "status": "text",
  "creator_username": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "last_run_status": "text",
  "last_conversation_id": 1,
  "next_run_at": "2026-01-01T00:00:00.000Z",
  "unread_count": 0,
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}

Remove Background Job Endpoint

delete

Permanently remove a job. Unregisters the schedule, marks the job row removed (soft delete for audit), and hard-deletes the result conversation so it disappears from the sidebar and the conversations table.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
job_idstringRequired
project_idintegerRequired
project_namestring · nullableOptional
namestring · nullableRequired
agent_namestringRequired
promptstringRequired
trigger_typestring · nullableOptional
cron_expressionstring · nullableOptional
timezonestringRequired
statusstringRequired
creator_usernamestringRequired
created_atstring · date-time · nullableRequired
last_run_atstring · date-time · nullableRequired
last_run_statusstring · nullableRequired
last_conversation_idinteger · nullableRequired
next_run_atstring · date-time · nullableOptional
unread_countintegerOptionalDefault: 0
notification_channelsstring[]Optional
slack_channel_idsstring[]Optional
delete/api/v1/background_jobs/{job_id}
DELETE /api/v1/background_jobs/{job_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "job_id": "text",
  "project_id": 1,
  "project_name": "text",
  "name": "text",
  "agent_name": "text",
  "prompt": "text",
  "trigger_type": "text",
  "cron_expression": "text",
  "timezone": "text",
  "status": "text",
  "creator_username": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "last_run_status": "text",
  "last_conversation_id": 1,
  "next_run_at": "2026-01-01T00:00:00.000Z",
  "unread_count": 0,
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}

Update Background Job

patch

Edit an existing background job.

Only fields included in the request body are modified. If trigger_type or cron_expression changes, the redbeat entry is updated automatically. Switching to 'manual' unregisters the schedule; switching to 'scheduled' re-registers it with the new (or existing) cron expression.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
Header parameters
authorizationstring · nullableOptional
Body
namestring · max: 100 · nullableOptional
promptstring · min: 1 · max: 4000 · nullableOptional
agent_namestring · nullableOptional
trigger_typestring · nullableOptional
cron_expressionstring · nullableOptional
timezonestring · nullableOptional
notification_channelsstring[] · nullableOptional
slack_channel_idsstring[] · nullableOptional
Responses
200

Successful Response

application/json
job_idstringRequired
project_idintegerRequired
project_namestring · nullableOptional
namestring · nullableRequired
agent_namestringRequired
promptstringRequired
trigger_typestring · nullableOptional
cron_expressionstring · nullableOptional
timezonestringRequired
statusstringRequired
creator_usernamestringRequired
created_atstring · date-time · nullableRequired
last_run_atstring · date-time · nullableRequired
last_run_statusstring · nullableRequired
last_conversation_idinteger · nullableRequired
next_run_atstring · date-time · nullableOptional
unread_countintegerOptionalDefault: 0
notification_channelsstring[]Optional
slack_channel_idsstring[]Optional
patch/api/v1/background_jobs/{job_id}
PATCH /api/v1/background_jobs/{job_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 178

{
  "name": "text",
  "prompt": "text",
  "agent_name": "text",
  "trigger_type": "text",
  "cron_expression": "text",
  "timezone": "text",
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}
{
  "job_id": "text",
  "project_id": 1,
  "project_name": "text",
  "name": "text",
  "agent_name": "text",
  "prompt": "text",
  "trigger_type": "text",
  "cron_expression": "text",
  "timezone": "text",
  "status": "text",
  "creator_username": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "last_run_status": "text",
  "last_conversation_id": 1,
  "next_run_at": "2026-01-01T00:00:00.000Z",
  "unread_count": 0,
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}

Run Background Job Now

post

Trigger an immediate one-off run of an existing job.

Backs the "Run now" button on the success card and the Admin Console. Enqueues the same Celery task that the CRON schedule fires; the task holds its own Redis lock per job_id so concurrent triggers are naturally serialized.

Valid for both scheduled and manual jobs. A removed job is not runnable.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
anyOptional
post/api/v1/background_jobs/{job_id}/run-now
POST /api/v1/background_jobs/{job_id}/run-now HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Pause Background Job Endpoint

post

Pause an active job — unregisters the redbeat entry; the DB row is preserved so the job can be resumed later. No-op if already paused.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
job_idstringRequired
project_idintegerRequired
project_namestring · nullableOptional
namestring · nullableRequired
agent_namestringRequired
promptstringRequired
trigger_typestring · nullableOptional
cron_expressionstring · nullableOptional
timezonestringRequired
statusstringRequired
creator_usernamestringRequired
created_atstring · date-time · nullableRequired
last_run_atstring · date-time · nullableRequired
last_run_statusstring · nullableRequired
last_conversation_idinteger · nullableRequired
next_run_atstring · date-time · nullableOptional
unread_countintegerOptionalDefault: 0
notification_channelsstring[]Optional
slack_channel_idsstring[]Optional
post/api/v1/background_jobs/{job_id}/pause
POST /api/v1/background_jobs/{job_id}/pause HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "job_id": "text",
  "project_id": 1,
  "project_name": "text",
  "name": "text",
  "agent_name": "text",
  "prompt": "text",
  "trigger_type": "text",
  "cron_expression": "text",
  "timezone": "text",
  "status": "text",
  "creator_username": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "last_run_status": "text",
  "last_conversation_id": 1,
  "next_run_at": "2026-01-01T00:00:00.000Z",
  "unread_count": 0,
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}

Resume Background Job Endpoint

post

Resume a paused job — re-registers it in redbeat using its stored cron_expression. No-op if already active.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
job_idstringRequired
project_idintegerRequired
project_namestring · nullableOptional
namestring · nullableRequired
agent_namestringRequired
promptstringRequired
trigger_typestring · nullableOptional
cron_expressionstring · nullableOptional
timezonestringRequired
statusstringRequired
creator_usernamestringRequired
created_atstring · date-time · nullableRequired
last_run_atstring · date-time · nullableRequired
last_run_statusstring · nullableRequired
last_conversation_idinteger · nullableRequired
next_run_atstring · date-time · nullableOptional
unread_countintegerOptionalDefault: 0
notification_channelsstring[]Optional
slack_channel_idsstring[]Optional
post/api/v1/background_jobs/{job_id}/resume
POST /api/v1/background_jobs/{job_id}/resume HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "job_id": "text",
  "project_id": 1,
  "project_name": "text",
  "name": "text",
  "agent_name": "text",
  "prompt": "text",
  "trigger_type": "text",
  "cron_expression": "text",
  "timezone": "text",
  "status": "text",
  "creator_username": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "last_run_status": "text",
  "last_conversation_id": 1,
  "next_run_at": "2026-01-01T00:00:00.000Z",
  "unread_count": 0,
  "notification_channels": [
    "text"
  ],
  "slack_channel_ids": [
    "text"
  ]
}

List Background Job Runs

get

List a job's runs and basic aggregates.

Backs the Job Detail screen: the "Execution history" table plus the Total runs / Success rate / Average duration stat cards. Each run row is derived from a single assistant message in the job's result conversation that carries a background_job_run card.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json
job_idstringRequired
total_runsintegerRequired
succeeded_runsintegerRequired
failed_runsintegerRequired
skipped_runsintegerRequired
success_ratenumber · nullableOptional

Ratio of succeeded runs to runs with a definite outcome (succeeded + failed). None if there have been no such runs yet.

avg_duration_secondsnumber · nullableOptional

Mean wall-clock duration over runs that reported one.

get/api/v1/background_jobs/{job_id}/runs
GET /api/v1/background_jobs/{job_id}/runs HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "job_id": "text",
  "runs": [
    {
      "message_id": 1,
      "run_at": "2026-01-01T00:00:00.000Z",
      "status": "text",
      "duration_seconds": 1,
      "total_tokens": 1,
      "reason": "text"
    }
  ],
  "total_runs": 1,
  "succeeded_runs": 1,
  "failed_runs": 1,
  "skipped_runs": 1,
  "success_rate": 1,
  "avg_duration_seconds": 1
}

Get Background Job Run

get

Fetch a single run's metadata and output.

Backs the Run Detail screen (Run #N). message_id is the id of the assistant message that holds the run's card and output — the same handle returned by list_background_job_runs.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idstringRequired
message_idintegerRequired
Header parameters
authorizationstring · nullableOptional
Responses
200

Successful Response

application/json

Single-run payload — backs the Run Detail screen.

job_idstringRequired
message_idintegerRequired
run_atstring · date-time · nullableOptional
statusstringRequired
duration_secondsnumber · nullableOptional
outputstringOptionalDefault: ""
reasonstring · nullableOptional
get/api/v1/background_jobs/{job_id}/runs/{message_id}
GET /api/v1/background_jobs/{job_id}/runs/{message_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "job_id": "text",
  "message_id": 1,
  "run_at": "2026-01-01T00:00:00.000Z",
  "status": "text",
  "duration_seconds": 1,
  "output": "",
  "ui_resources": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "timeline": [
    {
      "phase": "text",
      "at": "2026-01-01T00:00:00.000Z",
      "name": "text",
      "status": "text",
      "error": "text"
    }
  ],
  "usage": {
    "total_tokens": 1,
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "iterations": 0,
    "mcp_connectors_used": [
      "text"
    ],
    "kb_files_used": [
      "text"
    ]
  },
  "reason": "text"
}

Last updated