cURL
curl "https://api.phrase.com/v2/projects/:project_id/job_templates/:job_template_id/locales/:job_template_locale_id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"branch":"my-feature-branch","locale_id":"abcd1234cdef1234abcd1234cdef1234","user_ids":["abcd1234cdef1234abcd1234cdef1234"],"reviewer_ids":["abcd1234cdef1234abcd1234cdef1234"], "translator_team_ids":["abcd1234cdef1234abcd1234cdef1234"]}' \
-H 'Content-Type: application/json'phrase job_template_locales update \
--project_id <project_id> \
--job_template_id <job_template_id> \
--job_template_locale_id <job_template_locale_id> \
--data '{"branch":"my-feature-branch", "locale_id":"abcd1234cdef1234abcd1234cdef1234", "user_ids": "abcd1234cdef1234abcd1234cdef1234", "reviewer_ids": "abcd1234cdef1234abcd1234cdef1234", "translator_team_ids": "abcd1234cdef1234abcd1234cdef1234"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}"
payload = {
"branch": "my-feature-branch",
"locale_id": "abcd1234cdef1234abcd1234cdef1234",
"user_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"reviewer_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"translator_team_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"reviewer_team_ids": ["abcd1234cdef1234abcd1234cdef1234"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch: 'my-feature-branch',
locale_id: 'abcd1234cdef1234abcd1234cdef1234',
user_ids: ['abcd1234cdef1234abcd1234cdef1234'],
reviewer_ids: ['abcd1234cdef1234abcd1234cdef1234'],
translator_team_ids: ['abcd1234cdef1234abcd1234cdef1234'],
reviewer_team_ids: ['abcd1234cdef1234abcd1234cdef1234']
})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}', 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://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}",
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([
'branch' => 'my-feature-branch',
'locale_id' => 'abcd1234cdef1234abcd1234cdef1234',
'user_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'reviewer_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'translator_team_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'reviewer_team_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}"
payload := strings.NewReader("{\n \"branch\": \"my-feature-branch\",\n \"locale_id\": \"abcd1234cdef1234abcd1234cdef1234\",\n \"user_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"translator_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"my-feature-branch\",\n \"locale_id\": \"abcd1234cdef1234abcd1234cdef1234\",\n \"user_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"translator_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branch\": \"my-feature-branch\",\n \"locale_id\": \"abcd1234cdef1234abcd1234cdef1234\",\n \"user_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"translator_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"job_template": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "template"
},
"users": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe",
"role": "translator"
}
],
"teams": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "Joe's team",
"role": "translator"
}
],
"locale": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
}Job Template Locales
Update a job template locale
Update an existing job template locale.
PATCH
/
projects
/
{project_id}
/
job_templates
/
{job_template_id}
/
locales
/
{job_template_locale_id}
cURL
curl "https://api.phrase.com/v2/projects/:project_id/job_templates/:job_template_id/locales/:job_template_locale_id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"branch":"my-feature-branch","locale_id":"abcd1234cdef1234abcd1234cdef1234","user_ids":["abcd1234cdef1234abcd1234cdef1234"],"reviewer_ids":["abcd1234cdef1234abcd1234cdef1234"], "translator_team_ids":["abcd1234cdef1234abcd1234cdef1234"]}' \
-H 'Content-Type: application/json'phrase job_template_locales update \
--project_id <project_id> \
--job_template_id <job_template_id> \
--job_template_locale_id <job_template_locale_id> \
--data '{"branch":"my-feature-branch", "locale_id":"abcd1234cdef1234abcd1234cdef1234", "user_ids": "abcd1234cdef1234abcd1234cdef1234", "reviewer_ids": "abcd1234cdef1234abcd1234cdef1234", "translator_team_ids": "abcd1234cdef1234abcd1234cdef1234"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}"
payload = {
"branch": "my-feature-branch",
"locale_id": "abcd1234cdef1234abcd1234cdef1234",
"user_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"reviewer_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"translator_team_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"reviewer_team_ids": ["abcd1234cdef1234abcd1234cdef1234"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch: 'my-feature-branch',
locale_id: 'abcd1234cdef1234abcd1234cdef1234',
user_ids: ['abcd1234cdef1234abcd1234cdef1234'],
reviewer_ids: ['abcd1234cdef1234abcd1234cdef1234'],
translator_team_ids: ['abcd1234cdef1234abcd1234cdef1234'],
reviewer_team_ids: ['abcd1234cdef1234abcd1234cdef1234']
})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}', 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://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}",
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([
'branch' => 'my-feature-branch',
'locale_id' => 'abcd1234cdef1234abcd1234cdef1234',
'user_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'reviewer_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'translator_team_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'reviewer_team_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}"
payload := strings.NewReader("{\n \"branch\": \"my-feature-branch\",\n \"locale_id\": \"abcd1234cdef1234abcd1234cdef1234\",\n \"user_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"translator_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"my-feature-branch\",\n \"locale_id\": \"abcd1234cdef1234abcd1234cdef1234\",\n \"user_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"translator_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/job_templates/{job_template_id}/locales/{job_template_locale_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branch\": \"my-feature-branch\",\n \"locale_id\": \"abcd1234cdef1234abcd1234cdef1234\",\n \"user_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"translator_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"reviewer_team_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"job_template": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "template"
},
"users": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe",
"role": "translator"
}
],
"teams": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "Joe's team",
"role": "translator"
}
],
"locale": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
}Authorizations
TokenBasic
Enter your token in the format token TOKEN
Headers
Two-Factor-Authentication token (optional)
Path Parameters
Project ID
Job Template ID
Job Template Locale ID
Body
application/json
specify the branch to use
Example:
"my-feature-branch"
locale id
Example:
"abcd1234cdef1234abcd1234cdef1234"
Array of user ids to be assigned to the job template locale
Example:
["abcd1234cdef1234abcd1234cdef1234"]
Array of reviewer ids to be assigned to the job template locale
Example:
["abcd1234cdef1234abcd1234cdef1234"]
Array of team ids to be assigned to the job locale as translators
Example:
["abcd1234cdef1234abcd1234cdef1234"]
Array of team ids to be assigned to the job locale as reviewers
Example:
["abcd1234cdef1234abcd1234cdef1234"]
Response
OK
Show child attributes
Show child attributes
Example:
null
Show child attributes
Show child attributes
Example:
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I