cURL
curl "https://api.phrase.com/v2/accounts/:account_id/job_templates/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-H 'Content-Type: application/json'phrase organization_job_templates update \
--account_id <account_id> \
--id <id> \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}"
payload = {
"name": "template",
"briefing": "text",
"autotranslate": True
}
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({name: 'template', briefing: 'text', autotranslate: true})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/job_templates/{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/accounts/{account_id}/job_templates/{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([
'name' => 'template',
'briefing' => 'text',
'autotranslate' => true
]),
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/accounts/{account_id}/job_templates/{id}"
payload := strings.NewReader("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true\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/accounts/{account_id}/job_templates/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/job_templates/{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 \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"name": "template",
"briefing": "text",
"created_at": "2017-01-28T09:52:53Z",
"updated_at": "2017-01-28T09:52:53Z",
"owner": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"creator": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
]
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Organization Job Templates
Update an organization job template
Update an existing organization job template.
PATCH
/
accounts
/
{account_id}
/
job_templates
/
{id}
cURL
curl "https://api.phrase.com/v2/accounts/:account_id/job_templates/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-H 'Content-Type: application/json'phrase organization_job_templates update \
--account_id <account_id> \
--id <id> \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}"
payload = {
"name": "template",
"briefing": "text",
"autotranslate": True
}
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({name: 'template', briefing: 'text', autotranslate: true})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/job_templates/{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/accounts/{account_id}/job_templates/{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([
'name' => 'template',
'briefing' => 'text',
'autotranslate' => true
]),
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/accounts/{account_id}/job_templates/{id}"
payload := strings.NewReader("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true\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/accounts/{account_id}/job_templates/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/job_templates/{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 \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"name": "template",
"briefing": "text",
"created_at": "2017-01-28T09:52:53Z",
"updated_at": "2017-01-28T09:52:53Z",
"owner": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"creator": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
]
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Authorizations
TokenBasic
Enter your token in the format token TOKEN
Headers
Two-Factor-Authentication token (optional)
Body
application/json
Response
OK
When true, jobs created from this template are auto-translated on creation. Maps to the autotranslate field on the request body.
Optional. ID of the source locale used by jobs created from this template. When omitted, the project's default source locale is used.
Show child attributes
Show child attributes
Example:
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "johndoe",
"name": "John Doe",
"gravatar_uid": "205e460b479e2e5b48aec07710c08d50"
}
Show child attributes
Show child attributes
Example:
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "johndoe",
"name": "John Doe",
"gravatar_uid": "205e460b479e2e5b48aec07710c08d50"
}
Show child attributes
Show child attributes
Was this page helpful?
⌘I