/users
Parameter | Type | Description |
---|---|---|
account | Array | Integer | Retrieve users attached to an account. |
active | Boolean | Filter users by active flag. |
group | Array | Integer | Filter users by their group id |
search | String | Filter users by searching first , last and email fields. |
with | String | Values to join to account resource. |
Here is a list of available resources to join on users.
[ 'accounts', 'accounts.logo', 'avatar']
All active managers
https://example.trak.io/api/v1/users?active=true&group_id=3
User with ID 1
https://example.trak.io/api/v1/users/1
{
"success": true,
"message": null,
"data": {
"data": [
{
"user_id": 1,
"group_id": 1,
"group": {
"raw": "admin",
"formatted": "Trak Admin"
},
"first": "Trak",
"last": "Admin",
"fullname": "Trak Admin",
"email": "[email protected]",
"avatar": {
"file_id": 3,
"user_id": 1,
"name": "trak-cover.jpg",
"path": "users/1/aEF2C3LI3h1JjPrXjZractxfeEHDBsNjhjhmRIf0.jpeg",
"url": "<AWS_URL_GOES_HERE>/users/1/aEF2C3LI3h1JjPrXjZractxfeEHDBsNjhjhmRIf0.jpeg",
"created_at": "2018-12-03 20:33:01",
"updated_at": "2018-12-03 20:33:01"
},
"active": true,
"editor": true,
"created_at": "2018-12-03 20:33:01",
"updated_at": "2019-02-14 22:34:56",
"login_at": "2019-02-14 22:34:56"
}
],
...
}
}
/users
Parameter | Type | Required | Description |
---|---|---|---|
String | true | Email Address of the user. | |
first | String | true | First name of the user. |
group_id | Integer | true | The group the user is assigned. |
last | String | true | Last name of the user. |
{primary} You can only create users with a group_id greater than or equal to your group id.
{
'first': 'Trak',
'last': 'Collaborator',
'email': 'collaborator#company.com',
'group_id': 5
}
{
"success": true,
"message": "API_USER_CREATED",
"data": {
"active": false,
"first": "Trak",
"last": "Collaborator",
"email": "[email protected]",
"group_id": "5",
"updated_at": "2019-02-15 18:40:54",
"created_at": "2019-02-15 18:40:54",
"user_id": 1
}
}
/users/{user_id}
Parameter | Type | Required | Description |
---|---|---|---|
String | true | Email Address of the user. | |
first | String | true | First name of the user. |
group_id | Integer | true | The group the user is assigned. |
last | String | true | Last name of the user. |
{primary} You can only update your user account or users that have not been activated.
{
'first': 'Updated',
'last': 'Collaborator',
'email': 'collaborator#company.com',
'group_id': 5
}
{
"success": true,
"message": "API_USER_UPDATED",
"data": {
"active": false,
"first": "Updated",
"last": "Collaborator",
"email": "[email protected]",
"group_id": "5",
"updated_at": "2019-02-15 19:40:54",
"created_at": "2019-02-15 18:40:54",
"user_id": 1
}
}
/users/{user_id}
{
"success": true,
"message": "API_USER_DELETED",
"data": []
}