Skip to main content
GET
/
jobs
/
{jobId}
Get job status and result
curl --request GET \
  --url https://api.horizon.new/v1/jobs/{jobId}
{
  "jobId": "job_01hx9q9",
  "jobType": "extract/pdf",
  "status": "queued",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "statusUrl": "<string>",
  "webhookUrl": "<string>",
  "result": {},
  "error": {},
  "events": [
    "<string>"
  ]
}
Retrieve the latest status and output for any asynchronous job. Use this endpoint after submitting long-running generation or extraction requests to poll progress or fetch final results.

Path parameters

  • jobId — Required identifier returned when you created the job.

Sample request

curl https://api.horizon.new/v1/jobs/job_01hx9q9 \

Response

{
  "jobId": "job_01hx9q9",
  "jobType": "extract/pdf",
  "status": "completed",
  "createdAt": "2025-03-18T01:24:07.123Z",
  "updatedAt": "2025-03-18T01:24:53.904Z",
  "statusUrl": "https://api.horizon.new/v1/jobs/job_01hx9q9",
  "result": {
    "chunks": [
      {
        "id": "chunk_001",
        "text": "Horizon overview...",
        "page": 1,
        "segmentIndex": 0
      }
    ]
  },
  "events": ["job.completed"]
}

Status values

  • queued — Job accepted and awaiting processing.
  • processing — Work is currently underway.
  • completed — Job finished successfully; result is populated.
  • failed — Job terminated with an error; inspect error for details.

Register job-specific webhook

curl https://api.horizon.new/v1/jobs/job_01hx9q9/webhooks \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/horizon/jobs",
    "events": ["job.completed"],
    "secret": "whsec_*******"
  }'
Returns 202 Accepted. Horizon delivers a signed payload when the job reaches a terminal state. Use account-level webhooks for global automation and job-level webhooks for ad-hoc callbacks tied to a single job.

Usage notes

  • statusUrl mirrors this endpoint, so you can poll either the returned URL or call GET /jobs/{jobId} directly.
  • Horizon retains job results for at least 24 hours; persist critical outputs in your own storage.
  • Webhook notifications (account-level or job-level) include the same payload as this endpoint.

Path Parameters

jobId
string
required

Identifier returned when the job was created.

Response

Job status returned

jobId
string
required
Example:

"job_01hx9q9"

jobType
string
required
Example:

"extract/pdf"

status
enum<string>
required
Available options:
queued,
processing,
completed,
failed
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
statusUrl
string<uri>
required
events
string[]
required

Webhook event subscriptions attached to this job.

webhookUrl
string<uri> | null

Webhook delivery target when supplied.

result
object | null

Present when the job completed successfully.

error
object | null

Failure payload when status is failed.