Docs
API Docs
DocumentationZapier API Documentation

Zapier API Documentation

Complete API documentation for integrating InvestorBase with Zapier workflows, including authentication, webhook management, and data structures.

Overview

The InvestorBase Zapier API provides a complete integration system for connecting InvestorBase with Zapier workflows. This API enables users to authenticate, set up webhooks, manage subscriptions, and trigger automated workflows when new buyer data is available.

The base URL for the Zapier API is https://investorbase.com/api/zapier.

Note: All Zapier endpoints use HTTPS and require proper authentication. HTTP requests will be rejected.

Authentication

All Zapier endpoints use an encrypted API key system for authentication. The API key is generated during setup and must be included in requests as specified for each endpoint.

Security Features

  • Encryption: API keys are encrypted using XOR cipher with a secret key
  • Firebase Integration: User authentication backed by Firebase Auth
  • Token Verification: JWT tokens used for initial setup

Keep your API key secure and never share it publicly. API keys are encrypted and unique per user.


API Endpoints

1. Authentication Test

Endpoint: GET /api/zapier/auth

Purpose: Validates the API key and returns user information for Zapier authentication testing.

Request Parameters

ParameterTypeLocationRequiredDescription
api_keystringQueryYesEncrypted API key

Response

Success (200 OK):

{
  "user": {
    "email": "user@example.com"
  }
}

Error Responses:

  • 400 Bad Request: Missing API key
  • 401 Unauthorized: Invalid API key
  • 405 Method Not Allowed: Non-GET request
  • 500 Internal Server Error: Server error

Example Request

curl -X GET "https://investorbase.com/api/zapier/auth?api_key=YOUR_ENCRYPTED_API_KEY"

2. Setup Integration

Endpoint: POST /api/zapier/setup

Purpose: Generates and stores a new Zapier API key for the authenticated user.

Authentication

Requires Firebase JWT token in Authorization header:

Authorization: Bearer YOUR_FIREBASE_JWT_TOKEN

Request Body

{
  "uid": "firebase_user_id"
}

Request Parameters

ParameterTypeLocationRequiredDescription
uidstringBodyYesFirebase user ID

Response

Success (200 OK):

{
  "message": "Zapier key updated successfully",
  "zapKey": "encrypted_api_key_here"
}

Error Responses:

  • 400 Bad Request: Missing uid
  • 401 Unauthorized: Invalid or missing JWT token
  • 404 Not Found: User not found
  • 500 Internal Server Error: Server error

Example Request

curl -X POST "https://investorbase.com/api/zapier/setup" \
  -H "Authorization: Bearer YOUR_FIREBASE_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"uid": "your_firebase_user_id"}'

3. Subscribe to Webhooks

Endpoint: POST /api/zapier/sendBuyerInfo/subscribe

Purpose: Adds a Zapier webhook URL to the user's subscription list.

Request Parameters

ParameterTypeLocationRequiredDescription
api_keystringQueryYesEncrypted API key
web_urlstringQueryYesZapier webhook URL

Response

Success (200 OK):

{
  "message": "Zapier webhook added successfully"
}

Error Responses:

  • 400 Bad Request: Missing required parameters
  • 404 Not Found: User not found
  • 500 Internal Server Error: Server error

Example Request

curl -X POST "https://investorbase.com/api/zapier/sendBuyerInfo/subscribe?api_key=YOUR_ENCRYPTED_API_KEY&web_url=https://hooks.zapier.com/hooks/catch/123456/abcdef"

4. Unsubscribe from Webhooks

Endpoint: POST /api/zapier/sendBuyerInfo/unsubscribe

Purpose: Removes a Zapier webhook URL from the user's subscription list.

Request Parameters

ParameterTypeLocationRequiredDescription
api_keystringQueryYesEncrypted API key
web_urlstringQueryYesZapier webhook URL

Response

Success (200 OK):

{
  "message": "Zapier webhook removed successfully"
}

Error Responses:

  • 400 Bad Request: Missing required parameters
  • 404 Not Found: User not found
  • 500 Internal Server Error: Server error

Example Request

curl -X POST "https://investorbase.com/api/zapier/sendBuyerInfo/unsubscribe?api_key=YOUR_ENCRYPTED_API_KEY&web_url=https://hooks.zapier.com/hooks/catch/123456/abcdef"

5. Trigger Webhook

Endpoint: POST /api/zapier/sendBuyerInfo/trigger

Purpose: Sends buyer data to all subscribed Zapier webhooks for the authenticated user.

Request Body

