How to get the Parent Account ID for filtering Admin API requests?

I am working with an MSP and I want to use the Admin API to get logs for specific child accounts from as well as for the parent account. I can list the child accounts using the Accounts API and select the account IDs I want to use in the requests to the Admin API, but is it possible to get the parent account ID in order to make the same request to the Admin API?

As I understand it, omitting the account ID to the Admin API requests will make it include all accounts, but I want to make requests for specific child accounts and requests for just the parent account.

You would use Admin API directly against the parent to pull logs from the parent. You don’t need the parent ID for that because you would be using an Admin API integration in the parent.

Thank you for the input. Does that mean that querying the Admin API without providing an account ID will only include results from the parent account? If so, that will work for my use case.

Yes, that’s correct!

  • Requests to Admin API endpoints using an Admin API application in the parent only return info for the parent.
  • Requests to Accounts API endpoints using an Accounts API application in the parent only return (minimal) info for children, and requests to Admin API endpoint using an Accounts API application with a child account returns full Admin API info for the specified child.

So like…

  1. create an Admin API application in the parent to pull logs from the parent using Admin API
  2. create an Accounts API application in the parent to pull lists of child account IDs from the parent using Accounts API
  3. use the Accounts API application you made in the parent to pull info from child accounts using Admin API and specifying the child account ID