Rules
List the rules you authored
Beta. The request and response shapes may still change.
List the rules you have authored. Prelude-managed rules are a separate listing - see List managed rules.
GET
/
v2
/
watch
/
management
/
rules
List rules
curl --request GET \
--url https://api.prelude.dev/v2/watch/management/rules \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prelude.dev/v2/watch/management/rules"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prelude.dev/v2/watch/management/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://api.prelude.dev/v2/watch/management/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: Bearer <token>"
],
]);
$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://api.prelude.dev/v2/watch/management/rules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prelude.dev/v2/watch/management/rules")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prelude.dev/v2/watch/management/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rules": [
{
"id": "rul_01jc0t6fwwfgfsq1md24mhyztj",
"name": "free_plan_signup",
"expression": "signal.ext.plan_tier == \"free\"",
"type": "CUSTOM",
"description": "Signups on the free plan."
}
],
"next_cursor": "rul_01jc0t6fwwfgfsq1md24mhyztj"
}{
"code": "invalid_phone_number",
"message": "The provided phone number is invalid. Provide a valid E.164 phone number.",
"type": "bad_request",
"request_id": "3d19215e-2991-4a05-a41a-527314e6ff6a",
"param": "phone_number"
}Returns your own rules. Prelude’s shared library is a separate listing: see List managed rules.
Authorizations
Query Parameters
⌘I
List rules
curl --request GET \
--url https://api.prelude.dev/v2/watch/management/rules \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prelude.dev/v2/watch/management/rules"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prelude.dev/v2/watch/management/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://api.prelude.dev/v2/watch/management/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: Bearer <token>"
],
]);
$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://api.prelude.dev/v2/watch/management/rules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prelude.dev/v2/watch/management/rules")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prelude.dev/v2/watch/management/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rules": [
{
"id": "rul_01jc0t6fwwfgfsq1md24mhyztj",
"name": "free_plan_signup",
"expression": "signal.ext.plan_tier == \"free\"",
"type": "CUSTOM",
"description": "Signups on the free plan."
}
],
"next_cursor": "rul_01jc0t6fwwfgfsq1md24mhyztj"
}{
"code": "invalid_phone_number",
"message": "The provided phone number is invalid. Provide a valid E.164 phone number.",
"type": "bad_request",
"request_id": "3d19215e-2991-4a05-a41a-527314e6ff6a",
"param": "phone_number"
}