Users
Each user has a type, which determines their administrative privileges.
User type
User | 0 | No admin privileges |
Group admin | 1 | Can manage users with their group |
Admin | 2 | Can manage all users |
Status
A user's status determine their ability to log in. Only active users can access OneLogin.
Unactivated | 0 |
Active | 1 |
Suspended | 2 |
Locked | 3 |
Password expired | 4 |
Awaiting password reset | 5 |
Show user
Returns a single user.
GET /users/{id}.xml
Status: 200 <user> <activated-at>2010-02-13T23:17:52-08:00</activated-at> <created-at>2010-02-13T23:17:52-08:00</created-at> <email>hanna@onelogin.com</email> <firstname>Hanna</firstname> <group-id nil="true"></group-id> <id>15568</id> <invalid-login-attempts>0</invalid-login-attempts> <invitation-sent-at>2010-02-13T23:17:52-08:00</invitation-sent-at> <last-login>2010-02-13T23:34:20-08:00</last-login> <lastname>Banana</lastname> <locked-until nil="true"></locked-until> <notes nil="true"></notes> <openid-name>hanna</openid-name> <password-changed-at>2010-02-13T23:17:52-08:00</password-changed-at> <pending-apps nil="true"></pending-apps> <phone nil="true">310-555-2221</phone> <role-id>824</role-id> <status>1</status> <updated-at>2010-02-13T23:34:56-08:00</updated-at> <user-type>0</user-type> </user>
List all
Returns all users in one list. The body of each user is the same as for show user.
GET /users.xml
Status: 200 <users type="array"> <user> ... </user> <user> ... </user> </users>
Create user
Creates a new user. The status of the new user depends on whether a password is provided. If the request contains a password, the status will be Active (1), otherwise it will be Unactivated (0).
POST /users.xml
Status: 200 <user> <email>hanna@onelogin.com</email> <firstname>Hanna</firstname> <group-id nil="true"></group-id> <id>15568</id> <lastname>Banana</lastname> <notes nil="true"></notes> <openid-name>hanna</openid-name> <pending-apps nil="true"></pending-apps> <phone>310-555-2221</phone> <role-id>824</role-id> <updated-at>2010-02-13T23:34:56-08:00</updated-at> <user-type>0</user-type> </user>
Update
Updates a user. Note that it is not possible to update a user's password via the API.
PUT /users/{id}.xml
Status: 200
<user>
<firstname>Hannah</firstname>
</user>
This example sets the user's first name to Hannah.
Delete
Deletes a user.
DELETE /users/{id}.xml
Status: 200