Skip to main content

Overview

The Leads API allows partners to send inventory leads into the AnyHouse platform. These leads represent potential buyers or renters that can later be offered to brokers through the AnyHouse ecosystem. When using this endpoint:
  • The lead is created with source = bought
  • The lead is not attached to a listing
  • The lead is not attached to a broker or agency
  • Customer data is stored separately from the lead
This endpoint is designed for lead generation partners, portals, and integrations that send new contacts into the AnyHouse lead inventory.

Endpoint

POST
/api/partner/leads
Example request:
POST https://anyhouse.app/api/partner/leads

Authentication

You can authenticate using either of the following methods.

Bearer Token

Use the standard Authorization header.

X-Api-Key

Use your partner API key.

Option 1 — Bearer Token

Authorization: Bearer YOUR_API_TOKEN

Option 2 — Partner API Key

X-Api-Key: YOUR_PARTNER_API_KEY

Required Fields

At least one of the following fields must be present:
  • email
  • phone
If both are missing, the request will fail validation.

Request Body

{
  "name": "John Doe",
  "email": "john@example.com",
  "phone": "+1 809 555 1234",
  "notes": "Interested in Punta Cana properties around $200k.",
  "lead_type": "hot",
  "previous_conversation": [
    {
      "date": "2026-03-01T15:45:00Z",
      "direction": "inbound",
      "from": "john@example.com",
      "to": "sales@partner.com",
      "subject": "Interested in property",
      "body": "Hi, I'm looking for a 2 bedroom apartment in Punta Cana."
    },
    {
      "date": "2026-03-01T16:10:00Z",
      "direction": "outbound",
      "from": "sales@partner.com",
      "to": "john@example.com",
      "subject": "Re: Interested in property",
      "body": "Sure — what is your budget?"
    }
  ]
}

Field Description

FieldTypeDescription
namestringContact name
emailstringEmail address (required if phone is not provided)
phonestringPhone number (required if email is not provided)
notesstringOptional notes about the contact
lead_typestring"hot" or "cold" lead classification
previous_conversationarrayOptional conversation history such as email threads

Example Success Response

{
  "id": 12345,
  "name": "John Doe",
  "email": "john@example.com",
  "phone": "+1 809 555 1234",
  "lead_type": "hot",
  "created_at": "2026-03-03T12:00:00Z"
}

Validation Errors

If neither email nor phone is provided:
{
  "message": "The given data was invalid.",
  "errors": {
    "email": [
      "Email is required when phone is missing."
    ],
    "phone": [
      "Phone is required when email is missing."
    ]
  }
}

When to Use This Endpoint

Use this endpoint when:
  • You are sending lead inventory into AnyHouse
  • The lead is not tied to a specific listing
  • You want to attach contact data and conversation context
  • Leads will later be distributed to brokers inside the platform