Batch status and results
curl --request GET \
--url https://api.retriever.run/v1/services/jobs/batch/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.retriever.run/v1/services/jobs/batch/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.retriever.run/v1/services/jobs/batch/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retriever.run/v1/services/jobs/batch/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.retriever.run/v1/services/jobs/batch/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.retriever.run/v1/services/jobs/batch/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retriever.run/v1/services/jobs/batch/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"batch_id": "svcbatch_9f2c4b1e8a7d6c5f",
"service": "<string>",
"size": 123,
"status": "queued",
"counts": {
"queued": 123,
"running": 123,
"completed": 123,
"failed": 123,
"cancelled": 123
},
"jobs": [
{
"job_id": "<string>",
"service": "<string>",
"status": "queued",
"attempt": 123,
"reused": true,
"result": {},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"input_index": 123
}
],
"poll_url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_authenticated",
"message": "A valid API key is required."
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry later."
}
}Services
Batch status and results
With wait_seconds, the request is held until no line is queued or
running, or until the wait ends, whichever comes first: call it again
the same way until status is completed. A restart on our side
answers a held read at once. Without it the read
answers at once. status is completed
once every job has ended, whatever each one’s outcome: read each
job’s status, result or error. input_index is the position in
the list sent.
GET
/
v1
/
services
/
jobs
/
batch
/
{id}
Batch status and results
curl --request GET \
--url https://api.retriever.run/v1/services/jobs/batch/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.retriever.run/v1/services/jobs/batch/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.retriever.run/v1/services/jobs/batch/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retriever.run/v1/services/jobs/batch/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.retriever.run/v1/services/jobs/batch/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.retriever.run/v1/services/jobs/batch/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retriever.run/v1/services/jobs/batch/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"batch_id": "svcbatch_9f2c4b1e8a7d6c5f",
"service": "<string>",
"size": 123,
"status": "queued",
"counts": {
"queued": 123,
"running": 123,
"completed": 123,
"failed": 123,
"cancelled": 123
},
"jobs": [
{
"job_id": "<string>",
"service": "<string>",
"status": "queued",
"attempt": 123,
"reused": true,
"result": {},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"input_index": 123
}
],
"poll_url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_authenticated",
"message": "A valid API key is required."
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry later."
}
}Authorizations
API key ret_live_… created in Settings → API keys.
Path Parameters
Query Parameters
Seconds to wait for every line to end before answering.
Required range:
0 <= x <= 60Response
Batch.
Example:
"svcbatch_9f2c4b1e8a7d6c5f"
completed once every job has ended, whatever each one's outcome.
Available options:
queued, running, completed Show child attributes
Show child attributes
One entry per input, in the order sent.
Show child attributes
Show child attributes