cURL
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/properties/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"name":"Fruit","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \
-H 'Content-Type: application/json'phrase custom_metadata_properties update \
--account_id <account_id> \
--id <id> \
--data '{"name":"Fruit","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/custom_metadata/properties/{id}"
payload = {
"name": "Fruit",
"project_ids": ["abcd1234cdef1234abcd1234cdef1234", "abcd1234cdef1234abcd1234cdef4321"],
"description": "A healthy snack for all ages",
"value_options": ["Apple", "Banana", "Coconut"]
}
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: 'Fruit',
project_ids: ['abcd1234cdef1234abcd1234cdef1234', 'abcd1234cdef1234abcd1234cdef4321'],
description: 'A healthy snack for all ages',
value_options: ['Apple', 'Banana', 'Coconut']
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/custom_metadata/properties/{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}/custom_metadata/properties/{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' => 'Fruit',
'project_ids' => [
'abcd1234cdef1234abcd1234cdef1234',
'abcd1234cdef1234abcd1234cdef4321'
],
'description' => 'A healthy snack for all ages',
'value_options' => [
'Apple',
'Banana',
'Coconut'
]
]),
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}/custom_metadata/properties/{id}"
payload := strings.NewReader("{\n \"name\": \"Fruit\",\n \"project_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"abcd1234cdef1234abcd1234cdef4321\"\n ],\n \"description\": \"A healthy snack for all ages\",\n \"value_options\": [\n \"Apple\",\n \"Banana\",\n \"Coconut\"\n ]\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}/custom_metadata/properties/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Fruit\",\n \"project_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"abcd1234cdef1234abcd1234cdef4321\"\n ],\n \"description\": \"A healthy snack for all ages\",\n \"value_options\": [\n \"Apple\",\n \"Banana\",\n \"Coconut\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/custom_metadata/properties/{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\": \"Fruit\",\n \"project_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"abcd1234cdef1234abcd1234cdef4321\"\n ],\n \"description\": \"A healthy snack for all ages\",\n \"value_options\": [\n \"Apple\",\n \"Banana\",\n \"Coconut\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "Nuts",
"description": "A healthy snack for all ages",
"data_type": "multi_select",
"user": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z",
"projects": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}
],
"value_options": [
"apple",
"banana",
"coconut"
]
}Custom Metadata
Update a property
Update an existing custom metadata property.
PATCH
/
accounts
/
{account_id}
/
custom_metadata
/
properties
/
{id}
cURL
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/properties/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"name":"Fruit","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \
-H 'Content-Type: application/json'phrase custom_metadata_properties update \
--account_id <account_id> \
--id <id> \
--data '{"name":"Fruit","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/custom_metadata/properties/{id}"
payload = {
"name": "Fruit",
"project_ids": ["abcd1234cdef1234abcd1234cdef1234", "abcd1234cdef1234abcd1234cdef4321"],
"description": "A healthy snack for all ages",
"value_options": ["Apple", "Banana", "Coconut"]
}
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: 'Fruit',
project_ids: ['abcd1234cdef1234abcd1234cdef1234', 'abcd1234cdef1234abcd1234cdef4321'],
description: 'A healthy snack for all ages',
value_options: ['Apple', 'Banana', 'Coconut']
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/custom_metadata/properties/{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}/custom_metadata/properties/{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' => 'Fruit',
'project_ids' => [
'abcd1234cdef1234abcd1234cdef1234',
'abcd1234cdef1234abcd1234cdef4321'
],
'description' => 'A healthy snack for all ages',
'value_options' => [
'Apple',
'Banana',
'Coconut'
]
]),
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}/custom_metadata/properties/{id}"
payload := strings.NewReader("{\n \"name\": \"Fruit\",\n \"project_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"abcd1234cdef1234abcd1234cdef4321\"\n ],\n \"description\": \"A healthy snack for all ages\",\n \"value_options\": [\n \"Apple\",\n \"Banana\",\n \"Coconut\"\n ]\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}/custom_metadata/properties/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Fruit\",\n \"project_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"abcd1234cdef1234abcd1234cdef4321\"\n ],\n \"description\": \"A healthy snack for all ages\",\n \"value_options\": [\n \"Apple\",\n \"Banana\",\n \"Coconut\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/custom_metadata/properties/{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\": \"Fruit\",\n \"project_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"abcd1234cdef1234abcd1234cdef4321\"\n ],\n \"description\": \"A healthy snack for all ages\",\n \"value_options\": [\n \"Apple\",\n \"Banana\",\n \"Coconut\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "Nuts",
"description": "A healthy snack for all ages",
"data_type": "multi_select",
"user": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z",
"projects": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}
],
"value_options": [
"apple",
"banana",
"coconut"
]
}Authorizations
TokenBasic
Enter your token in the format token TOKEN
Headers
Two-Factor-Authentication token (optional)
Body
application/json
name of the property
Example:
"Fruit"
ids of projects that the property belongs to
Example:
[
"abcd1234cdef1234abcd1234cdef1234",
"abcd1234cdef1234abcd1234cdef4321"
]
description of property
Example:
"A healthy snack for all ages"
value options of property (only applies to single or multi select properties)
Example:
["Apple", "Banana", "Coconut"]
Response
OK
data type of the property
Available options:
boolean, date, link, multi_select, number, single_select, string, text Example:
"string"
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