curl --request POST \
--url https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_task_id": "11111111-2222-4333-8444-555555555555",
"target_task_id": "66666666-7777-4888-8999-aaaaaaaaaaaa"
}
'import requests
url = "https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies"
payload = {
"source_task_id": "11111111-2222-4333-8444-555555555555",
"target_task_id": "66666666-7777-4888-8999-aaaaaaaaaaaa"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_task_id: '11111111-2222-4333-8444-555555555555',
target_task_id: '66666666-7777-4888-8999-aaaaaaaaaaaa'
})
};
fetch('https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies', 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/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies",
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([
'source_task_id' => '11111111-2222-4333-8444-555555555555',
'target_task_id' => '66666666-7777-4888-8999-aaaaaaaaaaaa'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies"
payload := strings.NewReader("{\n \"source_task_id\": \"11111111-2222-4333-8444-555555555555\",\n \"target_task_id\": \"66666666-7777-4888-8999-aaaaaaaaaaaa\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_task_id\": \"11111111-2222-4333-8444-555555555555\",\n \"target_task_id\": \"66666666-7777-4888-8999-aaaaaaaaaaaa\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_task_id\": \"11111111-2222-4333-8444-555555555555\",\n \"target_task_id\": \"66666666-7777-4888-8999-aaaaaaaaaaaa\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7",
"source_task_id": "11111111-2222-4333-8444-555555555555",
"target_task_id": "66666666-7777-4888-8999-aaaaaaaaaaaa"
}{
"code": "bad_request",
"detail": "The request is malformed, for example its body isn't valid JSON.",
"status": 400,
"title": "Bad Request",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#bad_request"
}{
"code": "unauthorized",
"detail": "The request has no valid Phrase Platform JWT issued for Orchestrator. Send one as `Authorization: Bearer <JWT>`.",
"status": 401,
"title": "Unauthorized",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#unauthorized"
}{
"code": "forbidden",
"detail": "The authenticated user isn't allowed to perform this action on the resource.",
"status": 403,
"title": "Forbidden",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#forbidden"
}{
"code": "not_found",
"detail": "The resource doesn't exist, or the authenticated user can't access it.",
"status": 404,
"title": "Not Found",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#not_found"
}{
"code": "request_timeout",
"detail": "The request body arrived too slowly. Retry the request.",
"status": 408,
"title": "Request Timeout",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#request_timeout"
}{
"code": "content_too_large",
"detail": "The request body is larger than 8 MB.",
"status": 413,
"title": "Request Entity Too Large",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#content_too_large"
}{
"code": "unprocessable_content",
"detail": "A parameter doesn't match its schema, or the change isn't allowed in the resource's current state. Each entry in `errors` describes one cause.",
"errors": [
{
"detail": "cyclic graphs are not allowed",
"pointer": "/target_id"
}
],
"status": 422,
"title": "Unprocessable Content",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#unprocessable_content"
}{
"code": "rate_limited",
"detail": "This user's limit of 1000 requests per 300 seconds is used up. Retry in 42 seconds.",
"status": 429,
"title": "Too Many Requests",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#rate_limited"
}{
"code": "internal_server_error",
"detail": "Orchestrator failed unexpectedly. A write may or may not have been applied, so check the resource before retrying it.",
"status": 500,
"title": "Internal Server Error",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#internal_server_error"
}Create a dependency
Adds a dependency to the revision’s execution graph: source_task_id runs before target_task_id. A task may bind to any task upstream of it, directly or through others, so don’t add a direct dependency for that. Rejected with 422 when the revision is locked or the dependency would create a cycle. Idempotency keys are not supported, but a retry can’t create a duplicate: a second dependency between the same two tasks is rejected with 422.
curl --request POST \
--url https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_task_id": "11111111-2222-4333-8444-555555555555",
"target_task_id": "66666666-7777-4888-8999-aaaaaaaaaaaa"
}
'import requests
url = "https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies"
payload = {
"source_task_id": "11111111-2222-4333-8444-555555555555",
"target_task_id": "66666666-7777-4888-8999-aaaaaaaaaaaa"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_task_id: '11111111-2222-4333-8444-555555555555',
target_task_id: '66666666-7777-4888-8999-aaaaaaaaaaaa'
})
};
fetch('https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies', 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/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies",
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([
'source_task_id' => '11111111-2222-4333-8444-555555555555',
'target_task_id' => '66666666-7777-4888-8999-aaaaaaaaaaaa'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies"
payload := strings.NewReader("{\n \"source_task_id\": \"11111111-2222-4333-8444-555555555555\",\n \"target_task_id\": \"66666666-7777-4888-8999-aaaaaaaaaaaa\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_task_id\": \"11111111-2222-4333-8444-555555555555\",\n \"target_task_id\": \"66666666-7777-4888-8999-aaaaaaaaaaaa\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/orchestrator/api/v1/workflows/{workflow_id}/revisions/{revision_id}/dependencies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_task_id\": \"11111111-2222-4333-8444-555555555555\",\n \"target_task_id\": \"66666666-7777-4888-8999-aaaaaaaaaaaa\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7",
"source_task_id": "11111111-2222-4333-8444-555555555555",
"target_task_id": "66666666-7777-4888-8999-aaaaaaaaaaaa"
}{
"code": "bad_request",
"detail": "The request is malformed, for example its body isn't valid JSON.",
"status": 400,
"title": "Bad Request",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#bad_request"
}{
"code": "unauthorized",
"detail": "The request has no valid Phrase Platform JWT issued for Orchestrator. Send one as `Authorization: Bearer <JWT>`.",
"status": 401,
"title": "Unauthorized",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#unauthorized"
}{
"code": "forbidden",
"detail": "The authenticated user isn't allowed to perform this action on the resource.",
"status": 403,
"title": "Forbidden",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#forbidden"
}{
"code": "not_found",
"detail": "The resource doesn't exist, or the authenticated user can't access it.",
"status": 404,
"title": "Not Found",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#not_found"
}{
"code": "request_timeout",
"detail": "The request body arrived too slowly. Retry the request.",
"status": 408,
"title": "Request Timeout",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#request_timeout"
}{
"code": "content_too_large",
"detail": "The request body is larger than 8 MB.",
"status": 413,
"title": "Request Entity Too Large",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#content_too_large"
}{
"code": "unprocessable_content",
"detail": "A parameter doesn't match its schema, or the change isn't allowed in the resource's current state. Each entry in `errors` describes one cause.",
"errors": [
{
"detail": "cyclic graphs are not allowed",
"pointer": "/target_id"
}
],
"status": 422,
"title": "Unprocessable Content",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#unprocessable_content"
}{
"code": "rate_limited",
"detail": "This user's limit of 1000 requests per 300 seconds is used up. Retry in 42 seconds.",
"status": 429,
"title": "Too Many Requests",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#rate_limited"
}{
"code": "internal_server_error",
"detail": "Orchestrator failed unexpectedly. A write may or may not have been applied, so check the resource before retrying it.",
"status": 500,
"title": "Internal Server Error",
"type": "https://developers.phrase.com/en/api/orchestrator/errors#internal_server_error"
}Authorizations
A Phrase Platform JWT issued for Orchestrator, sent as Authorization: Bearer <JWT>. See Authentication and access for how to obtain one.
Path Parameters
Body
The dependency to create
The dependency to create between two tasks of the revision.
Response
Created
A directed dependency in a revision's execution graph: source_task_id runs before target_task_id.
Was this page helpful?