api:members

Members

Methods let you add employees to your organization, change their profile info and block their access to the system.

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
Show response

{
"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 ' \
-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

{
	"first_name": "John",
	"last_name": "Johnson",
	"email": "john.johnson@company.com",
	"position": "developer",
	"department_id": 123,
	"skype": "john.johnson",
	"phone": "+71234567890"
   }

Show response

"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 ' \
 -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}

{
	"first_name": "John",
	"last_name": "Johnson",
	"email": "john.johnson@company.com",
	"position": "developer",
	"department_id": 123,
	"skype": "john.johnson",
	"phone": "+71234567890",
	"banned": false
   }
Show response

{
   "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/' \
 -H 'Authorization: Bearer ' \
 -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}
Show response

{
	"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/' \
 -H 'Authorization: Bearer ' \
 -H 'Content-Type: application/json'
    

Was this article helpful?

Yes, thanks! No, I have a question