Skip to main content
POST
/
v1
/
aiChecks
Create AI Check
curl --request POST \
  --url https://eu.phrase.com/quality-evaluator/v1/aiChecks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "name": "No Yoda Speech",
  "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
}
'
import requests

url = "https://eu.phrase.com/quality-evaluator/v1/aiChecks"

payload = {
    "name": "No Yoda Speech",
    "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
}
headers = {
    "Content-Type": "<content-type>",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'No Yoda Speech',
    qualityRequirements: 'The translation must not use Yoda-style inverted sentence structure.'
  })
};

fetch('https://eu.phrase.com/quality-evaluator/v1/aiChecks', 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/quality-evaluator/v1/aiChecks",
  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([
    'name' => 'No Yoda Speech',
    'qualityRequirements' => 'The translation must not use Yoda-style inverted sentence structure.'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: <content-type>"
  ],
]);

$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/quality-evaluator/v1/aiChecks"

	payload := strings.NewReader("{\n  \"name\": \"No Yoda Speech\",\n  \"qualityRequirements\": \"The translation must not use Yoda-style inverted sentence structure.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "<content-type>")
	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://eu.phrase.com/quality-evaluator/v1/aiChecks")
  .header("Content-Type", "<content-type>")
  .header("Authorization", "Bearer <token>")
  .body("{\n  \"name\": \"No Yoda Speech\",\n  \"qualityRequirements\": \"The translation must not use Yoda-style inverted sentence structure.\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://eu.phrase.com/quality-evaluator/v1/aiChecks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n  \"name\": \"No Yoda Speech\",\n  \"qualityRequirements\": \"The translation must not use Yoda-style inverted sentence structure.\"\n}"

response = http.request(request)
puts response.read_body
{
  "uid": "6804a3f2e1b2c3d4e5f60789",
  "name": "No Yoda Speech",
  "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
}
{
  "type": "urn:problem-type:unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Valid credentials were not supplied",
  "instance": "<string>"
}
{
  "type": "urn:problem-type:unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Valid credentials were not supplied"
}
{
  "type": "urn:problem-type:forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions to perform this action"
}
{
  "type": "urn:problem-type:unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Valid credentials were not supplied",
  "instance": "<string>"
}

Authorizations

Authorization
string
header
required

Use a Bearer token obtained from Phrase Platform authentication. See the Authentication guide for details on how to obtain a token.

Headers

Content-Type
string
required
Example:

"application/json"

Body

application/json
name
string
required

Display name for the AI Check.

Example:

"No Yoda Speech"

qualityRequirements
string
required

Natural language description of the quality requirements to check.

Maximum string length: 2000
Example:

"The translation must not use Yoda-style inverted sentence structure."

Response

Created — the new AI Check.

uid
string
required
Example:

"6804a3f2e1b2c3d4e5f60789"

name
string
required
Example:

"No Yoda Speech"

qualityRequirements
string
required
Maximum string length: 2000
Example:

"The translation must not use Yoda-style inverted sentence structure."

locales
string[]

Locale codes this AI Check applies to. Absent or empty means the check applies to all locales.

Locale code compatible with Phrase locale format. Case-insensitive, supports both underscore and hyphen separators (e.g., en_us, en-US, de_de, fr_fr).