Skip to main content
POST
Jobs API

Jobs API

The Jobs API provides asynchronous job management for long-running agent tasks with progress tracking and streaming.

Overview

Jobs API enables:
  • Async job submission with immediate response
  • Job status polling
  • Progress streaming via SSE
  • Job cancellation and cleanup
  • Idempotency for safe retries

When to Use

  • Long-running tasks: Tasks that take more than a few seconds
  • Background processing: Fire-and-forget with status polling
  • Progress tracking: Real-time progress updates
  • Reliable execution: Idempotent submissions

Base URL + Playground

Base URL: http://127.0.0.1:8765

Endpoints

POST /api/v1/runs

Submit a new job for async execution.
Idempotency-Key
string
Optional key to prevent duplicate submissions
prompt
string
required
The prompt/query for the agent
agent_file
string
Path to agents YAML file
agent_yaml
string
Inline agents YAML content
framework
string
default:"praisonai"
Framework to use: praisonai, crewai, autogen
config
object
Additional configuration
webhook_url
string
URL to POST results when complete
timeout
integer
default:"3600"
Timeout in seconds
session_id
string
Session ID for grouping jobs
Response (202 Accepted):
Headers:
  • Location: URL to poll for status
  • Retry-After: Suggested seconds before first poll (default: 2)

GET /api/v1/runs

List jobs with optional filters.
status
string
Filter by status: pending, running, succeeded, failed, cancelled
session_id
string
Filter by session ID
page
integer
default:"1"
Page number
page_size
integer
default:"20"
Jobs per page (max 100)
Response:

GET /api/v1/runs/

Get job status.
job_id
string
required
Job ID
Response:

GET /api/v1/runs//result

Get job result (only for completed jobs).
job_id
string
required
Job ID
Response (200 OK):
Response (409 Conflict - not complete):

POST /api/v1/runs//cancel

Cancel a running job.
job_id
string
required
Job ID
Response:

DELETE /api/v1/runs/

Delete a completed job.
job_id
string
required
Job ID
Response: 204 No Content

GET /api/v1/runs//stream

Stream job progress via SSE.
job_id
string
required
Job ID
SSE Events:

Job Status Values

Errors

Idempotency

Use Idempotency-Key header to prevent duplicate job submissions:
If the same key is used again, the existing job is returned instead of creating a new one.

Notes

  • Jobs are stored in memory by default
  • Configure persistent storage for production
  • Webhook notifications are optional
  • SSE streaming includes heartbeats every 5 seconds