curl --request PATCH \
--url https://eu.phrase.com/styleguide/api/v1/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ruleIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"active": true
}
'import requests
url = "https://eu.phrase.com/styleguide/api/v1/rules"
payload = {
"ruleIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"active": True
}
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({ruleIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], active: true})
};
fetch('https://eu.phrase.com/styleguide/api/v1/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://eu.phrase.com/styleguide/api/v1/rules",
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([
'ruleIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'active' => true
]),
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://eu.phrase.com/styleguide/api/v1/rules"
payload := strings.NewReader("{\n \"ruleIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"active\": true\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://eu.phrase.com/styleguide/api/v1/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ruleIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/styleguide/api/v1/rules")
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 \"ruleIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"updatedCount": 123,
"failures": [
{
"ruleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "RULE_NOT_FOUND",
"errorMessage": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}Enable or disable Rules in bulk
Enables or disables the listed Rules in a single request. One endpoint handles both
directions via the active field, using the same semantics as active on createRule/
updateRule. Partial success is possible; the response reports the updated count and
per-rule failures.
Enabling (active=true)
Rules are enabled in the order given in ruleIds. A Rule whose (Content Group, Language)
scope has no room left under the organization’s active-rule limit is skipped — reported as
a RULE_ACTIVE_LIMIT_REACHED failure — while later Rules with a different scope are still
attempted. This never changes aiCheckEnabled, matching updateRule’s behavior for an
explicit active=true with no aiCheckEnabled in the request.
Disabling (active=false)
Every listed Rule is disabled, and aiCheckEnabled is forced to false on each — AI check
requires an active Rule, the same cascade updateRule already applies for a single Rule.
Consistency guarantee
When active=true, the active-rule limit check is atomic across the whole batch: every
Rule in the request is evaluated against a single consistent view of each scope’s limit,
the same guarantee createRule/updateRule provide for a single Rule. If that guarantee
cannot be honored right now, the request fails with 503 RULE_ACTIVATION_LOCK_UNAVAILABLE
— retry the request. Not applicable when active=false.
curl --request PATCH \
--url https://eu.phrase.com/styleguide/api/v1/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ruleIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"active": true
}
'import requests
url = "https://eu.phrase.com/styleguide/api/v1/rules"
payload = {
"ruleIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"active": True
}
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({ruleIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], active: true})
};
fetch('https://eu.phrase.com/styleguide/api/v1/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://eu.phrase.com/styleguide/api/v1/rules",
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([
'ruleIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'active' => true
]),
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://eu.phrase.com/styleguide/api/v1/rules"
payload := strings.NewReader("{\n \"ruleIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"active\": true\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://eu.phrase.com/styleguide/api/v1/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ruleIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/styleguide/api/v1/rules")
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 \"ruleIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"updatedCount": 123,
"failures": [
{
"ruleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "RULE_NOT_FOUND",
"errorMessage": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}Authorizations
JWT from IDM (Authorization: Bearer )
Body
Was this page helpful?