oslew docs
Console
Menu

BatchaddressoperationId get_batch

GET/v1/batch/{id}

How a batch job is going, and how many seconds are left at its paced rate.

Send Authorization: Bearer sk_live_…. The key's plan must include theaddress product; which plans do.

Explained in Errors, Batch jobs and Clean a customer CSV.

Example

A finished job.

curl
curl "https://api.oslew.com/v1/batch/KNBDU4TD1RrnARXRKn0jodCf" \
  -H "Authorization: Bearer $GEO_API_KEY"
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.get_batch("KNBDU4TD1RrnARXRKn0jodCf")
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.get_batch("KNBDU4TD1RrnARXRKn0jodCf");
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 20
ratelimit-remaining: 98
ratelimit-reset: 1

{
  "created_at": 1795427402,
  "done": 5,
  "epoch": 1,
  "error": null,
  "found": 5,
  "id": "KNBDU4TD1RrnARXRKn0jodCf",
  "owner": null,
  "parts": 1,
  "remaining_s": 0,
  "rows": 5,
  "rps": 1,
  "state": "done",
  "updated_at": 1795427406
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Path

NameTypeDescription
id
pathrequired
string

Responses

200 — The job.

  • created_atintegerrequired
  • doneintegerrequired
    Rows attempted so far.
  • foundintegerrequired
    Rows that resolved to a position.
  • idstringrequired
  • rowsintegerrequired
  • rpsnumberrequired
    The sustained rate the job is paced at, which is the key's own.
  • statestringrequired
    queued | running | done | failed | cancelled
  • updated_atintegerrequired
    Stops moving if the pod running the job is gone.
  • epochinteger
    Which claim on the job is current; a job taken over by another pod has a higher one.
  • errorstring | null
  • formatstring
    How the input was sent; on submit only.
    jsonl | csv
  • heartbeat_atinteger
    Unix seconds of the owner's last heartbeat; on submit only.
  • ownerstring | null
    The pod working on it.
  • partsinteger
    Output parts of 50,000 rows written so far.
  • remaining_sinteger
    Seconds the rest of the rows should take at that rate.
  • tenantstring
    The tenant that owns it; on submit only.

With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.

Refusals

Every refusal is a JSON object with an error string, except where noted.

401No key, or one that is unknown, revoked or suspended.
403The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does.
404No job with that id.
429This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After.
503The pod cannot reach the control plane and its entitlements are too old to trust. Retry.

A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.

More examples

A job while it runs
curl
curl "https://api.oslew.com/v1/batch/KNBDU4TD1RrnARXRKn0jodCf" \
  -H "Authorization: Bearer $GEO_API_KEY"
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.get_batch("KNBDU4TD1RrnARXRKn0jodCf")
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.get_batch("KNBDU4TD1RrnARXRKn0jodCf");
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 20
ratelimit-remaining: 98
ratelimit-reset: 1

{
  "created_at": 1795427402,
  "done": 0,
  "epoch": 1,
  "error": null,
  "found": 0,
  "id": "KNBDU4TD1RrnARXRKn0jodCf",
  "owner": "docs-examples",
  "parts": 0,
  "remaining_s": 5,
  "rows": 5,
  "rps": 1,
  "state": "queued",
  "updated_at": 1795427402
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

A job id nobody issued
curl
curl "https://api.oslew.com/v1/batch/nosuchjob0000000000000000" \
  -H "Authorization: Bearer $GEO_API_KEY"
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.get_batch("nosuchjob0000000000000000")
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.get_batch("nosuchjob0000000000000000");
Response
HTTP/1.1 404 Not Found
content-type: application/json
ratelimit-limit: 20
ratelimit-remaining: 97
ratelimit-reset: 1

{
  "error": "no job with that id"
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.