curl "https://api.phrase.com/v2/projects/:project_id/jobs/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"branch":"my-feature-branch","name":"de","briefing":"de-DE","due_date":"2017-08-15","ticket_url":"https://example.atlassian.net/browse/FOO"}' \
-H 'Content-Type: application/json'phrase jobs update \
--project_id <project_id> \
--id <id> \
--data '{"branch":"my-feature-branch", "name":"de", "briefing":"de-DE", "due_date":"2017-08-15", "ticket_url":"https://example.atlassian.net/browse/FOO"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/jobs/{id}"
payload = {
"branch": "my-feature-branch",
"name": "de",
"briefing": "de-DE",
"due_date": "2017-08-15",
"ticket_url": "https://example.atlassian.net/browse/FOO",
"target_locale_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"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({
branch: 'my-feature-branch',
name: 'de',
briefing: 'de-DE',
due_date: '2017-08-15',
ticket_url: 'https://example.atlassian.net/browse/FOO',
target_locale_ids: ['abcd1234cdef1234abcd1234cdef1234'],
autotranslate: true
})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/jobs/{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}/jobs/{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',
'name' => 'de',
'briefing' => 'de-DE',
'due_date' => '2017-08-15',
'ticket_url' => 'https://example.atlassian.net/browse/FOO',
'target_locale_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'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/projects/{project_id}/jobs/{id}"
payload := strings.NewReader("{\n \"branch\": \"my-feature-branch\",\n \"name\": \"de\",\n \"briefing\": \"de-DE\",\n \"due_date\": \"2017-08-15\",\n \"ticket_url\": \"https://example.atlassian.net/browse/FOO\",\n \"target_locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\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/projects/{project_id}/jobs/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"my-feature-branch\",\n \"name\": \"de\",\n \"briefing\": \"de-DE\",\n \"due_date\": \"2017-08-15\",\n \"ticket_url\": \"https://example.atlassian.net/browse/FOO\",\n \"target_locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"autotranslate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/jobs/{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 \"name\": \"de\",\n \"briefing\": \"de-DE\",\n \"due_date\": \"2017-08-15\",\n \"ticket_url\": \"https://example.atlassian.net/browse/FOO\",\n \"target_locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"autotranslate\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"name": "Translations for new Feature",
"briefing": "Some instructions for the translators",
"due_date": "2017-02-28T09:52:53Z",
"state": "completed",
"ticket_url": "https://example.atlassian.net/browse/FOO",
"created_at": "2017-01-28T09:52:53Z",
"updated_at": "2017-01-28T09:52:53Z",
"project": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
},
"owner": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"job_tag_name": "Job_123",
"source_translations_updated_at": "2020-01-01T00:00:00Z",
"source_locale": {
"id": "abcd1234cdef1234abcd1234cdef1235",
"name": "de-DE",
"code": "de-DE"
},
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
],
"keys": [
{
"id": "dbcd1234cdef1234abcd1234cdef1234",
"name": "greeting.hello"
}
]
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Update a job
Update an existing job.
curl "https://api.phrase.com/v2/projects/:project_id/jobs/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"branch":"my-feature-branch","name":"de","briefing":"de-DE","due_date":"2017-08-15","ticket_url":"https://example.atlassian.net/browse/FOO"}' \
-H 'Content-Type: application/json'phrase jobs update \
--project_id <project_id> \
--id <id> \
--data '{"branch":"my-feature-branch", "name":"de", "briefing":"de-DE", "due_date":"2017-08-15", "ticket_url":"https://example.atlassian.net/browse/FOO"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/jobs/{id}"
payload = {
"branch": "my-feature-branch",
"name": "de",
"briefing": "de-DE",
"due_date": "2017-08-15",
"ticket_url": "https://example.atlassian.net/browse/FOO",
"target_locale_ids": ["abcd1234cdef1234abcd1234cdef1234"],
"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({
branch: 'my-feature-branch',
name: 'de',
briefing: 'de-DE',
due_date: '2017-08-15',
ticket_url: 'https://example.atlassian.net/browse/FOO',
target_locale_ids: ['abcd1234cdef1234abcd1234cdef1234'],
autotranslate: true
})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/jobs/{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}/jobs/{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',
'name' => 'de',
'briefing' => 'de-DE',
'due_date' => '2017-08-15',
'ticket_url' => 'https://example.atlassian.net/browse/FOO',
'target_locale_ids' => [
'abcd1234cdef1234abcd1234cdef1234'
],
'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/projects/{project_id}/jobs/{id}"
payload := strings.NewReader("{\n \"branch\": \"my-feature-branch\",\n \"name\": \"de\",\n \"briefing\": \"de-DE\",\n \"due_date\": \"2017-08-15\",\n \"ticket_url\": \"https://example.atlassian.net/browse/FOO\",\n \"target_locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\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/projects/{project_id}/jobs/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"my-feature-branch\",\n \"name\": \"de\",\n \"briefing\": \"de-DE\",\n \"due_date\": \"2017-08-15\",\n \"ticket_url\": \"https://example.atlassian.net/browse/FOO\",\n \"target_locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"autotranslate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/jobs/{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 \"name\": \"de\",\n \"briefing\": \"de-DE\",\n \"due_date\": \"2017-08-15\",\n \"ticket_url\": \"https://example.atlassian.net/browse/FOO\",\n \"target_locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\"\n ],\n \"autotranslate\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"name": "Translations for new Feature",
"briefing": "Some instructions for the translators",
"due_date": "2017-02-28T09:52:53Z",
"state": "completed",
"ticket_url": "https://example.atlassian.net/browse/FOO",
"created_at": "2017-01-28T09:52:53Z",
"updated_at": "2017-01-28T09:52:53Z",
"project": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
},
"owner": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"job_tag_name": "Job_123",
"source_translations_updated_at": "2020-01-01T00:00:00Z",
"source_locale": {
"id": "abcd1234cdef1234abcd1234cdef1235",
"name": "de-DE",
"code": "de-DE"
},
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
],
"keys": [
{
"id": "dbcd1234cdef1234abcd1234cdef1234",
"name": "greeting.hello"
}
]
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Authorizations
Enter your token in the format token TOKEN
Headers
Two-Factor-Authentication token (optional)
Body
specify the branch to use
"my-feature-branch"
Job name
"de"
Briefing for the translators
"de-DE"
Date the job should be finished
"2017-08-15"
URL to a ticket for this job (e.g. Jira, Trello)
"https://example.atlassian.net/browse/FOO"
List of target locales for the job.
["abcd1234cdef1234abcd1234cdef1234"]
Automatically translate the job using machine translation
true
Response
OK
Show child attributes
Show child attributes
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}
Show child attributes
Show child attributes
{ "name": "new-branch" }
The ID of the automation that created this job, or null if the job was created manually.
The ID of the job template this job was created from, or null if no template was used.
The review due date for this job. Returns null when the project does not have review workflow enabled.
"2015-03-25T11:43:52Z"
Show child attributes
Show child attributes
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "johndoe",
"name": "John Doe",
"gravatar_uid": "205e460b479e2e5b48aec07710c08d50"
}
Show child attributes
Show child attributes
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Returned only when include_annotations=true is supplied on the request.
Show child attributes
Show child attributes
true if the job has been locked by the project's job-locking workflow (translations attached to the job are read-only until the job advances).
Was this page helpful?