GET

List Accounts

Use this API to return every direct child account of your reseller account.

The response is a single JSON array. It isn’t paginated and doesn’t take query parameters. Deleted accounts aren’t included, and neither are the child accounts of your child accounts.

Resource URL

https://<subdomain>.onelogin.com/api/2/accounts

Header Parameters

Authorization

required

string

Set to bearer <access_token>.

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

The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: Manage All, Read All.

The API credential must belong to a reseller account.

Sample Responses

Returns an array of account objects. The array is empty if you have no child accounts.

[
    {
        "id": 123456,
        "name": "Acme Inc.",
        "address1": "100 Main Street",
        "address2": "Suite 200",
        "city": "Springfield",
        "state": "CA",
        "zip": "90210",
        "country": "US",
        "phone": "555-555-0100",
        "homepage": "https://www.example.com",
        "notes": null,
        "remotetoken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "created_at": "2024-05-01T17:20:31.000Z",
        "updated_at": "2024-05-01T17:20:33.000Z"
    },
    {
        "id": 234567,
        "name": "Example Corp",
        "address1": null,
        "address2": null,
        "city": null,
        "state": null,
        "zip": null,
        "country": "US",
        "phone": null,
        "homepage": null,
        "notes": null,
        "remotetoken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "created_at": "2024-06-12T09:02:11.000Z",
        "updated_at": "2024-06-12T09:02:12.000Z"
    }
]

The access token is missing, invalid, or expired, or it was generated from a credential without the required scope. The Authorization header value should use this format: bearer <access_token>.

{
    "name": "UnauthorizedError",
    "message": "Unauthorized",
    "statusCode": 401
}

The API credential doesn’t belong to a reseller account.

{
    "status": 422,
    "name": "Insufficient privileges",
    "message": "Only resellers are allowed to use the Accounts API"
}

Sample Code

cURL

Replace sample values indicated by < > with your actual values.

List Accounts

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