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

Messages — Legacy Redirect & Account Pre-selection

Messages — Legacy Redirect & Account Pre-selection

The messages page (/:company/messages) supports pre-selection of a specific account inbox when a user arrives from a legacy AgentOS messaging-centre link. This ensures continuity for users with bookmarked or shared URLs from the original AgentOS portal.

Legacy URL format

The original AgentOS messaging-centre route uses the following structure:

/:company/:accountType/messaging-centre/:personOID

Example:

/acme/LettingsTenant/messaging-centre/abc123

Redirect behaviour

All legacy messaging-centre URLs are permanently redirected (HTTP 307) to the unified messages page. Both personOID and accountType are forwarded as query parameters so context is preserved:

/acme/messages?personOID=abc123&accountType=LettingsTenant

This redirect is configured in next.config.ts.

Account type mapping

Legacy AgentOS account type names are translated to the portal's internal account type identifiers before being used for account matching:

Legacy AgentOS typePortal type
LettingsTenanttenant
LettingsLandlordlandlord
LettingsProspecttenant
SalesVendorvendor
SalesApplicantBuyerbuyer
MaintenanceContractorcontractor

If the account type is not in this map, it is lower-cased and used as a best-effort hint.

Account pre-selection strategy

When the messages page loads with personOID and/or accountType query parameters, the MessagesClient component attempts to pre-select the correct account inbox using the following ordered strategy:

  1. Exact match — finds an account where accountId === personOID
  2. Type-filtered match — finds an account where accountId === personOID and type === accountTypeHint
  3. Type-only fallback — selects the first account matching the hinted type
  4. Default fallback — selects the first account in the list (standard behaviour for direct visits)

This logic runs once, after accounts have finished loading, and does not interfere with subsequent user-driven account switching.

Direct visits

Navigating directly to /:company/messages (without query parameters) is completely unaffected. The first available account is selected by default, as before.

Component props

The MessagesClient component accepts two optional props to support pre-selection:

PropTypeDescription
initialPersonOIDstring | undefinedAgentOS person OID extracted from the personOID query parameter.
initialAccountTypeHintstring | undefinedNormalised account type extracted from the accountType query parameter after legacy name translation.

These props are populated by the MessagesPage server component (page.tsx) and are not intended to be set directly by consumers.

Error handling

  • If personOID does not match any loaded account, the matching strategy falls back gracefully through each level until a default account is selected.
  • An unknown accountType value causes the component to skip type-based strategies and fall back to the first available account.
  • No error is surfaced to the user in any fallback scenario.