Activate or deactivate a business-logic rule
curl --request PATCH \
--url https://app.solya.app/api/business-logic-rules/{id}/toggle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": false
}
'import requests
url = "https://app.solya.app/api/business-logic-rules/{id}/toggle"
payload = { "isActive": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({isActive: false})
};
fetch('https://app.solya.app/api/business-logic-rules/{id}/toggle', 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.solya.app/api/business-logic-rules/{id}/toggle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'isActive' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.solya.app/api/business-logic-rules/{id}/toggle"
payload := strings.NewReader("{\n \"isActive\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.solya.app/api/business-logic-rules/{id}/toggle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isActive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.solya.app/api/business-logic-rules/{id}/toggle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isActive\": false\n}"
response = http.request(request)
puts response.read_body{
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": []
},
"createdAt": "2026-06-04T10:00:00.000Z",
"description": null,
"enforcementMode": "WARN",
"evaluationPoints": [
"RESTOCK_PRE_ADD_ITEM"
],
"id": "rule-uuid-123",
"isActive": false,
"logAllEvaluations": false,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"phase": null,
"priority": 1,
"ruleGroupIds": [
"ruleset-uuid-default"
],
"scope": {
"checkLevel": "PLAN_ITEM"
},
"sourceTemplateId": null,
"updatedAt": "2026-06-04T12:00:00.000Z",
"validationHooks": [
"RESTOCK_PRE_ADD_ITEM"
],
"violationMessage": null
}Business Logic Rules
Activate or deactivate a business-logic rule
Toggles the isActive flag on a business-logic rule. Returns 404 when the rule does not exist or belongs to another organization. Requires intelligenceLayer.configure permission.
PATCH
/
api
/
business-logic-rules
/
{id}
/
toggle
Activate or deactivate a business-logic rule
curl --request PATCH \
--url https://app.solya.app/api/business-logic-rules/{id}/toggle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": false
}
'import requests
url = "https://app.solya.app/api/business-logic-rules/{id}/toggle"
payload = { "isActive": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({isActive: false})
};
fetch('https://app.solya.app/api/business-logic-rules/{id}/toggle', 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.solya.app/api/business-logic-rules/{id}/toggle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'isActive' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.solya.app/api/business-logic-rules/{id}/toggle"
payload := strings.NewReader("{\n \"isActive\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.solya.app/api/business-logic-rules/{id}/toggle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isActive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.solya.app/api/business-logic-rules/{id}/toggle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isActive\": false\n}"
response = http.request(request)
puts response.read_body{
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": []
},
"createdAt": "2026-06-04T10:00:00.000Z",
"description": null,
"enforcementMode": "WARN",
"evaluationPoints": [
"RESTOCK_PRE_ADD_ITEM"
],
"id": "rule-uuid-123",
"isActive": false,
"logAllEvaluations": false,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"phase": null,
"priority": 1,
"ruleGroupIds": [
"ruleset-uuid-default"
],
"scope": {
"checkLevel": "PLAN_ITEM"
},
"sourceTemplateId": null,
"updatedAt": "2026-06-04T12:00:00.000Z",
"validationHooks": [
"RESTOCK_PRE_ADD_ITEM"
],
"violationMessage": null
}Authorizations
User session token issued by NextAuth. For human users accessing Solya via the web application.
Path Parameters
Unique identifier of the business-logic rule (UUID)
Minimum string length:
1Body
application/json
⌘I

