Skip to main content
All Docs
FeaturesmyProp (AgentOS People Portal)Updated April 4, 2026

Account Discovery API Routes

Account Discovery API Routes

Introduced in: v0.1.10

Overview

The Account Discovery API route is the first call the portal makes immediately after a user logs in. It queries the AgentOS API using the authenticated user's email address and returns every portal account — across all supported roles — that is linked to that email.

This single lookup drives the entire post-login experience: which dashboards are displayed, which data is fetched, and which actions are available.


Supported Account Types

RoleDescription
LandlordProperty owner accounts managed by a letting agency
TenantActive or prospective tenants with a linked tenancy
BuyerPurchasers engaged in a sale through an estate agency
VendorSellers with a property listed through an estate agency
ContractorMaintenance and trades professionals linked to the agency

A single email address can be associated with multiple account types simultaneously. For example, the same user can be both a landlord and a contractor.


How It Works

  1. Authentication — The user logs in to the portal via the standard authentication flow.
  2. Discovery Call — The portal immediately calls the Next.js Account Discovery API route, passing the authenticated user's email address.
  3. AgentOS Lookup — The route proxies the request to the AgentOS (letmc.com) API, which searches for all accounts linked to that email across all five role types.
  4. Response — The API returns the matching account types and their associated IDs.
  5. Portal Routing — The portal uses the discovery response to determine which dashboards and features to render for the user.

API Route

Endpoint

GET /api/account-discovery

Authentication

This route requires the user to be authenticated. The user's email address is derived from the active session — no additional parameters are required in the request body.

Response

The response contains the list of account types and IDs linked to the authenticated user.

{
  "accounts": [
    {
      "type": "landlord",
      "id": "<account-id>"
    },
    {
      "type": "tenant",
      "id": "<account-id>"
    }
  ]
}
FieldTypeDescription
accountsarrayList of accounts linked to the user's email
accounts[].typestringRole type: landlord, tenant, buyer, vendor, or contractor
accounts[].idstringUnique account identifier from AgentOS

No Accounts Found

If no accounts are linked to the authenticated email address, the accounts array will be empty.

{
  "accounts": []
}

Notes

  • This route is a prerequisite for all subsequent account-scoped API calls within the portal.
  • The discovery route talks directly to the AgentOS (letmc.com) API and reflects real-time data.
  • Users with multiple account types will have access to all corresponding portal sections without needing to log in separately for each role.