List a rule's versions
curl --request GET \
--url https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions"
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))
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"items": [
{
"action": "ALLOW",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"expression": "<string>",
"ruleId": "<string>",
"scopes": [
{
"accountId": "00000000-0000-0000-0000-000000000000",
"merchantId": "00000000-0000-0000-0000-000000000000",
"portfolioId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX",
"segmentId": "00000000-0000-0000-0000-000000000000",
"subType": "purchase",
"transactionType": "PIX"
}
],
"version": 123
}
]
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}List a rule's versions
Use this endpoint to list every version of what the rule decides (expression, action, scopes), oldest first, with who wrote each one. The ruleβs currentVersion and draftVersion name two of them.
GET
/
v1
/
rules
/
{rule_id}
/
versions
List a rule's versions
curl --request GET \
--url https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions"
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))
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://tracer.sandbox.lerian.net/v1/rules/{rule_id}/versions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"items": [
{
"action": "ALLOW",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"expression": "<string>",
"ruleId": "<string>",
"scopes": [
{
"accountId": "00000000-0000-0000-0000-000000000000",
"merchantId": "00000000-0000-0000-0000-000000000000",
"portfolioId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX",
"segmentId": "00000000-0000-0000-0000-000000000000",
"subType": "purchase",
"transactionType": "PIX"
}
],
"version": 123
}
]
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Was this page helpful?

