Models
Get model schema
Get a model’s schema including required inputs, outputs, and available operators. Useful for discovering what inputs a simulation needs. example_simulation is a request body for Simulate a model built from placeholder values (100 for a number, "test" for a string, true for a boolean, 1 otherwise) over the next day; replace an enumeration input’s placeholder with one of its options before sending it. Requires the read:model token scope.
GET
/
models
/
{model_id}
/
schema
Get model schema
curl --request GET \
--url https://app.gomangrove.com/api/v1/models/{model_id}/schema \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/models/{model_id}/schema"
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/models/{model_id}/schema', 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}/schema",
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/models/{model_id}/schema"
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/models/{model_id}/schema")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/models/{model_id}/schema")
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{
"model": {
"id": "mod_aBcD1234eFgH5678",
"name": "Carbon Calculation Model",
"version": 1
},
"required_inputs": [
{
"slug": "gross-removal",
"name": "Gross Removal",
"type": "number",
"unit": "t",
"description": "Carbon removed before deductions"
},
{
"slug": "process-emissions",
"name": "Process Emissions",
"type": "number",
"unit": "t",
"description": null
}
],
"outputs": [
{
"id": 101,
"name": "Net Carbon Removal",
"unit": "t",
"ghg": "co2e",
"lca_role": "net"
}
],
"operators": [
"summation",
"product",
"difference",
"quotient",
"max",
"min",
"map",
"average",
"median",
"count",
"stddev",
"expression",
"data_point_proportion",
"duration",
"emission_amortization",
"excel_workbook",
"olca_pathway",
"coalesce",
"compact"
],
"example_simulation": {
"inputs": {
"gross-removal": 100,
"process-emissions": 100
},
"start_time": "2025-01-15T10:00:00Z",
"end_time": "2025-01-16T10:00:00Z"
}
}{
"errors": [
{
"message": "API token has expired"
}
]
}{
"errors": [
{
"message": "You are not authorized to perform this action"
}
]
}{
"errors": [
{
"message": "Record not found"
}
]
}Response
200
⌘I
Get model schema
curl --request GET \
--url https://app.gomangrove.com/api/v1/models/{model_id}/schema \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/models/{model_id}/schema"
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/models/{model_id}/schema', 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}/schema",
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/models/{model_id}/schema"
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/models/{model_id}/schema")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/models/{model_id}/schema")
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{
"model": {
"id": "mod_aBcD1234eFgH5678",
"name": "Carbon Calculation Model",
"version": 1
},
"required_inputs": [
{
"slug": "gross-removal",
"name": "Gross Removal",
"type": "number",
"unit": "t",
"description": "Carbon removed before deductions"
},
{
"slug": "process-emissions",
"name": "Process Emissions",
"type": "number",
"unit": "t",
"description": null
}
],
"outputs": [
{
"id": 101,
"name": "Net Carbon Removal",
"unit": "t",
"ghg": "co2e",
"lca_role": "net"
}
],
"operators": [
"summation",
"product",
"difference",
"quotient",
"max",
"min",
"map",
"average",
"median",
"count",
"stddev",
"expression",
"data_point_proportion",
"duration",
"emission_amortization",
"excel_workbook",
"olca_pathway",
"coalesce",
"compact"
],
"example_simulation": {
"inputs": {
"gross-removal": 100,
"process-emissions": 100
},
"start_time": "2025-01-15T10:00:00Z",
"end_time": "2025-01-16T10:00:00Z"
}
}{
"errors": [
{
"message": "API token has expired"
}
]
}{
"errors": [
{
"message": "You are not authorized to perform this action"
}
]
}{
"errors": [
{
"message": "Record not found"
}
]
}