Invitations

With the invitation endpoint you can manage and invite users to PhraseApp 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/invitations

List invitations for an account. It will also list the accessible resources like projects and locales the invited user 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/invitations" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp invitations list <account_id>

Response

Status: 200
[ { "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "role": "Manager", "state": "accepted", "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" } ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "accepted_at": "2015-02-28T09:52:53Z" }, { "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "role": "Manager", "state": "accepted", "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" } ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "accepted_at": "2015-02-28T09:52:53Z" } ]

GET /v2/accounts/:account_id/invitations/:id

Get details on a single invitation. Access token scope must include team.manage.

Example Request

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

Response

Status: 200
{ "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "role": "Manager", "state": "accepted", "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" } ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "accepted_at": "2015-02-28T09:52:53Z" }

POST /v2/accounts/:account_id/invitations

Invite a person to an 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
email string The email of the invited user. The email can not be updated once created. Create a new invitation for each unique email.
role string Invitiation role, can be any of Manager, Developer, Translator.
project_ids
optional
string List of project ids the invited user has access to.
locale_ids
optional
string List of locale ids the invited user has access to.

Example Request

curl "https://api.phraseapp.com/api/v2/accounts/:account_id/invitations" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST \
  -d '{"email":"example@mail.com","role":"Developer","project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235"}' \
  -H 'Content-Type: application/json'
phraseapp invitation create <account_id> \
--email example@mail.com \
--role Developer \
--project-ids abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235 \
--locale-ids abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235

Response

Status: 201
{ "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "role": "Manager", "state": "accepted", "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" } ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "accepted_at": "2015-02-28T09:52:53Z" }

PATCH /v2/accounts/:account_id/invitations/:id

Update an existing invitation (must not be accepted yet). The email cannot be updated. 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 Invitiation role, can be any of Manager, Developer, Translator
project_ids
optional
string List of project ids the invited user has access to
locale_ids
optional
string List of locale ids the invited user has access to

Example Request

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

Response

Status: 200
{ "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "role": "Manager", "state": "accepted", "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" } ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "accepted_at": "2015-02-28T09:52:53Z" }

DELETE /v2/accounts/:account_id/invitations/:id

Delete an existing invitation (must not be accepted yet). Access token scope must include team.manage.

Example Request

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

Response

Status: 204

POST /v2/accounts/:account_id/invitations/:id/resend

Resend the invitation email (must not be accepted yet). Access token scope must include team.manage.

Example Request

curl "https://api.phraseapp.com/api/v2/accounts/:account_id/invitations/:id/resend" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST
phraseapp invitation resend <account_id> <id>

Response

Status: 200
{ "id": "acbdacbdacbdacbdacbdacbd", "email": "foo@bar.com", "role": "Manager", "state": "accepted", "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" } ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "accepted_at": "2015-02-28T09:52:53Z" }