Job Management
Section titled “Job Management”Job management endpoints let you monitor, inspect, and control asynchronous cURL jobs submitted with mode=async. Use these endpoints to list running and historical jobs, inspect individual job state, retrieve completed response bodies, or cancel pending and running jobs. Each job progresses through five states: pending, running, completed, failed, or cancelled.
GET /api/v1/curl/jobs
Section titled “GET /api/v1/curl/jobs”Retrieve a paginated list of all async jobs, sorted by creation time (newest first). Use this endpoint to monitor long-running downloads, track concurrent requests, audit historical activity, or identify failed jobs for retry.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | No | 1-based page number |
limit | query | integer | No | Items per page (current handler returns all items when omitted) |
Example Request
Section titled “Example Request”curl -X GET 'https://api.hoody.com/api/v1/curl/jobs?page=1&limit=20' \ -H 'Authorization: Bearer <your-api-token>'const jobs = client.curl.jobs.listIterator({ page: 1, limit: 20,});
for await (const job of jobs) { console.log(job.id, job.status);}Response
Section titled “Response”{ "items": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "status": "completed", "url": "https://api.example.com/v1/customers", "method": "POST", "name": "fetch-customer-data", "created_at": "2026-01-15T10:30:00Z", "completed_at": "2026-01-15T10:30:05Z" }, { "id": "660e8400-e29b-41d4-a716-446655440001", "status": "running", "url": "https://api.example.com/v1/exports/large", "method": "GET", "name": null, "created_at": "2026-01-15T10:29:00Z", "completed_at": null }, { "id": "770e8400-e29b-41d4-a716-446655440002", "status": "pending", "url": "https://api.example.com/v1/reports", "method": "GET", "name": "daily-report", "created_at": "2026-01-15T10:28:30Z", "completed_at": null } ], "meta": { "total": 42, "page": 1, "limit": 20 }}{ "error": "STORAGE_ERROR", "message": "Failed to read jobs from storage"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
STORAGE_ERROR | Storage read failed | Unable to read jobs from persistent storage | Verify storage directory permissions and disk space availability |
GET /api/v1/curl/jobs/{id}
Section titled “GET /api/v1/curl/jobs/{id}”Retrieve complete details for a single job including the original request configuration, current status, response data (if completed), and execution metadata. Use this endpoint to poll job progress or retrieve the full result after completion.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique job identifier (UUID format) |
Example Request
Section titled “Example Request”curl -X GET 'https://api.hoody.com/api/v1/curl/jobs/550e8400-e29b-41d4-a716-446655440000' \ -H 'Authorization: Bearer <your-api-token>'const job = await client.curl.jobs.get( "550e8400-e29b-41d4-a716-446655440000");
console.log(job.status, job.response);Response
Section titled “Response”{ "id": "550e8400-e29b-41d4-a716-446655440000", "status": "completed", "name": "fetch-customer-data", "session_id": "sess-abc123", "created_at": "2026-01-15T10:30:00Z", "started_at": "2026-01-15T10:30:01Z", "completed_at": "2026-01-15T10:30:05Z", "retry_count": 0, "retry_attempts": 1, "error": null, "request": { "url": "https://api.example.com/v1/customers", "method": "POST", "mode": "async", "headers": { "Content-Type": "application/json" }, "data": "{\"query\": \"active\"}" }, "response": { "status_code": 200, "headers": { "Content-Type": "application/json" }, "body": [123, 34, 115, 116, 97, 116, 117, 115, 34, 58, 32, 34, 111, 107, 34, 125], "total_time": 3.42, "namelookup_time": 0.012, "connect_time": 0.045, "pretransfer_time": 0.046, "starttransfer_time": 3.4, "redirect_time": 0, "redirect_count": 0, "size_download": 17, "size_upload": 17, "speed_download": 4.97, "speed_upload": 4.97, "effective_url": "https://api.example.com/v1/customers" }}{ "error": "JOB_NOT_FOUND", "message": "Job not found"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
JOB_NOT_FOUND | Job does not exist | No job exists with the provided ID | Verify job ID from listJobs, or check if job was deleted |
{ "error": "STORAGE_ERROR", "message": "Failed to read job data"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
STORAGE_ERROR | Storage read failed | Unable to read job data from storage | Check storage permissions and retry operation |
GET /api/v1/curl/jobs/{id}/result
Section titled “GET /api/v1/curl/jobs/{id}/result”Retrieve the raw HTTP response body from a completed job in transparent mode. Returns the exact response received from the target server, preserving original headers. The job must have completed successfully before the result is available.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique job identifier (UUID format) |
Example Request
Section titled “Example Request”curl -X GET 'https://api.hoody.com/api/v1/curl/jobs/550e8400-e29b-41d4-a716-446655440000/result' \ -H 'Authorization: Bearer <your-api-token>'const result = await client.curl.jobs.getResult( "550e8400-e29b-41d4-a716-446655440000");
console.log(result);Response
Section titled “Response”{ "status_code": 200, "headers": { "Content-Type": "application/json", "Server": "nginx/1.21.0" }, "body": [123, 34, 115, 116, 97, 116, 117, 115, 34, 58, 32, 34, 111, 107, 34, 125], "effective_url": "https://api.example.com/v1/customers"}{ "error": "JOB_NOT_FOUND", "message": "Job not found"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
JOB_NOT_FOUND | Job does not exist | No job found with the provided ID | Verify job ID is correct using listJobs |
JOB_RESULT_NOT_READY | Result not available | Job has not completed yet or failed without response | Check job status with getJob, wait for completion |
{ "error": "STORAGE_ERROR", "message": "Failed to retrieve job result"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
STORAGE_ERROR | Storage read failed | Failed to read job result from storage | Check storage integrity and retry |
DELETE /api/v1/curl/jobs/{id}
Section titled “DELETE /api/v1/curl/jobs/{id}”Cancel a job that is currently pending or running. Once a cancellation is requested, the job will not be restarted. Already-terminal jobs cannot be cancelled.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique job identifier (UUID format) |
Example Request
Section titled “Example Request”curl -X DELETE 'https://api.hoody.com/api/v1/curl/jobs/660e8400-e29b-41d4-a716-446655440001' \ -H 'Authorization: Bearer <your-api-token>'await client.curl.jobs.cancel( "660e8400-e29b-41d4-a716-446655440001");Response
Section titled “Response”{ "status": "cancellation_requested"}{ "error": "JOB_NOT_FOUND", "message": "Job not found"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
JOB_NOT_FOUND | Job does not exist | Cannot cancel job that doesn’t exist | Verify job ID using listJobs endpoint |
{ "error": "INTERNAL_ERROR", "message": "Failed to cancel job"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
INTERNAL_ERROR | Cancellation failed | Job cancellation operation encountered an error | Retry cancellation or contact support if persistent |