See api-docs Menu

v1-v3 APIs have been deprecated.

Although these APIs are not shut off yet, all new development with APIs should use the newest version of our API if available, and the version /1 in all other cases. These later versions are based on RESTful principles, secured by OAuth 2.0, and provide 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

Before calling this API, consider using its version /1 or version /2 equivalent.

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

Run In Postman

    Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

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.