Users
Roles
There are 4 roles for any given project:owner
, editor
, viewer
, developer
and client
. The following table describes the actions that can be performed by each role for a particular project:
owner | editor | viewer | developer | client | |
---|---|---|---|---|---|
Assign Project Roles | X | ||||
Revoke Project Roles | X | ||||
Update Project Roles | X | ||||
View Project Roles | X | X | X | X | |
Update Project | X | X | |||
Delete Project | X | ||||
View Project | X | X | X | X | |
Create Locales | X | X | |||
Update Locales | X | X | |||
Delete Locales | X | X | |||
View Locales | X | X | X | X | |
Manage API Clients | X | X | |||
Export Locales | X | X | X | X | X |
Registration
Don't forget that all endpoints on this document do not include the API prefix for simplicity. In other words, if your endpoint is
/users
then the full URL should be:https://host:port/api/v1/users
POST /users/register
Parameters (JSON)
Name | Type | Description |
---|---|---|
name | string | The user's name. |
string | The user's email. | |
password | string | The user's password, must be at least 8 characters long. |
Example
{
"name": "Mr. Example",
"email": "[email protected]",
"password": "myterriblepassword"
}
Response
{
"meta": {
"status": 201
},
"payload": {
"id": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"name": "Mr. Example",
"email": "[email protected]"
}
}
Get details
Get the details for the user enclosed in the current token:
GET /users/self
Parameters (query string)
Name | Type | Description |
---|---|---|
include | string | Include more user related information. Available values are projectRoles and projectGrants . |
Example
GET /users/self?include=projectGrants
Response
{
"meta": {
"status": 200
},
"payload": {
"id": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"name": "Mr. Example",
"email": "[email protected]",
"projectGrants": {
"100c03f8-d4ef-4a82-86a0-2543edf0fd64": [
"CanAssignProjectRoles",
"CanRevokeProjectRoles",
"CanUpdateProjectRoles",
"CanViewProjectRoles",
"CanUpdateProject",
"CanDeleteProject",
"CanViewProject",
"CanCreateLocales",
"CanUpdateLocales",
"CanDeleteLocales",
"CanViewLocales",
"CanManageAPIClients",
"CanExportLocales"
]
}
}
}
Update a user's name
PATCH /users/self/name
Parameters (JSON)
Name | Type | Description |
---|---|---|
userId | string | The user's UUID. |
name | string | The new name. |
Example
{
"userId": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"name": "Max"
}
Response
{
"meta": {
"status": 200
},
"payload": {
"id": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"name": "Max",
"email": "[email protected]"
}
}
Update a user's email
PATCH /users/self/email
Parameters (JSON)
Name | Type | Description |
---|---|---|
userId | string | The user's UUID. |
string | The new email. |
Example
{
"userId": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"email": "[email protected]"
}
Response
{
"meta": {
"status": 200
},
"payload": {
"id": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"name": "Max",
"email": "[email protected]"
}
}
Update a user's password
PATCH /users/self/password
Parameters (JSON)
Name | Type | Description |
---|---|---|
userId | string | The user's UUID. |
oldPassword | string | The old password. |
newPassword | string | The new password. |
Example
{
"userId": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"oldPassword": "myterriblepassword",
"newPassword": "mystillterriblepassword"
}
Response
{
"meta": {
"status": 200
},
"payload": {
"id": "c77853d5-88c9-4bbd-96cc-42b7f6cad6ab",
"name": "Max",
"email": "[email protected]"
}
}