Use this API to return one of your reseller account’s direct child accounts, including its roles.
Resource URL
https://<subdomain>.onelogin.com/api/2/accounts/:idHeader Parameters
Authorization required string | Set to Set 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: The API credential must belong to a reseller account. |
Resource Parameters
id required integer | Set to the |
Sample Responses
- 200 OK
- 401 Unauthorized
- 404 Not Found
- 422 Unprocessable Entity
Returns the account object with its roles.
{
"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",
"roles": [
{
"id": 345678,
"name": "Default"
}
]
}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
}No account with this id exists, or it isn’t a direct child of your account.
{
"status": 404,
"name": "NotFound",
"message": "The resource with the given id could not be found"
}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.
Get Account
curl 'https://<subdomain>.onelogin.com/api/2/accounts/<id>' \
-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? Check out our Knowledge Base.
Have a product idea or request? Share it in our Ideas Portal.