Response Format

Success Response

Status Code: 200 OK

{
  "success": true,
  "quoteId": "clx1234567890abcdefgh",
  "loginUrl": "https://yourdomain.com/api/auth/callback/credentials?token=..."
}

Response Fields

FieldTypeDescription
successbooleanAlways true for successful requests
quoteIdstringUnique identifier for the created quote
loginUrlstringMagic link URL for passwordless user login

About the Login URL

The loginUrl is a one-time magic link that:

  • Allows immediate passwordless authentication
  • Redirects users to /prequal/credit-check after login
  • Should be provided to the end user for immediate access

Error Responses

HTTP Status Codes

Status CodeMeaning
200Success - Lead created
400Bad Request - Validation error or duplicate
401Unauthorized - Invalid or missing token
405Method Not Allowed - Wrong HTTP method
500Internal Server Error

Error Response Structure

All errors return a JSON object with either message or error field:

{
  "message": "Error description"
}

or

{
  "error": "Error description"
}

Validation Error Format

When validation fails, the error response includes detailed information:

{
  "error": {
    "issues": [
      {
        "code": "custom",
        "message": "Required for condo properties",
        "path": ["address", "unitNumber"]
      }
    ]
  }
}
FieldDescription
codeError type (e.g., custom, invalid_string)
messageHuman-readable error message
pathArray indicating the field path that failed validation
validation(Optional) Specific validation type (e.g., email)

For detailed error examples and how to handle each error type, see the Error Handling section.