Recipes
List your recipes
Beta. The request and response shapes may still change.
List your recipes.
GET
/
v2
/
watch
/
management
/
recipes
List recipes
curl --request GET \
--url https://api.prelude.dev/v2/watch/management/recipes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prelude.dev/v2/watch/management/recipes"
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/recipes', 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/recipes",
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/recipes"
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/recipes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prelude.dev/v2/watch/management/recipes")
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{
"recipes": [
{
"id": "rcp_01jc0t6fwwfgfsq1md24mhyztj",
"name": "signup_proxy_abuse",
"catalog_version": 1,
"status": "DRAFT",
"threshold": 70,
"rules": [
{
"rule_id": "rul_01jc0t6fwwfgfsq1md24mhyztj",
"weight": 40,
"preempts": "FLAG"
}
],
"attributes": [
"plan_tier",
"account_age_days"
],
"parameters": {
"blocked_countries": "RU,BY",
"max_attempts": "5"
}
}
],
"next_cursor": "rcp_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 recipes, with their rules, weights, thresholds and declared attributes and parameters.
Pagination works as it does elsewhere: pass
next_cursor back as cursor.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Maximum number of recipes to return per page. A larger value is clamped to 200 rather than refused.
Required range:
1 <= x <= 200Pagination cursor from the previous response.
⌘I
List recipes
curl --request GET \
--url https://api.prelude.dev/v2/watch/management/recipes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prelude.dev/v2/watch/management/recipes"
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/recipes', 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/recipes",
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/recipes"
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/recipes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prelude.dev/v2/watch/management/recipes")
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{
"recipes": [
{
"id": "rcp_01jc0t6fwwfgfsq1md24mhyztj",
"name": "signup_proxy_abuse",
"catalog_version": 1,
"status": "DRAFT",
"threshold": 70,
"rules": [
{
"rule_id": "rul_01jc0t6fwwfgfsq1md24mhyztj",
"weight": 40,
"preempts": "FLAG"
}
],
"attributes": [
"plan_tier",
"account_age_days"
],
"parameters": {
"blocked_countries": "RU,BY",
"max_attempts": "5"
}
}
],
"next_cursor": "rcp_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"
}