Gen-Endpoint
Back to API List
Background Jobs API
Queue and monitor long-running background tasks with progress tracking and retry logic.
System
Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the Background Jobs API. These API routes are live! The paths shown below are relative to your application's base URL. For example, if this application is hosted at https://gen-endpoint.com, an endpoint path for this API, such as /api/jobs, would be accessible at https://gen-endpoint.com/api/jobs. You can use the "Try it out" section for each endpoint or use tools like curl, Postman, or your browser's address bar (for GET requests) to interact with them.
POST

/api/jobs

Queue new background job with parameters.

Show Static Examples

Example Request Body:

{
  "type": "data_export",
  "parameters": {
    "format": "csv",
    "entity": "users",
    "filters": {"role": "admin"}
  },
  "priority": "normal",
  "scheduledAt": "2024-08-16T13:00:00Z"
}

Example Response:

{
  "id": "job_789",
  "type": "data_export",
  "status": "queued",
  "priority": "normal",
  "queuePosition": 3,
  "estimatedStartTime": "2024-08-16T12:05:00Z"
}
Try it out
GET

/api/jobs/{jobId}

Get job status, progress, and results. Replace {jobId} with an actual ID.

Show Static Examples

Example Response:

{
  "id": "job_789",
  "type": "data_export",
  "status": "completed",
  "progress": 100,
  "startedAt": "2024-08-16T12:03:00Z",
  "completedAt": "2024-08-16T12:08:00Z",
  "result": {
    "downloadUrl": "/api/downloads/export_789.csv",
    "recordsProcessed": 1500
  }
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

GET

/api/jobs

List jobs with status filtering and pagination.

Show Static Examples

Example Request Parameters:

?status=running&type=data_export&page=1&limit=20

Example Response:

{
  "jobs": [
    {
      "id": "job_790",
      "type": "data_export",
      "status": "running",
      "progress": 45,
      "startedAt": "2024-08-16T12:10:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 156
  }
}
Try it out

You can add or change query parameters in the path above (e.g., ?name=User).

DELETE

/api/jobs/{jobId}

Cancel queued or running job. Replace {jobId} with an actual ID.

Show Static Examples

Example Response:

{
  "id": "job_791",
  "status": "cancelled",
  "cancelledAt": "2024-08-16T12:15:00Z",
  "reason": "user_requested"
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.