curl "https://api.phrase.com/v2/accounts/:account_id/members/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"role":"Developer","strategy":"set","project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","default_locale_codes":["de","en"],"space_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"],"permissions":{"create_upload":true,"review_translations":true}}' \
-H 'Content-Type: application/json'phrase members update \
--account_id <account_id> \
--id <id> \
--data '{"role":"Developer", "strategy":"set", "project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235", "locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235", "default_locale_codes":["de","en"], "space_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"], "permissions":"{"create_upload"=>true, "review_translations"=>true}"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/members/{id}"
payload = {
"strategy": "set",
"role": "Developer",
"project_ids": "abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235",
"locale_ids": "abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235",
"default_locale_codes": ["en", "fi"],
"space_ids": ["abcd1234abcd1234abcd1234", "abcd1234abcd1234abcd1235"],
"permissions": {
"create_upload": True,
"review_translations": 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({
strategy: 'set',
role: 'Developer',
project_ids: 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
locale_ids: 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
default_locale_codes: ['en', 'fi'],
space_ids: ['abcd1234abcd1234abcd1234', 'abcd1234abcd1234abcd1235'],
permissions: {create_upload: true, review_translations: true}
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/members/{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}/members/{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([
'strategy' => 'set',
'role' => 'Developer',
'project_ids' => 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
'locale_ids' => 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
'default_locale_codes' => [
'en',
'fi'
],
'space_ids' => [
'abcd1234abcd1234abcd1234',
'abcd1234abcd1234abcd1235'
],
'permissions' => [
'create_upload' => true,
'review_translations' => 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/accounts/{account_id}/members/{id}"
payload := strings.NewReader("{\n \"strategy\": \"set\",\n \"role\": \"Developer\",\n \"project_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"locale_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"default_locale_codes\": [\n \"en\",\n \"fi\"\n ],\n \"space_ids\": [\n \"abcd1234abcd1234abcd1234\",\n \"abcd1234abcd1234abcd1235\"\n ],\n \"permissions\": {\n \"create_upload\": true,\n \"review_translations\": true\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}/members/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"strategy\": \"set\",\n \"role\": \"Developer\",\n \"project_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"locale_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"default_locale_codes\": [\n \"en\",\n \"fi\"\n ],\n \"space_ids\": [\n \"abcd1234abcd1234abcd1234\",\n \"abcd1234abcd1234abcd1235\"\n ],\n \"permissions\": {\n \"create_upload\": true,\n \"review_translations\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/members/{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 \"strategy\": \"set\",\n \"role\": \"Developer\",\n \"project_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"locale_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"default_locale_codes\": [\n \"en\",\n \"fi\"\n ],\n \"space_ids\": [\n \"abcd1234abcd1234abcd1234\",\n \"abcd1234abcd1234abcd1235\"\n ],\n \"permissions\": {\n \"create_upload\": true,\n \"review_translations\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "acbdacbdacbdacbdacbdacbd",
"email": "foo@bar.com",
"username": "myname",
"created_at": "2020-12-07T12:56:21Z",
"last_activity_at": "2020-12-09T12:56:21Z",
"role": "Manager",
"projects": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z",
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-Gb"
}
]
}
],
"permissions": [
{
"create_upload": true,
"review_translations": true
}
],
"default_locale_codes": [
"en",
"fi"
],
"teams": [
{
"id": "04d36d845576b9d494d05e0b70fe813c",
"name": "Team 1",
"created_at": "2020-12-07T12:56:21Z",
"updated_at": "2020-12-07T12:56:21Z"
}
],
"spaces": [
{
"id": "04d36d845576b9d494d05e0b70fe813b",
"name": "Space2",
"created_at": "2020-12-07T12:56:21Z",
"updated_at": "2020-12-07T12:56:21Z",
"projects_count": 1
}
]
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Update a member
Update user permissions in the account. Developers and translators need project_ids and locale_ids assigned to access them. To grant account-wide language access instead of access scoped to specific projects, use default_locale_codes. Access token scope must include team.manage.
curl "https://api.phrase.com/v2/accounts/:account_id/members/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"role":"Developer","strategy":"set","project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","default_locale_codes":["de","en"],"space_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"],"permissions":{"create_upload":true,"review_translations":true}}' \
-H 'Content-Type: application/json'phrase members update \
--account_id <account_id> \
--id <id> \
--data '{"role":"Developer", "strategy":"set", "project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235", "locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235", "default_locale_codes":["de","en"], "space_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"], "permissions":"{"create_upload"=>true, "review_translations"=>true}"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/members/{id}"
payload = {
"strategy": "set",
"role": "Developer",
"project_ids": "abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235",
"locale_ids": "abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235",
"default_locale_codes": ["en", "fi"],
"space_ids": ["abcd1234abcd1234abcd1234", "abcd1234abcd1234abcd1235"],
"permissions": {
"create_upload": True,
"review_translations": 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({
strategy: 'set',
role: 'Developer',
project_ids: 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
locale_ids: 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
default_locale_codes: ['en', 'fi'],
space_ids: ['abcd1234abcd1234abcd1234', 'abcd1234abcd1234abcd1235'],
permissions: {create_upload: true, review_translations: true}
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/members/{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}/members/{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([
'strategy' => 'set',
'role' => 'Developer',
'project_ids' => 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
'locale_ids' => 'abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235',
'default_locale_codes' => [
'en',
'fi'
],
'space_ids' => [
'abcd1234abcd1234abcd1234',
'abcd1234abcd1234abcd1235'
],
'permissions' => [
'create_upload' => true,
'review_translations' => 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/accounts/{account_id}/members/{id}"
payload := strings.NewReader("{\n \"strategy\": \"set\",\n \"role\": \"Developer\",\n \"project_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"locale_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"default_locale_codes\": [\n \"en\",\n \"fi\"\n ],\n \"space_ids\": [\n \"abcd1234abcd1234abcd1234\",\n \"abcd1234abcd1234abcd1235\"\n ],\n \"permissions\": {\n \"create_upload\": true,\n \"review_translations\": true\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}/members/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"strategy\": \"set\",\n \"role\": \"Developer\",\n \"project_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"locale_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"default_locale_codes\": [\n \"en\",\n \"fi\"\n ],\n \"space_ids\": [\n \"abcd1234abcd1234abcd1234\",\n \"abcd1234abcd1234abcd1235\"\n ],\n \"permissions\": {\n \"create_upload\": true,\n \"review_translations\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/members/{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 \"strategy\": \"set\",\n \"role\": \"Developer\",\n \"project_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"locale_ids\": \"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235\",\n \"default_locale_codes\": [\n \"en\",\n \"fi\"\n ],\n \"space_ids\": [\n \"abcd1234abcd1234abcd1234\",\n \"abcd1234abcd1234abcd1235\"\n ],\n \"permissions\": {\n \"create_upload\": true,\n \"review_translations\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "acbdacbdacbdacbdacbdacbd",
"email": "foo@bar.com",
"username": "myname",
"created_at": "2020-12-07T12:56:21Z",
"last_activity_at": "2020-12-09T12:56:21Z",
"role": "Manager",
"projects": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "My Android Project",
"main_format": "xml",
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z",
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-Gb"
}
]
}
],
"permissions": [
{
"create_upload": true,
"review_translations": true
}
],
"default_locale_codes": [
"en",
"fi"
],
"teams": [
{
"id": "04d36d845576b9d494d05e0b70fe813c",
"name": "Team 1",
"created_at": "2020-12-07T12:56:21Z",
"updated_at": "2020-12-07T12:56:21Z"
}
],
"spaces": [
{
"id": "04d36d845576b9d494d05e0b70fe813b",
"name": "Space2",
"created_at": "2020-12-07T12:56:21Z",
"updated_at": "2020-12-07T12:56:21Z",
"projects_count": 1
}
]
}{
"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
Update strategy, can be any of set, add, remove. If provided, it will set, add or remove given spaces, projects and locale ids from users access list.
"set"
Member role, can be any of of Admin, ProjectManager, Developer, Designer, Translator
"Developer"
List of project ids the user has access to.
"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235"
List of locale ids the user has access to. This is project-scoped and must be paired with project_ids (and strategy) to take effect; it does not grant account-wide language access.
"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235"
List of default locales for the user, applied across all of the user's projects. This is the account-level field corresponding to "Language access" in the translator profile UI.
["en", "fi"]
List of spaces the user is assigned to.
[
"abcd1234abcd1234abcd1234",
"abcd1234abcd1234abcd1235"
]
Additional permissions depending on member role. Available permissions are create_upload and review_translations
Show child attributes
Show child attributes
{
"create_upload": true,
"review_translations": true
}
Response
OK
Was this page helpful?