See api-docs Menu

v1-v3 APIs have been deprecated

Don't worry, these APIs are deprecated, but they aren't shut off yet.

All new development with APIs should use the newest version of our API: /1. API /1 is based on RESTful principles, is secured by OAuth 2.0, and provides JSON messages, search, pagination, sorting, and filtering.

Get Users

Returns up to 100 users. Use the page and from_id parameters to page through users.

For a description of each element in the User resource, see User Resource.

Resource URL

https://api.onelogin.com/api/v3/users.xml

Parameters

from_id

integer

Set this value to a user ID to return a sequence of users whose IDs start at the next sequential ID. For example, if you provide an ID value of 42, the call will return a list of up to 100 users whose IDs are greater than 42.

page

integer

Set to the page number of the page of results you want to return. A “page” refers to the list of users returned by a single request. For example, a request made without this parameter value will return the first page of events. To return subsequent pages of users, set this value to 2, 3, and so forth.

status

integer

Set to the status of the users you want to return. For a list of valid status values, see the status row on User Resource.

include_custom_attributes

boolean

Set to true if you want the response to include any custom attributes that have been defined for each user.

Sample Response

<users type="array">
  <user>
    <distinguished-name nil="true"></distinguished-name>
    <email>user@company.com</email>
    <external-id nil="true"></external-id>
    <firstname>Alejandro</firstname>
    <id>123456</id>
    <lastname>Whitman</lastname>
    <member-of nil="true"></member-of>
    <status>4</status>
    <username>alewhitman</username>
  </user>
  <!-- clip -->
  <user>
    <distinguished-name nil="true"></distinguished-name>
    <email>user@org.com</email> 
    <external-id nil="true"></external-id>
    <firstname>Aiko</firstname>
    <id>654321</id>
    <lastname>Chavez</lastname>
    <member-of nil="true"></member-of>
    <status>1</status>
    <username></username>
  </user>
</users>
<error>
  <title>Unauthorized Access</title>
  <message>Your IP is not allowed to use this API, please contact your Administrator
           for more information.</message>
</error>

Sample cURL Request

Be sure to replace placeholder values surrounded by { } with actual values.

curl -u {api_key}:x -X GET https://api.onelogin.com/api/v3/users.xml

Postman Collection

Be sure to set Postman-specific environment variables indicated by {{ }}.

Download for the Users API


Have a Question?

Found a problem or a bug? Submit a support ticket.

Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.

Have a product idea or request? Share it with us in our Ideas Portal.