cURL
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/releases/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"description":"My first Release","platforms":["android","ios"],"branch":"my-feature-branch"}' \
-H 'Content-Type: application/json'phrase releases update \
--account_id <account_id> \
--distribution_id <distribution_id> \
--id <id> \
--data '{"description": "My first Release", "platforms": "android,ios", "branch":"my-feature-branch"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/releases/{id}"
payload = {
"description": "My first Release",
"platforms": ["android", "ios"],
"app_min_version": "2.5.0",
"app_max_version": "3.0.0",
"branch": "my-feature-branch"
}
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({
description: 'My first Release',
platforms: ['android', 'ios'],
app_min_version: '2.5.0',
app_max_version: '3.0.0',
branch: 'my-feature-branch'
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/releases/{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}/distributions/{distribution_id}/releases/{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([
'description' => 'My first Release',
'platforms' => [
'android',
'ios'
],
'app_min_version' => '2.5.0',
'app_max_version' => '3.0.0',
'branch' => 'my-feature-branch'
]),
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}/distributions/{distribution_id}/releases/{id}"
payload := strings.NewReader("{\n \"description\": \"My first Release\",\n \"platforms\": [\n \"android\",\n \"ios\"\n ],\n \"app_min_version\": \"2.5.0\",\n \"app_max_version\": \"3.0.0\",\n \"branch\": \"my-feature-branch\"\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}/distributions/{distribution_id}/releases/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"My first Release\",\n \"platforms\": [\n \"android\",\n \"ios\"\n ],\n \"app_min_version\": \"2.5.0\",\n \"app_max_version\": \"3.0.0\",\n \"branch\": \"my-feature-branch\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/releases/{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 \"description\": \"My first Release\",\n \"platforms\": [\n \"android\",\n \"ios\"\n ],\n \"app_min_version\": \"2.5.0\",\n \"app_max_version\": \"3.0.0\",\n \"branch\": \"my-feature-branch\"\n}"
response = http.request(request)
puts response.read_body{
"id": "abcd1234cdef1234abcd1234cdef1234",
"version": 1,
"project": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
},
"platforms": [
"android"
],
"environments": [
"development",
"production"
],
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
],
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Releases
Update a release
Update an existing release.
PATCH
/
accounts
/
{account_id}
/
distributions
/
{distribution_id}
/
releases
/
{id}
cURL
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/releases/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"description":"My first Release","platforms":["android","ios"],"branch":"my-feature-branch"}' \
-H 'Content-Type: application/json'phrase releases update \
--account_id <account_id> \
--distribution_id <distribution_id> \
--id <id> \
--data '{"description": "My first Release", "platforms": "android,ios", "branch":"my-feature-branch"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/releases/{id}"
payload = {
"description": "My first Release",
"platforms": ["android", "ios"],
"app_min_version": "2.5.0",
"app_max_version": "3.0.0",
"branch": "my-feature-branch"
}
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({
description: 'My first Release',
platforms: ['android', 'ios'],
app_min_version: '2.5.0',
app_max_version: '3.0.0',
branch: 'my-feature-branch'
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/releases/{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}/distributions/{distribution_id}/releases/{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([
'description' => 'My first Release',
'platforms' => [
'android',
'ios'
],
'app_min_version' => '2.5.0',
'app_max_version' => '3.0.0',
'branch' => 'my-feature-branch'
]),
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}/distributions/{distribution_id}/releases/{id}"
payload := strings.NewReader("{\n \"description\": \"My first Release\",\n \"platforms\": [\n \"android\",\n \"ios\"\n ],\n \"app_min_version\": \"2.5.0\",\n \"app_max_version\": \"3.0.0\",\n \"branch\": \"my-feature-branch\"\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}/distributions/{distribution_id}/releases/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"My first Release\",\n \"platforms\": [\n \"android\",\n \"ios\"\n ],\n \"app_min_version\": \"2.5.0\",\n \"app_max_version\": \"3.0.0\",\n \"branch\": \"my-feature-branch\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/releases/{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 \"description\": \"My first Release\",\n \"platforms\": [\n \"android\",\n \"ios\"\n ],\n \"app_min_version\": \"2.5.0\",\n \"app_max_version\": \"3.0.0\",\n \"branch\": \"my-feature-branch\"\n}"
response = http.request(request)
puts response.read_body{
"id": "abcd1234cdef1234abcd1234cdef1234",
"version": 1,
"project": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
},
"platforms": [
"android"
],
"environments": [
"development",
"production"
],
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
],
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}{
"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)
Path Parameters
Account ID
Distribution ID
ID
Body
application/json
Description of the release
Example:
"My first Release"
List of platforms the release should support.
Example:
["android", "ios"]
Minimum version of the app that the release supports in semver format
Example:
"2.5.0"
Maximum version of the app that the release supports in semver format
Example:
"3.0.0"
Branch used for release
Example:
"my-feature-branch"
Response
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}
Was this page helpful?
⌘I