Members

With the members endpoints you can do basic team and user management via API. A user can have the role Manager, Developer or Translator each with its own access rights. Developers and translators need resources like projects and locales assigned in order to access them.

GET /v2/accounts/:account_id/members

Get all users active in the account. It also lists resources like projects and locales the member has access to. In case nothing is shown the default access from the role is used. Access token scope must include team.manage.

This endpoint is paginated.

Example Request

curl "https://api.phraseapp.com/api/v2/accounts/:account_id/members" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp members list <account_id>

Response

Status: 200
[ { "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "username": "myname", "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" } ] } ] }, { "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "username": "myname", "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" } ] } ] } ]

GET /v2/accounts/:account_id/members/:id

Get details on a single user in the account. Access token scope must include team.manage.

Example Request

curl "https://api.phraseapp.com/api/v2/accounts/:account_id/members/:id" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp member show <account_id> <id>

Response

Status: 200
{ "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "username": "myname", "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" } ] } ] }

PATCH /v2/accounts/:account_id/members/:id

Update user permissions in the account. Developers and translators need project_ids and locale_ids assigned to access them. Access token scope must include team.manage.

Parameters

Name Type Description
role string Member role, can be any of of Manager, Developer, Translator
project_ids
optional
string List of project ids the user has access to.
locale_ids
optional
string List of locale ids the user has access to.

Example Request

curl "https://api.phraseapp.com/api/v2/accounts/:account_id/members/:id" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"role":"Developer","project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235"}' \
  -H 'Content-Type: application/json'
phraseapp member update <account_id> <id> \
--role Developer \
--project-ids abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235 \
--locale-ids abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235

Response

Status: 200
{ "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "username": "myname", "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" } ] } ] }

DELETE /v2/accounts/:account_id/members/:id

Remove a user from the account. The user will be removed from the account but not deleted from PhraseApp. Access token scope must include team.manage.

Example Request

curl "https://api.phraseapp.com/api/v2/accounts/:account_id/members/:id" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X DELETE
phraseapp member delete <account_id> <id>

Response

Status: 204