curl --request POST \
--url https://eu.phrase.com/styleguide/api/v1/rules/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pageNumber": 0,
"pageSize": 20,
"sortBy": "createdAt",
"sortDirection": "DESC",
"contentGroupIds": [
"cg-marketing-en"
],
"languages": [
"en-GB"
],
"includeGlobalRules": true,
"active": true,
"aiCheckEnabled": true,
"styleGuideIds": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
],
"lastModifiedBy": [
"5efc4feca115ac0bb5321917"
],
"ruleText": "Oxford comma",
"includeGlobalLanguageRules": true,
"critical": true
}
'import requests
url = "https://eu.phrase.com/styleguide/api/v1/rules/search"
payload = {
"pageNumber": 0,
"pageSize": 20,
"sortBy": "createdAt",
"sortDirection": "DESC",
"contentGroupIds": ["cg-marketing-en"],
"languages": ["en-GB"],
"includeGlobalRules": True,
"active": True,
"aiCheckEnabled": True,
"styleGuideIds": ["3fa85f64-5717-4562-b3fc-2c963f66afa6"],
"lastModifiedBy": ["5efc4feca115ac0bb5321917"],
"ruleText": "Oxford comma",
"includeGlobalLanguageRules": True,
"critical": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pageNumber: 0,
pageSize: 20,
sortBy: 'createdAt',
sortDirection: 'DESC',
contentGroupIds: ['cg-marketing-en'],
languages: ['en-GB'],
includeGlobalRules: true,
active: true,
aiCheckEnabled: true,
styleGuideIds: ['3fa85f64-5717-4562-b3fc-2c963f66afa6'],
lastModifiedBy: ['5efc4feca115ac0bb5321917'],
ruleText: 'Oxford comma',
includeGlobalLanguageRules: true,
critical: true
})
};
fetch('https://eu.phrase.com/styleguide/api/v1/rules/search', 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/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pageNumber' => 0,
'pageSize' => 20,
'sortBy' => 'createdAt',
'sortDirection' => 'DESC',
'contentGroupIds' => [
'cg-marketing-en'
],
'languages' => [
'en-GB'
],
'includeGlobalRules' => true,
'active' => true,
'aiCheckEnabled' => true,
'styleGuideIds' => [
'3fa85f64-5717-4562-b3fc-2c963f66afa6'
],
'lastModifiedBy' => [
'5efc4feca115ac0bb5321917'
],
'ruleText' => 'Oxford comma',
'includeGlobalLanguageRules' => true,
'critical' => 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/search"
payload := strings.NewReader("{\n \"pageNumber\": 0,\n \"pageSize\": 20,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"DESC\",\n \"contentGroupIds\": [\n \"cg-marketing-en\"\n ],\n \"languages\": [\n \"en-GB\"\n ],\n \"includeGlobalRules\": true,\n \"active\": true,\n \"aiCheckEnabled\": true,\n \"styleGuideIds\": [\n \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n ],\n \"lastModifiedBy\": [\n \"5efc4feca115ac0bb5321917\"\n ],\n \"ruleText\": \"Oxford comma\",\n \"includeGlobalLanguageRules\": true,\n \"critical\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://eu.phrase.com/styleguide/api/v1/rules/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pageNumber\": 0,\n \"pageSize\": 20,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"DESC\",\n \"contentGroupIds\": [\n \"cg-marketing-en\"\n ],\n \"languages\": [\n \"en-GB\"\n ],\n \"includeGlobalRules\": true,\n \"active\": true,\n \"aiCheckEnabled\": true,\n \"styleGuideIds\": [\n \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n ],\n \"lastModifiedBy\": [\n \"5efc4feca115ac0bb5321917\"\n ],\n \"ruleText\": \"Oxford comma\",\n \"includeGlobalLanguageRules\": true,\n \"critical\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/styleguide/api/v1/rules/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pageNumber\": 0,\n \"pageSize\": 20,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"DESC\",\n \"contentGroupIds\": [\n \"cg-marketing-en\"\n ],\n \"languages\": [\n \"en-GB\"\n ],\n \"includeGlobalRules\": true,\n \"active\": true,\n \"aiCheckEnabled\": true,\n \"styleGuideIds\": [\n \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n ],\n \"lastModifiedBy\": [\n \"5efc4feca115ac0bb5321917\"\n ],\n \"ruleText\": \"Oxford comma\",\n \"includeGlobalLanguageRules\": true,\n \"critical\": true\n}"
response = http.request(request)
puts response.read_body{
"content": [
{
"id": "01900000-0000-7000-8000-000000000001",
"rule": "Avoid passive voice in all user-facing content.",
"active": true,
"aiCheckEnabled": true,
"critical": true,
"allContentGroups": true,
"allLanguages": true,
"contentGroups": [
{
"id": "cg-marketing-en"
}
],
"languages": [
{
"bcpCode": "en-GB",
"description": "English (United Kingdom)",
"language": "cs",
"region": "gb",
"script": "LATN"
}
],
"createdAt": "2024-01-15T10:30:00Z",
"lastModifiedAt": "2024-06-01T14:22:00Z",
"name": "No passive voice",
"omittedReason": "<string>",
"eligibilityCheckedAt": "2024-06-01T14:22:05Z",
"styleGuide": null,
"createdBy": null,
"lastModifiedBy": null
}
],
"totalElements": 123,
"totalPages": 123,
"pageNumber": 123,
"pageSize": 123,
"numberOfElements": 123
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}List Rules
Returns a paginated, sorted list of Rules. Defaults to creation date descending. Filtering by the organizationās Control Hub āAll Groupsā system content group ID also matches Rules with allContentGroups=true, since that system content group ID conceptually represents all content groups.
curl --request POST \
--url https://eu.phrase.com/styleguide/api/v1/rules/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pageNumber": 0,
"pageSize": 20,
"sortBy": "createdAt",
"sortDirection": "DESC",
"contentGroupIds": [
"cg-marketing-en"
],
"languages": [
"en-GB"
],
"includeGlobalRules": true,
"active": true,
"aiCheckEnabled": true,
"styleGuideIds": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
],
"lastModifiedBy": [
"5efc4feca115ac0bb5321917"
],
"ruleText": "Oxford comma",
"includeGlobalLanguageRules": true,
"critical": true
}
'import requests
url = "https://eu.phrase.com/styleguide/api/v1/rules/search"
payload = {
"pageNumber": 0,
"pageSize": 20,
"sortBy": "createdAt",
"sortDirection": "DESC",
"contentGroupIds": ["cg-marketing-en"],
"languages": ["en-GB"],
"includeGlobalRules": True,
"active": True,
"aiCheckEnabled": True,
"styleGuideIds": ["3fa85f64-5717-4562-b3fc-2c963f66afa6"],
"lastModifiedBy": ["5efc4feca115ac0bb5321917"],
"ruleText": "Oxford comma",
"includeGlobalLanguageRules": True,
"critical": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pageNumber: 0,
pageSize: 20,
sortBy: 'createdAt',
sortDirection: 'DESC',
contentGroupIds: ['cg-marketing-en'],
languages: ['en-GB'],
includeGlobalRules: true,
active: true,
aiCheckEnabled: true,
styleGuideIds: ['3fa85f64-5717-4562-b3fc-2c963f66afa6'],
lastModifiedBy: ['5efc4feca115ac0bb5321917'],
ruleText: 'Oxford comma',
includeGlobalLanguageRules: true,
critical: true
})
};
fetch('https://eu.phrase.com/styleguide/api/v1/rules/search', 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/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pageNumber' => 0,
'pageSize' => 20,
'sortBy' => 'createdAt',
'sortDirection' => 'DESC',
'contentGroupIds' => [
'cg-marketing-en'
],
'languages' => [
'en-GB'
],
'includeGlobalRules' => true,
'active' => true,
'aiCheckEnabled' => true,
'styleGuideIds' => [
'3fa85f64-5717-4562-b3fc-2c963f66afa6'
],
'lastModifiedBy' => [
'5efc4feca115ac0bb5321917'
],
'ruleText' => 'Oxford comma',
'includeGlobalLanguageRules' => true,
'critical' => 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/search"
payload := strings.NewReader("{\n \"pageNumber\": 0,\n \"pageSize\": 20,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"DESC\",\n \"contentGroupIds\": [\n \"cg-marketing-en\"\n ],\n \"languages\": [\n \"en-GB\"\n ],\n \"includeGlobalRules\": true,\n \"active\": true,\n \"aiCheckEnabled\": true,\n \"styleGuideIds\": [\n \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n ],\n \"lastModifiedBy\": [\n \"5efc4feca115ac0bb5321917\"\n ],\n \"ruleText\": \"Oxford comma\",\n \"includeGlobalLanguageRules\": true,\n \"critical\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://eu.phrase.com/styleguide/api/v1/rules/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pageNumber\": 0,\n \"pageSize\": 20,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"DESC\",\n \"contentGroupIds\": [\n \"cg-marketing-en\"\n ],\n \"languages\": [\n \"en-GB\"\n ],\n \"includeGlobalRules\": true,\n \"active\": true,\n \"aiCheckEnabled\": true,\n \"styleGuideIds\": [\n \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n ],\n \"lastModifiedBy\": [\n \"5efc4feca115ac0bb5321917\"\n ],\n \"ruleText\": \"Oxford comma\",\n \"includeGlobalLanguageRules\": true,\n \"critical\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/styleguide/api/v1/rules/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pageNumber\": 0,\n \"pageSize\": 20,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"DESC\",\n \"contentGroupIds\": [\n \"cg-marketing-en\"\n ],\n \"languages\": [\n \"en-GB\"\n ],\n \"includeGlobalRules\": true,\n \"active\": true,\n \"aiCheckEnabled\": true,\n \"styleGuideIds\": [\n \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n ],\n \"lastModifiedBy\": [\n \"5efc4feca115ac0bb5321917\"\n ],\n \"ruleText\": \"Oxford comma\",\n \"includeGlobalLanguageRules\": true,\n \"critical\": true\n}"
response = http.request(request)
puts response.read_body{
"content": [
{
"id": "01900000-0000-7000-8000-000000000001",
"rule": "Avoid passive voice in all user-facing content.",
"active": true,
"aiCheckEnabled": true,
"critical": true,
"allContentGroups": true,
"allLanguages": true,
"contentGroups": [
{
"id": "cg-marketing-en"
}
],
"languages": [
{
"bcpCode": "en-GB",
"description": "English (United Kingdom)",
"language": "cs",
"region": "gb",
"script": "LATN"
}
],
"createdAt": "2024-01-15T10:30:00Z",
"lastModifiedAt": "2024-06-01T14:22:00Z",
"name": "No passive voice",
"omittedReason": "<string>",
"eligibilityCheckedAt": "2024-06-01T14:22:05Z",
"styleGuide": null,
"createdBy": null,
"lastModifiedBy": null
}
],
"totalElements": 123,
"totalPages": 123,
"pageNumber": 123,
"pageSize": 123,
"numberOfElements": 123
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}Body
Request parameters for listing Rules
When true, rules linked to all content groups or all languages (global rules) are included in addition to any explicit contentGroupIds/languages filter matches. If contentGroupIds is omitted, this instead restricts results to globally-scoped rules (linked to all content groups or all languages) rather than adding to an unset filter. See includeGlobalLanguageRules for including all-languages rules without that content-group-axis restriction when contentGroupIds is omitted.
true
When true, rules linked to all languages are included in addition to any explicit languages filter matches. Unlike includeGlobalRules, this has no effect on content-group filtering: it never restricts results when contentGroupIds is omitted, making it safe for callers that want all-languages rules included without also restricting to globally-scoped-only content groups.
true
Response
Rules retrieved successfully
Paginated list of Rules
Was this page helpful?