import os
from meibel import MeibelClient
from meibel.models import UpdateBatchExecutionRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
update_request = UpdateBatchExecutionRequest(
status="completed",
end_time="2024-01-15T11:45:00Z",
total_items=250,
succeeded=248,
failed=2,
)
execution = client.batches.executions.update_by_id(
"batchexec_9f8a7b6c5d",
update_request,
)
print(f"Execution {execution.id} status: {execution.status}")
print(f"Succeeded: {execution.succeeded}/{execution.total_items}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const execution = await client.batches.executions.updateById("exec_9f2a7c1d", {
status: "completed",
end_time: "2024-01-15T11:45:00Z",
total_items: 250,
succeeded: 248,
failed: 2,
});
console.log(`${execution.id}: ${execution.status} (${execution.succeeded}/${execution.total_items})`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
execution, err := client.Batches.Executions.UpdateById(
context.Background(),
"batchexec_9f3c2a1b",
v2.UpdateBatchExecutionRequest{
Status: v2.String("completed"),
EndTime: v2.String("2024-01-15T11:45:00Z"),
Succeeded: v2.Int(48),
Failed: v2.Int(2),
},
)
if err != nil {
fmt.Println("error:", err)
return
}
fmt.Println("status:", execution.Status)
fmt.Println("succeeded:", *execution.Succeeded)
}curl --request PUT \
--url https://api.meibel.ai/v2/batch-executions/id/{execution_id} \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"status": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"total_items": 123,
"succeeded": 123,
"failed": 123,
"output_datasource_id": "<string>",
"items": [
{}
],
"error": "<string>",
"additional_properties": {}
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: '<string>',
end_time: '2023-11-07T05:31:56Z',
total_items: 123,
succeeded: 123,
failed: 123,
output_datasource_id: '<string>',
items: [{}],
error: '<string>',
additional_properties: {}
})
};
fetch('https://api.meibel.ai/v2/batch-executions/id/{execution_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.meibel.ai/v2/batch-executions/id/{execution_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'status' => '<string>',
'end_time' => '2023-11-07T05:31:56Z',
'total_items' => 123,
'succeeded' => 123,
'failed' => 123,
'output_datasource_id' => '<string>',
'items' => [
[
]
],
'error' => '<string>',
'additional_properties' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/batch-executions/id/{execution_id}")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"total_items\": 123,\n \"succeeded\": 123,\n \"failed\": 123,\n \"output_datasource_id\": \"<string>\",\n \"items\": [\n {}\n ],\n \"error\": \"<string>\",\n \"additional_properties\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/batch-executions/id/{execution_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"total_items\": 123,\n \"succeeded\": 123,\n \"failed\": 123,\n \"output_datasource_id\": \"<string>\",\n \"items\": [\n {}\n ],\n \"error\": \"<string>\",\n \"additional_properties\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"batch_definition_id": "<string>",
"customer_id": "<string>",
"project_id": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"status": "<string>",
"agent_urn": "<string>",
"batch_spec_json": {},
"agent_spec_json": {},
"input_datasource_id": "<string>",
"output_datasource_id": "<string>",
"input_overrides": {},
"total_items": 123,
"succeeded": 123,
"failed": 123,
"end_time": "2023-11-07T05:31:56Z",
"error": "<string>",
"items": [
{
"input_data_element_id": "<string>",
"filename": "<string>",
"status": "<string>",
"error": "<string>",
"output_artifacts": [
{}
],
"attempts": 1
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Update Batch Execution By Id
import os
from meibel import MeibelClient
from meibel.models import UpdateBatchExecutionRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
update_request = UpdateBatchExecutionRequest(
status="completed",
end_time="2024-01-15T11:45:00Z",
total_items=250,
succeeded=248,
failed=2,
)
execution = client.batches.executions.update_by_id(
"batchexec_9f8a7b6c5d",
update_request,
)
print(f"Execution {execution.id} status: {execution.status}")
print(f"Succeeded: {execution.succeeded}/{execution.total_items}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const execution = await client.batches.executions.updateById("exec_9f2a7c1d", {
status: "completed",
end_time: "2024-01-15T11:45:00Z",
total_items: 250,
succeeded: 248,
failed: 2,
});
console.log(`${execution.id}: ${execution.status} (${execution.succeeded}/${execution.total_items})`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
execution, err := client.Batches.Executions.UpdateById(
context.Background(),
"batchexec_9f3c2a1b",
v2.UpdateBatchExecutionRequest{
Status: v2.String("completed"),
EndTime: v2.String("2024-01-15T11:45:00Z"),
Succeeded: v2.Int(48),
Failed: v2.Int(2),
},
)
if err != nil {
fmt.Println("error:", err)
return
}
fmt.Println("status:", execution.Status)
fmt.Println("succeeded:", *execution.Succeeded)
}curl --request PUT \
--url https://api.meibel.ai/v2/batch-executions/id/{execution_id} \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"status": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"total_items": 123,
"succeeded": 123,
"failed": 123,
"output_datasource_id": "<string>",
"items": [
{}
],
"error": "<string>",
"additional_properties": {}
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: '<string>',
end_time: '2023-11-07T05:31:56Z',
total_items: 123,
succeeded: 123,
failed: 123,
output_datasource_id: '<string>',
items: [{}],
error: '<string>',
additional_properties: {}
})
};
fetch('https://api.meibel.ai/v2/batch-executions/id/{execution_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.meibel.ai/v2/batch-executions/id/{execution_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'status' => '<string>',
'end_time' => '2023-11-07T05:31:56Z',
'total_items' => 123,
'succeeded' => 123,
'failed' => 123,
'output_datasource_id' => '<string>',
'items' => [
[
]
],
'error' => '<string>',
'additional_properties' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/batch-executions/id/{execution_id}")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"total_items\": 123,\n \"succeeded\": 123,\n \"failed\": 123,\n \"output_datasource_id\": \"<string>\",\n \"items\": [\n {}\n ],\n \"error\": \"<string>\",\n \"additional_properties\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/batch-executions/id/{execution_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"total_items\": 123,\n \"succeeded\": 123,\n \"failed\": 123,\n \"output_datasource_id\": \"<string>\",\n \"items\": [\n {}\n ],\n \"error\": \"<string>\",\n \"additional_properties\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"batch_definition_id": "<string>",
"customer_id": "<string>",
"project_id": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"status": "<string>",
"agent_urn": "<string>",
"batch_spec_json": {},
"agent_spec_json": {},
"input_datasource_id": "<string>",
"output_datasource_id": "<string>",
"input_overrides": {},
"total_items": 123,
"succeeded": 123,
"failed": 123,
"end_time": "2023-11-07T05:31:56Z",
"error": "<string>",
"items": [
{
"input_data_element_id": "<string>",
"filename": "<string>",
"status": "<string>",
"error": "<string>",
"output_artifacts": [
{}
],
"attempts": 1
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
Runtime-only patch fields. Identity, definition link, and overrides are immutable.
Execution status
Execution end time
Total items in batch
Number of succeeded items
Number of failed items
Output datasource ID
Per-item results
Overall error message
Response
Successful Response
Response shape for a single batch execution. The legacy batch_spec_json / agent_spec_json / agent_urn / input_datasource_id fields are kept for client compatibility (DEL-1376 §5.5) — they are reconstructed from the linked BatchDefinition by the router, not stored on the execution row.
Execution ID — also the Temporal workflow ID for direct queries
FK to the BatchDefinition this execution ran against
Optional override for the tool's parameters schema
Optional override for the tool's parameters schema
Overall error message
Per-item results (populated on completion by status callback)
Show child attributes
Show child attributes
Was this page helpful?