Skip to main content
GET
/
v3
/
batches
/
{batch_id}
Get Batch
curl --request GET \
  --url https://api.matil.ai/v3/batches/{batch_id} \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.matil.ai/v3/batches/{batch_id}"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.matil.ai/v3/batches/{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.matil.ai/v3/batches/{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 => [
    "x-api-key: <api-key>"
  ],
]);

$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.matil.ai/v3/batches/{batch_id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<api-key>")

	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.matil.ai/v3/batches/{batch_id}")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.matil.ai/v3/batches/{batch_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "<string>",
  "total_items": 123,
  "completed_items": 123,
  "failed_items": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "resource_type": "structure",
  "resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "resource_version_number": 123,
  "completed_at": "2023-11-07T05:31:56Z",
  "items": [
    {
      "status": "<string>",
      "metadata": {},
      "entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "data": {},
      "errors": [
        {}
      ]
    }
  ],
  "failed_webhooks": [
    {
      "webhook_id": "<string>",
      "event": "<string>",
      "status": "<string>",
      "attempt_count": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "http_status": 123,
      "error_message": "<string>",
      "delivered_at": "2023-11-07T05:31:56Z",
      "item_metadata": {}
    }
  ]
}
{
  "error": "AUTHENTICATION_REQUIRED",
  "message": "Authentication required. Provide a valid x-api-key header.",
  "details": null
}
{
  "error": "ACCESS_DENIED",
  "message": "Access denied to this batch.",
  "details": null
}
{
  "error": "BATCH_NOT_FOUND",
  "message": "Batch not found.",
  "details": null
}

Authorizations

x-api-key
string
header
required

Headers

authorization
string | null
x-api-key
string | null
X-Tenant-ID
string | null

Path Parameters

batch_id
string<uuid>
required

Response

Successful Response

Response for batch status query.

batch_id
string<uuid>
required

ID of the batch

status
string
required

Current status of the batch

total_items
integer
required

Total number of items in the batch

completed_items
integer
required

Number of completed items

failed_items
integer
required

Number of failed items

created_at
string<date-time>
required

When the batch was created

resource_type
string
default:structure

Resource type used for processing

resource_id
string<uuid> | null

Structure ID used for processing

resource_version_number
integer | null

Structure version number used

completed_at
string<date-time> | null

When the batch completed

items
BatchItemStatus · object[]

List of batch items with their processing status and results

failed_webhooks
WebhookDeliveryInfo · object[]

Failed webhook deliveries (for debugging)