Models
Simulate a model
Run a dry-run simulation against a model using provided input values. Does not create a model run or persist results. Get model schema lists the inputs a simulation needs and returns an example request body. Missing inputs, invalid input values and nodes that fail to compute are reported in errors with a 200, alongside the results of the nodes that did compute; an input slug that names no data point type in the model’s project returns 422. Requires the read:model token scope.
POST
/
models
/
{model_id}
/
simulate
Simulate a model
curl --request POST \
--url https://app.gomangrove.com/api/v1/models/{model_id}/simulate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"gross-removal": 1000,
"process-emissions": 45
},
"start_time": "2025-01-01T00:00:00Z",
"end_time": "2025-03-31T23:59:59Z"
}
'import requests
url = "https://app.gomangrove.com/api/v1/models/{model_id}/simulate"
payload = {
"inputs": {
"gross-removal": 1000,
"process-emissions": 45
},
"start_time": "2025-01-01T00:00:00Z",
"end_time": "2025-03-31T23:59:59Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: {'gross-removal': 1000, 'process-emissions': 45},
start_time: '2025-01-01T00:00:00Z',
end_time: '2025-03-31T23:59:59Z'
})
};
fetch('https://app.gomangrove.com/api/v1/models/{model_id}/simulate', 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/models/{model_id}/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'gross-removal' => 1000,
'process-emissions' => 45
],
'start_time' => '2025-01-01T00:00:00Z',
'end_time' => '2025-03-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.gomangrove.com/api/v1/models/{model_id}/simulate"
payload := strings.NewReader("{\n \"inputs\": {\n \"gross-removal\": 1000,\n \"process-emissions\": 45\n },\n \"start_time\": \"2025-01-01T00:00:00Z\",\n \"end_time\": \"2025-03-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gomangrove.com/api/v1/models/{model_id}/simulate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"gross-removal\": 1000,\n \"process-emissions\": 45\n },\n \"start_time\": \"2025-01-01T00:00:00Z\",\n \"end_time\": \"2025-03-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/models/{model_id}/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {\n \"gross-removal\": 1000,\n \"process-emissions\": 45\n },\n \"start_time\": \"2025-01-01T00:00:00Z\",\n \"end_time\": \"2025-03-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_body{
"results": {
"101": {
"value": 955,
"unit": "t",
"is_output": true
},
"102": {
"value": 1000,
"unit": "t",
"is_output": false
},
"103": {
"value": 45,
"unit": "t",
"is_output": false
}
},
"errors": {},
"execution_time_ms": 45.2
}{
"errors": [
{
"message": "inputs, start_time, and end_time are required"
}
]
}{
"errors": [
{
"message": "API token has expired"
}
]
}{
"errors": [
{
"message": "You are not authorized to perform this action"
}
]
}{
"errors": [
{
"message": "Record not found"
}
]
}{
"errors": [
{
"message": "Data point type not found: unknown-slug"
}
]
}Body
application/json
Response
200
⌘I
Simulate a model
curl --request POST \
--url https://app.gomangrove.com/api/v1/models/{model_id}/simulate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"gross-removal": 1000,
"process-emissions": 45
},
"start_time": "2025-01-01T00:00:00Z",
"end_time": "2025-03-31T23:59:59Z"
}
'import requests
url = "https://app.gomangrove.com/api/v1/models/{model_id}/simulate"
payload = {
"inputs": {
"gross-removal": 1000,
"process-emissions": 45
},
"start_time": "2025-01-01T00:00:00Z",
"end_time": "2025-03-31T23:59:59Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: {'gross-removal': 1000, 'process-emissions': 45},
start_time: '2025-01-01T00:00:00Z',
end_time: '2025-03-31T23:59:59Z'
})
};
fetch('https://app.gomangrove.com/api/v1/models/{model_id}/simulate', 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/models/{model_id}/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'gross-removal' => 1000,
'process-emissions' => 45
],
'start_time' => '2025-01-01T00:00:00Z',
'end_time' => '2025-03-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.gomangrove.com/api/v1/models/{model_id}/simulate"
payload := strings.NewReader("{\n \"inputs\": {\n \"gross-removal\": 1000,\n \"process-emissions\": 45\n },\n \"start_time\": \"2025-01-01T00:00:00Z\",\n \"end_time\": \"2025-03-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gomangrove.com/api/v1/models/{model_id}/simulate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"gross-removal\": 1000,\n \"process-emissions\": 45\n },\n \"start_time\": \"2025-01-01T00:00:00Z\",\n \"end_time\": \"2025-03-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/models/{model_id}/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {\n \"gross-removal\": 1000,\n \"process-emissions\": 45\n },\n \"start_time\": \"2025-01-01T00:00:00Z\",\n \"end_time\": \"2025-03-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_body{
"results": {
"101": {
"value": 955,
"unit": "t",
"is_output": true
},
"102": {
"value": 1000,
"unit": "t",
"is_output": false
},
"103": {
"value": 45,
"unit": "t",
"is_output": false
}
},
"errors": {},
"execution_time_ms": 45.2
}{
"errors": [
{
"message": "inputs, start_time, and end_time are required"
}
]
}{
"errors": [
{
"message": "API token has expired"
}
]
}{
"errors": [
{
"message": "You are not authorized to perform this action"
}
]
}{
"errors": [
{
"message": "Record not found"
}
]
}{
"errors": [
{
"message": "Data point type not found: unknown-slug"
}
]
}