{
  "apiKey": "encrypted_api_key",
  "buyerData": {
    // Buyer data object (see structure below)
  }
}

Buyer Data Structure

The buyerData object contains comprehensive property and buyer information:

{
  "streetAddress": "123 Main St",
  "bathrooms": 2,
  "bedrooms": 3,
  "city": "Los Angeles",
  "county": "Los Angeles",
  "email_1": "buyer@example.com",
  "landline_1_verification": "verified",
  "landline_1": 1234567890,
  "lastSaleDate": "2024-01-15",
  "lastSalePrice": 450000,
  "priorSaleDate": "2020-05-20",
  "priorSalePrice": 380000,
  "latitude": 34.0522,
  "livingSquareFeet": 1800,
  "longitude": -118.2437,
  "notes": "Additional notes about the property",
  "occurrences": 5,
  "registeredSellerName": "Company LLC",
  "registeredOwnerName": "Owner Name",
  "result_first_name": "John",
  "result_last_name": "Doe",
  "smartMatch": true,
  "state": "CA",
  "status": "New",
  "type": "flipper",
  "wireless_1": 9876543210,
  "wireless_1_verification": "verified",
  "wireless_2": 1122334455,
  "wireless_2_verification": "",
  "zillow_link": "https://www.zillow.com/homedetails/...",
  "zip": 90001,
  "propertyType": "SFR",
  "unitsCount": null,
  "lotSquareFeet": 7500,
  "Updated Owner Address": "456 Elm St",
  "Updated Owner City": "San Diego",
  "Updated Owner State": "CA",
  "Updated Owner Zip": 92101,
  "purchasePricePerSqFt": 250,
  "corporateBuyer": true
}

Response

Success (200 OK):

{
  "message": "Trigger sent to 2 Zapier webhook(s) successfully.",
  "errors": []
}

Error Responses:

  • 400 Bad Request: Missing API Key, Buyer Data, or no Zapier URLs found
  • 401 Unauthorized: Invalid API key
  • 405 Method Not Allowed: Non-POST request
  • 500 Internal Server Error: Server error

Example Request

curl -X POST "https://investorbase.com/api/zapier/sendBuyerInfo/trigger" \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "YOUR_ENCRYPTED_API_KEY",
    "buyerData": {
      "streetAddress": "123 Main St",
      "city": "Los Angeles",
      "state": "CA",
      "zip": 90001,
      "type": "flipper",
      "result_first_name": "John",
      "result_last_name": "Doe"
    }
  }'

6. Example Data

Endpoint: GET /api/zapier/sendBuyerInfo/example

Purpose: Returns sample buyer data for testing and development purposes.

Request Parameters

ParameterTypeLocationRequiredDescription
api_keystringQueryYesEncrypted API key

Response

Success (200 OK):

[
  {
    "address": "123 Main St",
    "bathrooms": 2,
    "bedrooms": 3,
    "city": "Los Angeles",
    "county": "Los Angeles",
    "email_1": "john.doe@example.com",
    "landline_1_verification": "incorrect",
    "landline_1": 1234567890,
    "lastSaleDate": "2024-01-15",
    "lastSalePrice": 450000,
    "priorSaleDate": "2020-05-20",
    "priorSalePrice": 380000,
    "latitude": 34.0522,
    "livingSquareFeet": 1800,
    "longitude": -118.2437,
    "notes": "Spacious property with a pool",
    "occurrences": 5,
    "buyerRegisteredName": "Doe Enterprises Llc",
    "result_first_name": "John",
    "result_last_name": "Doe",
    "smartMatch": true,
    "state": "CA",
    "status": "New",
    "type": "flipper",
    "wireless_1": 9876543210,
    "wireless_1_verification": "verified",
    "wireless_2": 1122334455,
    "wireless_2_verification": "",
    "zillow_link": "http://www.zillow.com/homes/123-Main-St-Los-Angeles-CA-90001_rb",
    "zip": 90001,
    "propertyType": "SFR",
    "unitsCount": null,
    "lotSquareFeet": 7500,
    "possible_buyer_address": "456 Elm St",
    "possible_buyer_city": "San Diego",
    "possible_buyer_state": "CA",
    "possible_buyer_zip": 92101,
    "purchasePricePerSqFt": 250,
    "corporateBuyer": true
  }
]

Error Responses:

  • 400 Bad Request: Missing API key
  • 404 Not Found: User not found
  • 500 Internal Server Error: Server error

Example Request

curl -X GET "https://investorbase.com/api/zapier/sendBuyerInfo/example?api_key=YOUR_ENCRYPTED_API_KEY"

Data Structures

Buyer Data Object

