New Western API v1 (1.0.0)

Download OpenAPI specification:

New Western API v1

Submit a New Lead

Endpoint Overview: This endpoint enables you to securely submit new leads to the New Western Lead Ingestion System. Upon submission, leads are automatically queued for review and assigned to a qualified agent, who will contact the lead promptly.

Authentication: An active API key is required to invoke this endpoint. For inquiries regarding API key provisioning, please reach out to the NW Tech Team.

Required Fields

  • leadType: "Seller" | "Investor" | "Agent" | "Wholesaler"
  • data.email: Valid email address
  • data.phone: 10-digit phone number (formatting optional, will be normalized)

Optional Fields

  • data.firstName, data.lastName: Contact name
  • data.street, data.city, data.state, data.zip: Property address
  • data.marketId, data.officeId, data.agentId: Salesforce IDs
  • data.questionnaire: Experience level, timeframe, investment strategies, financing, etc.
  • data.analytics: UTM parameters and tracking IDs
  • data.additionalMetaData: Property details (100+ optional fields)

Response Status Codes

Status Description Response Body How to Handle
200 OK Lead successfully submitted { "leadId": "uuid" } Success - store leadId for tracking
400 Bad Request Invalid request format or validation error { "statusCode": 400, "message": "Validation failed", "errors": {...} } Fix validation errors: email format, phone must be 10 digits, required fields missing, or invalid enum values
401 Unauthorized Missing or invalid API key { "message": "Unauthorized" } Verify x-api-key header is present and correct
403 Forbidden API key lacks permission { "message": "Forbidden" } Contact support to verify API key permissions
422 Unprocessable Entity Business logic validation failed { "statusCode": 422, "message": "..." } Review error message (e.g., duplicate lead detected)
500 Internal Server Error Server-side error { "message": "Internal Server Error" } Retry with exponential backoff; contact support if persists

Quick Start

Minimal Request (cURL):

curl -X POST https://stage-api.newwestern.com/v1/leads/submit \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "leadType": "Seller",
    "data": {
      "email": "[email protected]",
      "phone": "5551234567"
    }
  }'

Postman Collections:

Request Requirements: Ensure your request body aligns with the defined schema and includes all mandatory fields. Requests that fail validation will be rejected. Properly formatted JSON payloads improve processing efficiency and expedite lead assignments.

Authorizations:
api_key
Request Body schema: application/json
object
leadType
required
string
Enum: "Seller" "Investor" "Agent" "Wholesaler"

Lead Type

Responses

Request samples

Content type
application/json
{
  • "data": {
    },
  • "leadType": "Seller"
}

Response samples

Content type
application/json
{
  • "leadId": "string"
}