Rulesets
Activate ruleset
Transitions a ruleset from DRAFT → ACTIVE. Any previously ACTIVE ruleset for the same context is demoted to INACTIVE.
POST
/
api
/
admin
/
rulesets
/
{id}
/
activate
Activate ruleset
curl --request POST \
--url https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate \
--header 'Authorization: Bearer <token>'import requests
url = "https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate', 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://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate"
req, _ := http.NewRequest("POST", 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.post("https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"activated_at": "2023-11-07T05:31:56Z",
"context": "checkout",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"rules": [
{
"enabled": true,
"id": "r1",
"async": true,
"backend": "vdm",
"condition": {},
"description": "<string>",
"fields": [
"<string>"
],
"live": true,
"members": [
{
"backend": "vdm",
"live": true,
"weight": 60
}
],
"name": "Block USD",
"populate_on": [],
"ttl_seconds": 123
}
],
"version": 1
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "VALIDATION_ERROR",
"code": 422,
"validation_errors": [
{
"message": "must be a positive integer",
"path": "limit"
}
]
}Authorizations
HS256-signed JWT bearer token, obtained via the OAuth2 client-credentials grant (see Authentication).
Path Parameters
Ruleset ID
Response
Activated ruleset
Example:
"checkout"
Rule definitions evaluated in array order
Show child attributes
Show child attributes
Available options:
DRAFT, ACTIVE, INACTIVE Example:
1
Previous
Rollback rulesetPromotes an INACTIVE ruleset back to ACTIVE, demoting the current ACTIVE to INACTIVE.
Next
⌘I
Activate ruleset
curl --request POST \
--url https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate \
--header 'Authorization: Bearer <token>'import requests
url = "https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate', 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://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate"
req, _ := http.NewRequest("POST", 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.post("https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.{env}.on-hellgate.cloud/api/admin/rulesets/{id}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"activated_at": "2023-11-07T05:31:56Z",
"context": "checkout",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"rules": [
{
"enabled": true,
"id": "r1",
"async": true,
"backend": "vdm",
"condition": {},
"description": "<string>",
"fields": [
"<string>"
],
"live": true,
"members": [
{
"backend": "vdm",
"live": true,
"weight": 60
}
],
"name": "Block USD",
"populate_on": [],
"ttl_seconds": 123
}
],
"version": 1
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "VALIDATION_ERROR",
"code": 422,
"validation_errors": [
{
"message": "must be a positive integer",
"path": "limit"
}
]
}