Opono
Skip to content
Documentation menu Jobs ▾

API reference

Jobs

Copy as Markdown

Retrieve a job

GET /v1/simulations/jobs/{job_id}

Poll your request's result_url to settle its reserved price on first delivery and replay that delivery for free.

Authentication: Bearer API key with simulations.run; active Plus or Pro plan required.

Parameters

Path parameters

NameTypeRequiredDescription
job_idstringYesJob ID returned by your simulation request.

Query parameters

NameTypeRequiredDescription
reservation_idstringNoRequest value; maximum length: 100.
reservation_idstringConditionalPreserve this value from result_url to select your request's funding when requests share a job.

Body parameters

NameTypeRequiredDescription
———None.

Example request

bash
curl 'https://api.opono.com/v1/simulations/jobs/job_example?reservation_id=reservationexample' \
  --header "Authorization: Bearer $OPONO_API_KEY"

Response

FieldTypeDescription
objectstringsimulation_job while pending or terminal; simulation when delivered.
job_idstringCurrent job ID.
fixture_idintegerFixture ID when present.
statusstringqueued or leased on 202; failed or superseded on a terminal 200.
reservation_idstringYour credit reservation when present.
result_urlstringRequest-bound delivery path when present; preserve its query string.
priceobjectNumber of simulated matches and exact credit price when present.
credits_reservednumberCredits held for your request when present.
retry_after_secondsintegerWait this many seconds before your next poll on 202.
scope / inputs / warningsstring / object / arrayRun scope, normalized inputs and non-blocking lineup warnings when present.
superseded_job_idstringPrevious job ID; equals job_id when no replacement exists.
errorobjectCode and message for a failed job.
simulationobjectPresent on delivery; see the simulation response.

Example response

200 response for a failed job; a successful 200 uses the simulation response.

json
{
  "object": "simulation_job",
  "job_id": "job_example",
  "fixture_id": 19609874,
  "status": "failed",
  "error": {
    "code": "simulation_failed",
    "message": "The simulation could not be completed. Submit a new request for the current fixture inputs."
  }
}

202 response.

json
{
  "object": "simulation_job",
  "job_id": "job_example",
  "fixture_id": 19609874,
  "reservation_id": "reservationexample",
  "result_url": "/v1/simulations/jobs/job_example?reservation_id=reservationexample",
  "status": "queued",
  "price": {
    "draws": 1000,
    "credits": "1.000"
  },
  "credits_reserved": 1,
  "retry_after_seconds": 10
}

Errors

StatusCodeMeaning
400parameter_invalidA parameter has an invalid value.
401invalid_api_keyThe credential cannot authenticate.
401key_revokedThe API key has been revoked.
401key_expiredThe API key has expired.
403scope_missingThe key lacks the required scope.
403tier_restrictedThe organisation plan does not include this operation.
403org_suspendedYour account is suspended.
403ip_not_allowedThe caller is outside the key's IP allowlist.
429rate_limitedA request or authentication rate limit was exceeded.
503dependency_unavailableRequest admission is unavailable.
503maintenanceThe API is paused for maintenance.
404resource_missingThe resource is missing or belongs to another account.
404fixture_not_foundNo matching simulation fixture exists.
409reservation_expiredThe simulation credit hold ended without delivery.
402balance_too_lowYour available balance cannot cover the request.
400fixture_not_coveredThe requested fixture is not available for simulation.
503refreshingThe request can't be checked right now.
503settlement_unknownDelivery settlement could not be confirmed.

Retrieve a batch

GET /v1/simulations/batches/{batch_id}

Read your batch's per-fixture status and delivery links at zero credits.

Authentication: Bearer API key with simulations.run; active Plus or Pro plan required.

Parameters

Path parameters

NameTypeRequiredDescription
batch_idstringYesBatch ID returned by your batch request.

Query parameters

NameTypeRequiredDescription
———None.

Body parameters

NameTypeRequiredDescription
———None.

Example request

bash
curl 'https://api.opono.com/v1/simulations/batches/batch_example' \
  --header "Authorization: Bearer $OPONO_API_KEY"

Response

FieldTypeDescription
objectstringsimulation_batch.
batch_idstringYour batch ID.
itemsarrayPer-fixture jobs and reservations.
items[].fixtureintegerFixture ID.
items[].job_idstringJob ID for this fixture.
items[].statusstringCurrent item status.
items[].credits_reservednumberCredits held for this item.
items[].reservation_idstringRequest-bound reservation when present on submission.
items[].result_urlstringFollow this path to deliver and settle the item.
items[].errorobjectError code and message when an item is unavailable.
items[].credits_chargednumberSettled credits when present on a status response.
items[].freshnessobjectFreshness state and check times when present on a status response.
items[].scope / inputs / warningsstring / object / arrayEach item's run scope, normalized inputs and lineup warnings when present.
validUntilnumber or nullEarliest item freshness deadline in Unix milliseconds when present.
credits_reserved_totalnumberTotal credits reserved for this batch when present.

Example response

200 response.

json
{
  "object": "simulation_batch",
  "batch_id": "batch_example",
  "items": [
    {
      "fixture": 19609874,
      "job_id": "job_example",
      "status": "queued",
      "credits_reserved": 1,
      "result_url": "/v1/simulations/jobs/job_example?reservation_id=reservationexample",
      "credits_charged": 0,
      "freshness": {
        "status": "fresh",
        "reason": "Inputs as of 2026-10-17T07:10:00.000Z.",
        "evaluatedAt": 1792310400000,
        "validUntil": 1792336499999,
        "inputsAsOf": 1792307400000
      }
    }
  ],
  "credits_reserved_total": 1,
  "validUntil": 1792336499999
}

Errors

StatusCodeMeaning
400parameter_invalidA parameter has an invalid value.
401invalid_api_keyThe credential cannot authenticate.
401key_revokedThe API key has been revoked.
401key_expiredThe API key has expired.
403scope_missingThe key lacks the required scope.
403tier_restrictedThe organisation plan does not include this operation.
403org_suspendedYour account is suspended.
403ip_not_allowedThe caller is outside the key's IP allowlist.
429rate_limitedA request or authentication rate limit was exceeded.
503dependency_unavailableRequest admission is unavailable.
503maintenanceThe API is paused for maintenance.
404resource_missingThe resource is missing or belongs to another account.
400fixture_not_coveredThe requested fixture is not available for simulation.
503refreshingThe request can't be checked right now.
404fixture_not_foundNo matching simulation fixture exists.