Buyer Accounts API
Create buyer accounts, share sessions and manage saved homes and searches from your own website.
Build your own listing cards, detail pages and buyer account screens. Pro and higher include these server-side endpoints after website verification and active MLS approval. Widgets are optional for this workflow.
Authenticate your application and buyer
Send your server-only API key in Authorization and your approved website ID in X-EAI-Site-ID. Add X-EAI-Visitor-Token after the buyer signs in. An API key alone cannot access a buyer's private saved state.
| Operation | Scope | Buyer session |
|---|---|---|
POST /buyer/register | visitors:write | No |
POST /buyer/login | visitors:write | No |
POST /buyer/session | visitors:write | No, trusted server identity required |
GET /buyer/me | visitors:read | Yes |
DELETE /buyer/session | visitors:write | Yes |
POST /buyer/widget-session | visitors:write | Yes |
GET /buyer/saved-listings | saved-listings:read | Yes |
POST /buyer/saved-listings | saved-listings:write | Yes |
DELETE /buyer/saved-listings/{listing_id} | saved-listings:write | Yes |
GET /buyer/saved-searches | saved-searches:read | Yes |
POST /buyer/saved-searches | saved-searches:write | Yes |
PATCH /buyer/saved-searches/{id} | saved-searches:write | Yes |
DELETE /buyer/saved-searches/{id} | saved-searches:write | Yes |
POST /buyer/activity | visitors:write | Yes |
Register or sign in
curl https://app.easyagentidx.com/api/v1/buyer/register -H "Authorization: Bearer $EAI_API_KEY" -H "X-EAI-Site-ID: $EAI_SITE_ID" -H "Content-Type: application/json" -d '{"email":"buyer@example.com","name":"Taylor Buyer","password":"YOUR_STRONG_PASSWORD"}'The response contains data.token, data.expires_at and data.visitor. New passwords use at least 15 characters with uppercase and lowercase letters, a number and a symbol. Sign-in accepts existing passwords. Store the token in a secure, HttpOnly, SameSite cookie on your website. Sessions expire after 30 days. Signing out revokes the session on the server. Saved homes and searches remain in the buyer account.
Connect your existing buyer login
After your server verifies your own login and the buyer's email, call POST /buyer/session with a stable subject, email and email_verified: true. Optional fields are name and phone. EAI links that subject to the same account-level buyer record used by widgets. A subject already linked to another email returns 409 IDENTITY_CONFLICT.
Notice
Only your trusted server may assert an external identity. Read the subject and verified email from your authentication provider. Never pass through an email or subject supplied by an unauthenticated browser.Save and remove a home
Post {"listing_id":"LISTING_ID"} to /buyer/saved-listings. EAI verifies the listing is available on your approved feed. Delete the listing ID from the same resource to remove it. The list response contains saved identifiers. Fetch current listing data before display so MLS attribution and display rights remain current.
Create and edit a search
{
"name": "Jacksonville homes",
"criteria": { "city": "Jacksonville", "state": "FL", "maxPrice": 650000, "minBedrooms": 3, "statuses": ["active"] },
"alert_frequency": "daily",
"alert_types": ["new_listing", "price_drop", "back_on_market"]
}Post this object to /buyer/saved-searches. Patch a search ID to update its name, criteria, alert frequency, alert types or active state. Delete the ID to remove it. Criteria use the same camel case fields as widget search, including location, city, state, ZIP codes, price, beds, baths, size, year built, property types and supported features. A location or MLS number is required. Unknown fields are rejected. Changing criteria starts a new comparison baseline.
Frequencies are instant, daily, weekly and none. Instant checks run every five minutes and delivery depends on the connected email service. See Buyer Alerts for triggers and delivery setup.
Record views and searches
Post {"type":"viewed_property","listing_id":"LISTING_ID"} or {"type":"property_search","criteria":{"city":"Jacksonville","state":"FL"}} to /buyer/activity after the identified buyer performs that action. Saving a home or search records its activity automatically. Rendering listing data through the read API alone does not record buyer activity.
These actions feed the same Follow Up Boss integration as widgets.
Retry a write safely
Send a unique Idempotency-Key with saved home, saved search and activity writes. Use 8 to 128 letters, numbers, dots, colons, underscores or hyphens. Retry an interrupted request with the same key and body. Reusing a key with a different body returns 409 IDEMPOTENCY_CONFLICT. Committed responses are retained for 24 hours. Registration, sign-in, session exchange and sign-out use their own session behavior.
Share a session with widgets
Call POST /buyer/widget-session from a same-origin server endpoint using the buyer token in your HttpOnly cookie. Check the browser origin before returning the response. The result contains a five-minute, site-bound token and public visitor information.
// Run after the EAI widget loader is ready.
async function connectWidgets() {
const response = await fetch('/api/buyer/widget-session', { method: 'POST' });
if (!response.ok) return;
const { token, visitor } = await response.json();
window.EasyAgentIDX.setVisitorSession(visitor.account_id, token, visitor);
}
await connectWidgets();
setInterval(connectWidgets, 4 * 60 * 1000);On logout, call DELETE /buyer/session from your server, clear the first-party cookie and call window.EasyAgentIDX.clearVisitorSession(accountId). Revocation applies to custom pages and bridged widgets. Your server endpoint must never expose the developer API key.
Use the JavaScript client
Download the server-side JavaScript client and import it into your server code. Its methods cover registration, sign-in, external session exchange, saved homes, saved searches and activity. Keep credentials and buyer session exchange on your server. Use your framework's cookie and CSRF protections for browser-facing routes.