Batches
Retrieve a batch
Returns a specific batch by ID, including underlying input data and allocation to reports. Unlike events and data points, the rule alert fields (has_rule_alerts and rule_alerts) are returned on this detail response only. The batch list response uses a lighter serializer that omits them.
GET
/
batches
/
{batch_id}
Retrieve a batch
curl --request GET \
--url https://app.gomangrove.com/api/v1/batches/{batch_id} \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/batches/{batch_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.gomangrove.com/api/v1/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://app.gomangrove.com/api/v1/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 => [
"Authorization: <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://app.gomangrove.com/api/v1/batches/{batch_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://app.gomangrove.com/api/v1/batches/{batch_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/batches/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "ba_abc123def456",
"tracking_id": "Q1-2025-001",
"start_time": "2025-01-01T00:00:00.000Z",
"end_time": "2025-03-31T23:59:59.000Z",
"state": "complete",
"created_at": "2025-01-15T10:00:00.000Z",
"updated_at": "2025-01-15T10:00:00.000Z",
"primary_output": {
"id": 1,
"name": "Net Carbon Removal",
"unit": "t",
"data_point_type_id": 5,
"value": 100.5
},
"ledger_balance": 50.25,
"allocations": [],
"model_run": {
"id": 1,
"start_time": "2025-01-01T00:00:00.000Z",
"end_time": "2025-03-31T23:59:59.000Z",
"state": "complete",
"error_message": null,
"created_at": "2025-01-15T10:00:00.000Z",
"updated_at": "2025-01-15T10:00:00.000Z",
"calculations": [],
"output_data_points": []
},
"feedstocks": [],
"input_data": [
{
"data_point": {
"id": "in_abc123",
"slug": "feedstock-mass",
"data_point_type": "Mass of Feedstock",
"value": 50.5,
"unit": "t",
"status": "complete",
"substituted": false,
"imputed": false,
"raw_value": null,
"substitution": null
},
"event": {
"id": "evt_xyz789",
"slug": "feedstock-delivery",
"event_type": "Feedstock Delivery",
"tracking_id": "FD-001",
"start_time": "2025-01-15T00:00:00.000Z",
"end_time": "2025-01-15T23:59:59.000Z",
"project_id": "prj_AbCd1234567890Ef"
}
}
],
"report_allocations": [
{
"allocation": {
"id": 1,
"amount": 50.25,
"unit": "t"
},
"amount": 50.25,
"unit": "t",
"report": {
"id": "rep_abc123",
"name": "Q1 2025 Report",
"report_type": "default",
"status": "complete"
}
}
],
"downstream_batch_allocations": [],
"has_rule_alerts": true,
"rule_alerts": [
{
"lineage_role": "own",
"result": {
"id": "mrres_AIKqFEtr5OpAqram",
"status": "fail",
"checked_value": "0.82",
"node_ids": [
"node_total_emissions"
],
"rule_id": "rule_Lp7m2XcQd0RtVbnm",
"rule_version": 1,
"rule_name": "Yield ratio threshold",
"model_run_id": "mr_900ZxcvBnm12",
"dismissed_at": null,
"dismissed_by": null,
"dismissal_reason": null,
"evaluated_at": "2025-01-15T20:00:00.000Z"
}
},
{
"lineage_role": "upstream_batch",
"result": {
"id": "dpres_7nxaDUf65c36v6mz",
"status": "fail",
"entered_value": "12.4",
"rule_id": "rule_Qb3k9TzdL0pWnXyz",
"rule_version": 1,
"rule_name": "Moisture content within range",
"data_point_id": "in_upstream00001",
"data_point_slug": "moisture-pct",
"dismissed_at": null,
"dismissed_by": null,
"dismissal_reason": null,
"evaluated_at": "2025-01-14T11:30:00.000Z"
}
}
],
"ui_url": "https://app.gomangrove.com/nexus/prj_AbCd1234567890Ef/ledger/led_abc123def456/batch/ba_abc123def456"
}{
"errors": [
{
"message": "record not found"
}
]
}Authorizations
Path Parameters
Batch friendly ID (e.g., ba_abc123def456)
Response
200
Example:
"ba_abc123def456"
The data points the batch read, each with the event that produced it. Evidence, rule results and the event's full record come from their own endpoints.
Show child attributes
Show child attributes
Link that opens this batch in the Mangrove app. Null when the batch has no ledger.
⌘I
Retrieve a batch
curl --request GET \
--url https://app.gomangrove.com/api/v1/batches/{batch_id} \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/batches/{batch_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.gomangrove.com/api/v1/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://app.gomangrove.com/api/v1/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 => [
"Authorization: <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://app.gomangrove.com/api/v1/batches/{batch_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://app.gomangrove.com/api/v1/batches/{batch_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/batches/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "ba_abc123def456",
"tracking_id": "Q1-2025-001",
"start_time": "2025-01-01T00:00:00.000Z",
"end_time": "2025-03-31T23:59:59.000Z",
"state": "complete",
"created_at": "2025-01-15T10:00:00.000Z",
"updated_at": "2025-01-15T10:00:00.000Z",
"primary_output": {
"id": 1,
"name": "Net Carbon Removal",
"unit": "t",
"data_point_type_id": 5,
"value": 100.5
},
"ledger_balance": 50.25,
"allocations": [],
"model_run": {
"id": 1,
"start_time": "2025-01-01T00:00:00.000Z",
"end_time": "2025-03-31T23:59:59.000Z",
"state": "complete",
"error_message": null,
"created_at": "2025-01-15T10:00:00.000Z",
"updated_at": "2025-01-15T10:00:00.000Z",
"calculations": [],
"output_data_points": []
},
"feedstocks": [],
"input_data": [
{
"data_point": {
"id": "in_abc123",
"slug": "feedstock-mass",
"data_point_type": "Mass of Feedstock",
"value": 50.5,
"unit": "t",
"status": "complete",
"substituted": false,
"imputed": false,
"raw_value": null,
"substitution": null
},
"event": {
"id": "evt_xyz789",
"slug": "feedstock-delivery",
"event_type": "Feedstock Delivery",
"tracking_id": "FD-001",
"start_time": "2025-01-15T00:00:00.000Z",
"end_time": "2025-01-15T23:59:59.000Z",
"project_id": "prj_AbCd1234567890Ef"
}
}
],
"report_allocations": [
{
"allocation": {
"id": 1,
"amount": 50.25,
"unit": "t"
},
"amount": 50.25,
"unit": "t",
"report": {
"id": "rep_abc123",
"name": "Q1 2025 Report",
"report_type": "default",
"status": "complete"
}
}
],
"downstream_batch_allocations": [],
"has_rule_alerts": true,
"rule_alerts": [
{
"lineage_role": "own",
"result": {
"id": "mrres_AIKqFEtr5OpAqram",
"status": "fail",
"checked_value": "0.82",
"node_ids": [
"node_total_emissions"
],
"rule_id": "rule_Lp7m2XcQd0RtVbnm",
"rule_version": 1,
"rule_name": "Yield ratio threshold",
"model_run_id": "mr_900ZxcvBnm12",
"dismissed_at": null,
"dismissed_by": null,
"dismissal_reason": null,
"evaluated_at": "2025-01-15T20:00:00.000Z"
}
},
{
"lineage_role": "upstream_batch",
"result": {
"id": "dpres_7nxaDUf65c36v6mz",
"status": "fail",
"entered_value": "12.4",
"rule_id": "rule_Qb3k9TzdL0pWnXyz",
"rule_version": 1,
"rule_name": "Moisture content within range",
"data_point_id": "in_upstream00001",
"data_point_slug": "moisture-pct",
"dismissed_at": null,
"dismissed_by": null,
"dismissal_reason": null,
"evaluated_at": "2025-01-14T11:30:00.000Z"
}
}
],
"ui_url": "https://app.gomangrove.com/nexus/prj_AbCd1234567890Ef/ledger/led_abc123def456/batch/ba_abc123def456"
}{
"errors": [
{
"message": "record not found"
}
]
}