curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/release_triggers" \
-u USERNAME_OR_ACCESS_TOKEN \
-X POST \
-d '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \
-H 'Content-Type: application/json'phrase release_triggers create \
--account_id <account_id> \
--distribution_id <distribution_id> \
--data '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers"
payload = {
"cron_schedule": "15 18 * * 1,3",
"time_zone": "Europe/Berlin",
"locale_ids": ["abcd1234cdef1234abcd1234cdef1234", "fff565db236400772368235db2c6117e"],
"tags": ["android", "feature1"],
"branch": "my-feature-branch",
"app_min_version": "1.0.0",
"app_max_version": "2.0.0"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cron_schedule: '15 18 * * 1,3',
time_zone: 'Europe/Berlin',
locale_ids: ['abcd1234cdef1234abcd1234cdef1234', 'fff565db236400772368235db2c6117e'],
tags: ['android', 'feature1'],
branch: 'my-feature-branch',
app_min_version: '1.0.0',
app_max_version: '2.0.0'
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers', 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}/release_triggers",
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([
'cron_schedule' => '15 18 * * 1,3',
'time_zone' => 'Europe/Berlin',
'locale_ids' => [
'abcd1234cdef1234abcd1234cdef1234',
'fff565db236400772368235db2c6117e'
],
'tags' => [
'android',
'feature1'
],
'branch' => 'my-feature-branch',
'app_min_version' => '1.0.0',
'app_max_version' => '2.0.0'
]),
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}/release_triggers"
payload := strings.NewReader("{\n \"cron_schedule\": \"15 18 * * 1,3\",\n \"time_zone\": \"Europe/Berlin\",\n \"locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"fff565db236400772368235db2c6117e\"\n ],\n \"tags\": [\n \"android\",\n \"feature1\"\n ],\n \"branch\": \"my-feature-branch\",\n \"app_min_version\": \"1.0.0\",\n \"app_max_version\": \"2.0.0\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cron_schedule\": \"15 18 * * 1,3\",\n \"time_zone\": \"Europe/Berlin\",\n \"locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"fff565db236400772368235db2c6117e\"\n ],\n \"tags\": [\n \"android\",\n \"feature1\"\n ],\n \"branch\": \"my-feature-branch\",\n \"app_min_version\": \"1.0.0\",\n \"app_max_version\": \"2.0.0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron_schedule\": \"15 18 * * 1,3\",\n \"time_zone\": \"Europe/Berlin\",\n \"locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"fff565db236400772368235db2c6117e\"\n ],\n \"tags\": [\n \"android\",\n \"feature1\"\n ],\n \"branch\": \"my-feature-branch\",\n \"app_min_version\": \"1.0.0\",\n \"app_max_version\": \"2.0.0\"\n}"
response = http.request(request)
puts response.read_body{
"id": "abcd1234cdef1234abcd1234cdef1234",
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
],
"branch": "my-feature-branch",
"tags": [
"android",
"feature1"
],
"cron_schedule": "15 18 * * 1,3",
"time_zone": "Europe/Berlin",
"next_run_at": "2015-01-28T09:52:53Z",
"app_min_version": "1.0.0",
"app_max_version": "2.0.0",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}Create a release trigger
Create a new recurring release. New releases will be published automatically, based on the cron schedule provided. Currently, only one release trigger can exist per distribution.
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/release_triggers" \
-u USERNAME_OR_ACCESS_TOKEN \
-X POST \
-d '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \
-H 'Content-Type: application/json'phrase release_triggers create \
--account_id <account_id> \
--distribution_id <distribution_id> \
--data '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers"
payload = {
"cron_schedule": "15 18 * * 1,3",
"time_zone": "Europe/Berlin",
"locale_ids": ["abcd1234cdef1234abcd1234cdef1234", "fff565db236400772368235db2c6117e"],
"tags": ["android", "feature1"],
"branch": "my-feature-branch",
"app_min_version": "1.0.0",
"app_max_version": "2.0.0"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cron_schedule: '15 18 * * 1,3',
time_zone: 'Europe/Berlin',
locale_ids: ['abcd1234cdef1234abcd1234cdef1234', 'fff565db236400772368235db2c6117e'],
tags: ['android', 'feature1'],
branch: 'my-feature-branch',
app_min_version: '1.0.0',
app_max_version: '2.0.0'
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers', 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}/release_triggers",
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([
'cron_schedule' => '15 18 * * 1,3',
'time_zone' => 'Europe/Berlin',
'locale_ids' => [
'abcd1234cdef1234abcd1234cdef1234',
'fff565db236400772368235db2c6117e'
],
'tags' => [
'android',
'feature1'
],
'branch' => 'my-feature-branch',
'app_min_version' => '1.0.0',
'app_max_version' => '2.0.0'
]),
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}/release_triggers"
payload := strings.NewReader("{\n \"cron_schedule\": \"15 18 * * 1,3\",\n \"time_zone\": \"Europe/Berlin\",\n \"locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"fff565db236400772368235db2c6117e\"\n ],\n \"tags\": [\n \"android\",\n \"feature1\"\n ],\n \"branch\": \"my-feature-branch\",\n \"app_min_version\": \"1.0.0\",\n \"app_max_version\": \"2.0.0\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cron_schedule\": \"15 18 * * 1,3\",\n \"time_zone\": \"Europe/Berlin\",\n \"locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"fff565db236400772368235db2c6117e\"\n ],\n \"tags\": [\n \"android\",\n \"feature1\"\n ],\n \"branch\": \"my-feature-branch\",\n \"app_min_version\": \"1.0.0\",\n \"app_max_version\": \"2.0.0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/distributions/{distribution_id}/release_triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron_schedule\": \"15 18 * * 1,3\",\n \"time_zone\": \"Europe/Berlin\",\n \"locale_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"fff565db236400772368235db2c6117e\"\n ],\n \"tags\": [\n \"android\",\n \"feature1\"\n ],\n \"branch\": \"my-feature-branch\",\n \"app_min_version\": \"1.0.0\",\n \"app_max_version\": \"2.0.0\"\n}"
response = http.request(request)
puts response.read_body{
"id": "abcd1234cdef1234abcd1234cdef1234",
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
],
"branch": "my-feature-branch",
"tags": [
"android",
"feature1"
],
"cron_schedule": "15 18 * * 1,3",
"time_zone": "Europe/Berlin",
"next_run_at": "2015-01-28T09:52:53Z",
"app_min_version": "1.0.0",
"app_max_version": "2.0.0",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}Authorizations
Enter your token in the format token TOKEN
Headers
Two-Factor-Authentication token (optional)
Body
Cron schedule for the scheduler. Read more about the format of this field at https://en.wikipedia.org/wiki/Cron
"15 18 * * 1,3"
Time zone for the scheduler
"Europe/Berlin"
List of locale ids that will be included in the release.
[ "abcd1234cdef1234abcd1234cdef1234", "fff565db236400772368235db2c6117e" ]
Only include tagged keys in the release. For a key to be included it must be tagged with all tags provided
["android", "feature1"]
Branch used for release
"my-feature-branch"
The created releases will be available only for apps with version greater or equal to this value
"1.0.0"
The created releases will be available only for apps with version less or equal to this value
"2.0.0"
Response
Created
Cron schedule for the scheduler. Read more about the format of this field at https://en.wikipedia.org/wiki/Cron
Time zone for the scheduler
The next time a release will be created for this trigger
Show child attributes
Show child attributes
Was this page helpful?