See api-docs Menu

List Accounts

This API returns a list of child accounts under the authenticated reseller’s account.

Required Feature

Reseller privileges are required to use this API.

Resource URL

GET https://<subdomain>/api/v1/accounts

Header Parameters

Authorization

required

string

Set to Bearer <access_token>.

Set <access_token> to the access token generated using the Generate Token API.

Generate the access token with the API credential pair created using the scope required to call this API. Call this API using the Manage All scope.

Request Parameters

include_keys

boolean

If set, includes account keys in the response.

Sample Response

If successful, an XML list of accounts is returned.

This error indicates a lack of sufficient privileges. Ensure the user is a reseller or OneLogin account.

{
    "statusCode": 404,
    "name": "InsufficientPrivileges",
    "message": "Only resellers may use this API."
}

Sample Code

By default, all API responses are returned in XML format. To receive JSON responses, set the HTTP header:

Accept: application/json

Most modern HTTP clients (curl, httpie, Postman, etc.) support this via the -H or --header flag.

cURL

curl 'https://<subdomain>/api/v1/accounts' \
-X GET \
-H "Authorization: Bearer <access_token>"

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.