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

Authentication

Send the key with either header when PRAISONAI_JOBS_API_KEY is set.
/health is the only endpoint reachable without a key. Enable the key with PRAISONAI_JOBS_API_KEY — see Async Jobs Deployment.

Endpoints

POST /api/v1/runs

Submit a new job for async execution.
string
Optional key to prevent duplicate submissions
string
required
The prompt/query for the agent
string
Path to agents YAML file
string
Inline agents YAML content
string
default:"praisonai"
Framework to use: praisonai, crewai, autogen
object
Additional configuration
string
URL to POST results when complete
integer
default:"3600"
Timeout in seconds
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.
string
Filter by status: pending, running, succeeded, failed, cancelled
string
Filter by session ID
integer
default:"1"
Page number
integer
default:"20"
Jobs per page (max 100)
Response:

GET /api/v1/runs/

Get job status.
string
required
Job ID
Response:

GET /api/v1/runs//result

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

POST /api/v1/runs//cancel

Cancel a running job.
string
required
Job ID
Response:

DELETE /api/v1/runs/

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

GET /api/v1/runs//stream

Stream job progress via SSE.
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