Members
Methods let you add employees to your organization, change their profile info and block their access to the system.
- GET/membersGiving a list of all participants of the organization
- POST/membersAdding users to the organization
- PUT/members/{id}Changing user info
- DELETE/members/{id}Blocking a user
GET /members
Gives you a list of all participants of the organization to which the user whose name is on the request belongs. This method returns a list of all organization participants. .
GET https://api.pyrus.com/v4/members
Response body
{ "members": [ { "id": 123456, "first_name": "John", "last_name": "Johnson", "email": "john.johnson@company.com", "type": "user", "banned": false, "position": "developer", "skype": "john.johnson", "phone": "+71234567890" }, /*...*/ ] }
curl
curl -X GET \ 'https://api.pyrus.com/v4/members/' \ -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \ -H 'Content-Type: application/json'
POST /members
lets you add a user. This method returns the organization participant as a user.
POST https://api.pyrus.com/v4/members
Request body
{ "first_name": "John", "last_name": "Johnson", "email": "john.johnson@company.com", "position": "developer", "department_id": 123, "skype": "john.johnson", "phone": "+71234567890" }
Response body
"id": 123456, "first_name": "John", "last_name": "Johnson", "email": "john.johnson@company.com", "type": "user", "banned": false, "position": "developer", "skype": "john.johnson", "phone": "+71234567890" }
curl
curl -X POST \ 'https://api.pyrus.com/v4/members/' \ -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \ -H 'Content-Type: application/json' \ -d '{ "first_name": "John", "last_name": "Johnson", "email": "john.johnson@company.com", "position": "developer", "department_id": 123, "skype": "john.johnson", "phone_number": "+71234567890" } '
Important: to avoid misuse, to the general limits, the number of API calls by this method is additionally limited.
PUT /members/{id}
Lets you change user ID info. This method returns the user whose profile info has been changed.
PUT: https://api.pyrus.com/v4/members/{id}
Request body
{ "first_name": "John", "last_name": "Johnson", "email": "john.johnson@company.com", "position": "developer", "department_id": 123, "skype": "john.johnson", "phone": "+71234567890", "banned": false }
Response body
{ "id": 123456, "first_name": "John", "last_name": "Johnson", "email": "john.johnson@company.com", "type": "user", "banned": false, "position": "developer", "skype": "john.johnson", "phone": "+71234567890" }
curl
curl -X PUT \ 'https://api.pyrus.com/v4/members/<MEMBER_ID>' \ -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \ -H 'Content-Type: application/json' \ -d '{ "first_name": "John", "last_name": "Johnson", "email": "ivan.ivanov@company.com", "position": "developer", "department_id": 123, "skype": "john.johnson", "phone": +71234567890", "banned": false }'
Pyrus Tip: Don’t mention parameters you don’t want to change in the request, and they will stay the same.
DELETE /members/{id}
Block user ID. This method returns the user who has been blocked from Pyrus.
DELETE: https://api.pyrus.com/v4/members/{id}
Response body
{ "id": 123456, "first_name": "John", "last_name": "Johnson", "email": "john.johnson@company.com", "type": "user", "banned": true, "position": "developer", "skype": "john.johnson", "phone": "+71234567890" }
curl
curl -X DELETE \ 'https://api.pyrus.com/v4/members/<MEMBER_ID>' \ -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \ -H 'Content-Type: application/json'