Skip to main content
POST
/
v3
/
evaluation
Evaluate segments
curl --request POST \
  --url https://eu.phrase.com/quality-evaluator/v3/evaluation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "contentGroupId": "cg-abc123",
  "segments": [
    {
      "id": "segment-1",
      "source": "Hello, world!",
      "target": "Hallo, Welt!"
    }
  ],
  "sourceLocaleCode": "en_us",
  "targetLocaleCode": "de_de"
}
'
import requests

url = "https://eu.phrase.com/quality-evaluator/v3/evaluation"

payload = {
    "contentGroupId": "cg-abc123",
    "segments": [
        {
            "id": "segment-1",
            "source": "Hello, world!",
            "target": "Hallo, Welt!"
        }
    ],
    "sourceLocaleCode": "en_us",
    "targetLocaleCode": "de_de"
}
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({
    contentGroupId: 'cg-abc123',
    segments: [{id: 'segment-1', source: 'Hello, world!', target: 'Hallo, Welt!'}],
    sourceLocaleCode: 'en_us',
    targetLocaleCode: 'de_de'
  })
};

fetch('https://eu.phrase.com/quality-evaluator/v3/evaluation', 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/v3/evaluation",
  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([
    'contentGroupId' => 'cg-abc123',
    'segments' => [
        [
                'id' => 'segment-1',
                'source' => 'Hello, world!',
                'target' => 'Hallo, Welt!'
        ]
    ],
    'sourceLocaleCode' => 'en_us',
    'targetLocaleCode' => 'de_de'
  ]),
  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/v3/evaluation"

	payload := strings.NewReader("{\n  \"contentGroupId\": \"cg-abc123\",\n  \"segments\": [\n    {\n      \"id\": \"segment-1\",\n      \"source\": \"Hello, world!\",\n      \"target\": \"Hallo, Welt!\"\n    }\n  ],\n  \"sourceLocaleCode\": \"en_us\",\n  \"targetLocaleCode\": \"de_de\"\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/v3/evaluation")
  .header("Content-Type", "<content-type>")
  .header("Authorization", "Bearer <token>")
  .body("{\n  \"contentGroupId\": \"cg-abc123\",\n  \"segments\": [\n    {\n      \"id\": \"segment-1\",\n      \"source\": \"Hello, world!\",\n      \"target\": \"Hallo, Welt!\"\n    }\n  ],\n  \"sourceLocaleCode\": \"en_us\",\n  \"targetLocaleCode\": \"de_de\"\n}")
  .asString();
require 'uri'
require 'net/http'

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

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  \"contentGroupId\": \"cg-abc123\",\n  \"segments\": [\n    {\n      \"id\": \"segment-1\",\n      \"source\": \"Hello, world!\",\n      \"target\": \"Hallo, Welt!\"\n    }\n  ],\n  \"sourceLocaleCode\": \"en_us\",\n  \"targetLocaleCode\": \"de_de\"\n}"

response = http.request(request)
puts response.read_body
{
  "contentGroupId": "cg-abc123",
  "segments": [
    {
      "id": "segment-1",
      "source": "Hello, world!",
      "target": "Hallo, Welt!",
      "results": [
        {
          "type": "AI_CHECK",
          "ruleUid": "rule-abc123",
          "evaluation": {
            "isValid": true,
            "explanation": "The translation uses standard German 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>"
}
{
  "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

Request to evaluate translation segments using AI Checks resolved from a Content Group.

contentGroupId
string
required

ID of the Content Group whose AI Checks are used for evaluation.

segments
object[]
required

Segments to evaluate. Each segment's id is required and must be unique within the request.

Required array length: 1 - 200 elements
sourceLocaleCode
string
required

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).

Example:

"en_us"

targetLocaleCode
string
required

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).

Example:

"en_us"

Response

Evaluation completed successfully. Returns evaluated segments with per-check results.

Evaluation results for the v3 endpoint.

segments
object[]
required

Evaluated segments with all check results nested per segment.

contentGroupId
string

ID of the Content Group whose AI Checks were used for evaluation.