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 "https://api.oslew.com/v1/batch/KNBDU4TD1RrnARXRKn0jodCf" \
-H "Authorization: Bearer $GEO_API_KEY"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")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");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
| Name | Type | Description |
|---|---|---|
idpathrequired | string |
Responses
200 — The job.
created_atintegerrequireddoneintegerrequiredRows attempted so far.foundintegerrequiredRows that resolved to a position.idstringrequiredrowsintegerrequiredrpsnumberrequiredThe sustained rate the job is paced at, which is the key's own.statestringrequiredqueued | running | done | failed | cancelledupdated_atintegerrequiredStops moving if the pod running the job is gone.epochintegerWhich claim on the job is current; a job taken over by another pod has a higher one.errorstring | nullformatstringHow the input was sent; on submit only.jsonl | csvheartbeat_atintegerUnix seconds of the owner's last heartbeat; on submit only.ownerstring | nullThe pod working on it.partsintegerOutput parts of 50,000 rows written so far.remaining_sintegerSeconds the rest of the rows should take at that rate.tenantstringThe 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.
| 401 | No key, or one that is unknown, revoked or suspended. |
| 403 | The 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. |
| 404 | No job with that id. |
| 429 | This 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. |
| 503 | The 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 "https://api.oslew.com/v1/batch/KNBDU4TD1RrnARXRKn0jodCf" \
-H "Authorization: Bearer $GEO_API_KEY"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")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");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 "https://api.oslew.com/v1/batch/nosuchjob0000000000000000" \
-H "Authorization: Bearer $GEO_API_KEY"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")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");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.