GET

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>.onelogin.com/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

p>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: ```http Accept: application/json ``` Most modern HTTP clients (curl, httpie, Postman, etc.) support this via the `-H` or `--header` flag.

cURL

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

Postman Collection

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

Run In Postman