The buyer data object sent to Zapier webhooks contains the following fields:

FieldTypeDescription
addressStringProperty street address
bathroomsNumberNumber of bathrooms
bedroomsNumberNumber of bedrooms
cityStringProperty city
countyStringProperty county
email_1StringPrimary email address
landline_1NumberPrimary landline phone number
landline_1_verificationStringLandline verification status
lastSaleDateStringDate of last sale (YYYY-MM-DD)
lastSalePriceNumberPrice of last sale
priorSaleDateStringDate of prior sale
priorSalePriceNumberPrice of prior sale
latitudeNumberProperty latitude
livingSquareFeetNumberLiving area square footage
longitudeNumberProperty longitude
notesStringAdditional notes
occurrencesNumberNumber of occurrences/matches
buyerRegisteredNameStringRegistered business name
result_first_nameStringBuyer's first name
result_last_nameStringBuyer's last name
smartMatchBooleanSmart matching indicator
stateStringProperty state
statusStringLead status
typeStringBuyer type (flipper/landlord)
wireless_1NumberPrimary wireless phone number
wireless_1_verificationStringWireless verification status
wireless_2NumberSecondary wireless phone number
wireless_2_verificationStringSecondary wireless verification status
zillow_linkStringZillow property URL
zipNumberProperty ZIP code
propertyTypeStringProperty type (SFR, etc.)
unitsCountNumberNumber of units (for multi-family)
lotSquareFeetNumberLot size in square feet
possible_buyer_addressStringBuyer's address
possible_buyer_cityStringBuyer's city
possible_buyer_stateStringBuyer's state
possible_buyer_zipNumberBuyer's ZIP code
purchasePricePerSqFtNumberPurchase price per square foot
corporateBuyerBooleanCorporate buyer indicator

Error Handling

All endpoints return consistent error responses in the following format:

{
  "error": "Error description"
}

Common HTTP Status Codes

Status CodeDescription
200 OKRequest successful
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid API key or authentication token
404 Not FoundUser or resource not found
405 Method Not AllowedIncorrect HTTP method
500 Internal Server ErrorServer-side error

Integration Workflow

Setting Up Zapier Integration

  1. Authenticate User: User logs into InvestorBase application
  2. Generate API Key: Call /api/zapier/setup with Firebase JWT token
  3. Store API Key: Save the returned encrypted API key for Zapier use
  4. Test Authentication: Use /api/zapier/auth to verify the key works
  5. Subscribe to Webhooks: Use /api/zapier/sendBuyerInfo/subscribe to add webhook URLs

Typical Data Flow

  1. New Buyer Data: InvestorBase identifies a new buyer match
  2. Trigger Webhooks: User presses trigger button and system calls /api/zapier/sendBuyerInfo/trigger with buyer data
  3. Zapier Processing: Zapier receives the data and processes according to user's workflow
  4. Actions: Zapier can send emails, update CRM, create tasks, etc.

Testing and Development

  • Use /api/zapier/sendBuyerInfo/example to get sample data for testing
  • Verify webhook setup by checking subscription status
  • Test triggers with sample data before processing real buyer information

Always test your integration thoroughly with the example endpoint before deploying to production.


Security Considerations

API Key Management

  • API keys are encrypted using XOR cipher
  • Keys are unique per user and stored securely in Firebase
  • Keys can be regenerated through the setup endpoint

Data Protection

  • All requests use HTTPS encryption
  • Firebase authentication for administrative operations
  • User data is isolated and protected

Implement proper error handling and retry logic for webhook deliveries to ensure reliable data transmission.


Support and Troubleshooting

Common Issues

  1. Invalid API Key: Regenerate key using setup endpoint
  2. Webhook Not Triggered: Verify subscription and URL validity
  3. Authentication Failed: Check Firebase JWT token validity
  4. Missing Data: Verify buyer data structure matches expected format

Debugging Tips

  • Use the example endpoint to test with known data
  • Check webhook delivery logs in Zapier
  • Verify API key decryption is working correctly

For additional support, please contact the InvestorBase development team.

Best Practices

  1. Use HTTPS: Always use HTTPS for all API requests to ensure data security.
  2. Error handling: Implement robust error handling for all API calls.
  3. Data validation: Validate all data before sending to webhooks.
  4. Secure storage: Store API keys securely and never expose them in client-side code.
  5. Monitor webhooks: Regularly monitor webhook delivery success rates.
  6. Test thoroughly: Use the example endpoint for testing before production deployment.

Always follow these best practices to ensure a reliable and secure integration with the InvestorBase-Zapier API.