Skip to main content
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": "bat_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"
      },
      "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"
      }
    }
  ],
  "report_allocations": [
    {
      "allocation": {
        "id": 1,
        "amount": 50.25,
        "unit": "t"
      },
      "amount": 50.25,
      "unit": "t",
      "report": {
        "id": "rpt_abc123",
        "name": "Q1 2025 Report",
        "report_type": "quarterly",
        "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"
      }
    }
  ]
}
{
"status": "error",
"statusCode": 404,
"errors": [
{
"message": "record not found"
}
]
}

Authorizations

Authorization
string
header
required

Path Parameters

batch_id
string
required

Batch friendly ID (e.g., bat_abc123def456)

Response

200

id
string
Example:

"bat_abc123def456"

tracking_id
string
start_time
string<date-time>
end_time
string<date-time>
state
string
created_at
string<date-time>
updated_at
string<date-time>
primary_output
object | null
ledger_balance
number | null
allocations
object[]
model_run
object | null
feedstocks
object[]
input_data
object[]
report_allocations
object[]
downstream_batch_allocations
object[]