Skip to main content
POST
/
v1
/
qualityProfiles
Create Quality Profile
curl --request POST \
  --url https://eu.phrase.com/quality-evaluator/v1/qualityProfiles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "name": "Marketing Content Profile",
  "aiCheckUids": [
    "6804a3f2e1b2c3d4e5f60789",
    "6804a3f2e1b2c3d4e5f6078a"
  ]
}
'
import requests

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

payload = {
    "name": "Marketing Content Profile",
    "aiCheckUids": ["6804a3f2e1b2c3d4e5f60789", "6804a3f2e1b2c3d4e5f6078a"]
}
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: 'Marketing Content Profile',
    aiCheckUids: ['6804a3f2e1b2c3d4e5f60789', '6804a3f2e1b2c3d4e5f6078a']
  })
};

fetch('https://eu.phrase.com/quality-evaluator/v1/qualityProfiles', 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/qualityProfiles",
  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' => 'Marketing Content Profile',
    'aiCheckUids' => [
        '6804a3f2e1b2c3d4e5f60789',
        '6804a3f2e1b2c3d4e5f6078a'
    ]
  ]),
  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/qualityProfiles"

	payload := strings.NewReader("{\n  \"name\": \"Marketing Content Profile\",\n  \"aiCheckUids\": [\n    \"6804a3f2e1b2c3d4e5f60789\",\n    \"6804a3f2e1b2c3d4e5f6078a\"\n  ]\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/qualityProfiles")
  .header("Content-Type", "<content-type>")
  .header("Authorization", "Bearer <token>")
  .body("{\n  \"name\": \"Marketing Content Profile\",\n  \"aiCheckUids\": [\n    \"6804a3f2e1b2c3d4e5f60789\",\n    \"6804a3f2e1b2c3d4e5f6078a\"\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

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

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\": \"Marketing Content Profile\",\n  \"aiCheckUids\": [\n    \"6804a3f2e1b2c3d4e5f60789\",\n    \"6804a3f2e1b2c3d4e5f6078a\"\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "uid": "6804b1c2d3e4f5a6b7c80123",
  "name": "Marketing Content Profile",
  "aiChecks": [
    {
      "uid": "6804a3f2e1b2c3d4e5f60789",
      "name": "No Yoda Speech",
      "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
    },
    {
      "uid": "6804a3f2e1b2c3d4e5f6078a",
      "name": "Formal Register",
      "qualityRequirements": "The translation must use formal language and avoid colloquialisms."
    }
  ],
  "createdDate": "2024-01-15T10:30:00Z",
  "lastModifiedDate": "2024-01-15T10:30:00Z",
  "createdByUid": "6804c9d0e1f2a3b4c5d60456"
}
{
  "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 Quality Profile.

Example:

"Marketing Content Profile"

aiCheckUids
string[]

UIDs of AI Checks to include in this profile. All must belong to the caller's organization. Maximum 3 items.

Maximum array length: 3

Response

Created — the new Quality Profile.

uid
string
required
Example:

"6804b1c2d3e4f5a6b7c80123"

name
string
required
Example:

"Marketing Content Profile"

createdDate
string<date-time>
required
Example:

"2024-01-15T10:30:00Z"

createdByUid
string
required
Example:

"6804c9d0e1f2a3b4c5d60456"

aiChecks
object[]
lastModifiedDate
string<date-time>
Example:

"2024-03-20T14:45:00Z"