Data Rules
List rules
Lists the data rules on a project, most recently created first. Requires a token with Data Rules read permission.
GET
/
projects
/
{project_id}
/
rules
List rules
curl --request GET \
--url https://app.gomangrove.com/api/v1/projects/{project_id}/rules \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/projects/{project_id}/rules"
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/projects/{project_id}/rules', 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/projects/{project_id}/rules",
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/projects/{project_id}/rules"
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/projects/{project_id}/rules")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/projects/{project_id}/rules")
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{
"data": [
{
"id": "rule_Qb3k9TzdL0pWnXyz",
"name": "Negative Temp Alert",
"rule_type": "alert",
"action": "alert",
"method_chain": [],
"target_type": "data_point",
"status": "active",
"enabled": true,
"rule_text": "{{data-point.ambient-temperature-c}} < 0",
"subject_slugs": [],
"alert_message": "Ambient temperature below zero",
"version": 1,
"effective_from": null,
"effective_to": null,
"model_id": null,
"model_name": null,
"created_by": "Sam Okonkwo",
"created_at": "2026-06-03T20:20:29.697Z",
"updated_at": "2026-06-03T20:20:29.697Z"
}
],
"info": {
"items": 1,
"page_size": 20,
"total_items": 1,
"current_page": 1,
"next_page": null,
"previous_page": null,
"total_pages": 1
}
}{
"errors": [
{
"message": "You are not authorized to perform this action"
}
]
}⌘I
List rules
curl --request GET \
--url https://app.gomangrove.com/api/v1/projects/{project_id}/rules \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/projects/{project_id}/rules"
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/projects/{project_id}/rules', 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/projects/{project_id}/rules",
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/projects/{project_id}/rules"
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/projects/{project_id}/rules")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/projects/{project_id}/rules")
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{
"data": [
{
"id": "rule_Qb3k9TzdL0pWnXyz",
"name": "Negative Temp Alert",
"rule_type": "alert",
"action": "alert",
"method_chain": [],
"target_type": "data_point",
"status": "active",
"enabled": true,
"rule_text": "{{data-point.ambient-temperature-c}} < 0",
"subject_slugs": [],
"alert_message": "Ambient temperature below zero",
"version": 1,
"effective_from": null,
"effective_to": null,
"model_id": null,
"model_name": null,
"created_by": "Sam Okonkwo",
"created_at": "2026-06-03T20:20:29.697Z",
"updated_at": "2026-06-03T20:20:29.697Z"
}
],
"info": {
"items": 1,
"page_size": 20,
"total_items": 1,
"current_page": 1,
"next_page": null,
"previous_page": null,
"total_pages": 1
}
}{
"errors": [
{
"message": "You are not authorized to perform this action"
}
]
}