> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hihobbes.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build account engagement rollups

> Prioritize companies using people, session, booking, and intent aggregates.

Account rollups group people by registrable business email domain. They are
useful for account-based routing and prioritization.

<CodeGroup>
  ```bash cURL theme={null}
  curl --fail-with-body --get \
    "https://api-us.hihobbes.com/api/v1/accounts" \
    --data-urlencode "limit=200" \
    --header "Authorization: Bearer $HOBBES_API_KEY"
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.get(
      "https://api-us.hihobbes.com/api/v1/accounts",
      headers={"Authorization": f"Bearer {os.environ['HOBBES_API_KEY']}"},
      params={"limit": 200},
      timeout=30,
  )
  response.raise_for_status()

  accounts = response.json()["accounts"]
  ranked = sorted(
      accounts,
      key=lambda account: (
          account["qualifiedUsers"] or 0,
          account["highIntentUsers"] or 0,
          account["lastSeenAt"] or "",
      ),
      reverse=True,
  )
  for account in ranked:
      print(account["accountDomain"], account["qualifiedUsers"], account["totalSessions"])
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://api-us.hihobbes.com/api/v1/accounts?limit=200", {
    headers: { Authorization: `Bearer ${process.env.HOBBES_API_KEY}` },
  });
  if (!response.ok) throw new Error(await response.text());

  const { accounts } = await response.json();
  accounts.sort((a, b) =>
    (b.qualifiedUsers ?? 0) - (a.qualifiedUsers ?? 0) ||
    (b.highIntentUsers ?? 0) - (a.highIntentUsers ?? 0) ||
    String(b.lastSeenAt ?? "").localeCompare(String(a.lastSeenAt ?? "")),
  );
  console.table(accounts);
  ```
</CodeGroup>

Retrieve `/accounts/{domain}` when an account workflow starts from a known
domain. URL-encode the domain before adding it to the path.
