Zapier API Documentation
Complete API documentation for integrating InvestorBase with Zapier workflows
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
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
api_key | string | Query | Yes | Encrypted API key |
Response
Success (200 OK):
{
"user": {
"email": "user@example.com"
}
}Error Responses:
400 Bad Request: Missing API key401 Unauthorized: Invalid API key405 Method Not Allowed: Non-GET request500 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
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
uid | string | Body | Yes | Firebase user ID |
Response
Success (200 OK):
{
"message": "Zapier key updated successfully",
"zapKey": "encrypted_api_key_here"
}Error Responses:
400 Bad Request: Missing uid401 Unauthorized: Invalid or missing JWT token404 Not Found: User not found500 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
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
api_key | string | Query | Yes | Encrypted API key |
web_url | string | Query | Yes | Zapier webhook URL |
Response
Success (200 OK):
{
"message": "Zapier webhook added successfully"
}Error Responses:
400 Bad Request: Missing required parameters404 Not Found: User not found500 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
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
api_key | string | Query | Yes | Encrypted API key |
web_url | string | Query | Yes | Zapier webhook URL |
Response
Success (200 OK):
{
"message": "Zapier webhook removed successfully"
}Error Responses:
400 Bad Request: Missing required parameters404 Not Found: User not found500 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 found401 Unauthorized: Invalid API key405 Method Not Allowed: Non-POST request500 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
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
api_key | string | Query | Yes | Encrypted 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 key404 Not Found: User not found500 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:
| Field | Type | Description |
|---|---|---|
address | String | Property street address |
bathrooms | Number | Number of bathrooms |
bedrooms | Number | Number of bedrooms |
city | String | Property city |
county | String | Property county |
email_1 | String | Primary email address |
landline_1 | Number | Primary landline phone number |
landline_1_verification | String | Landline verification status |
lastSaleDate | String | Date of last sale (YYYY-MM-DD) |
lastSalePrice | Number | Price of last sale |
priorSaleDate | String | Date of prior sale |
priorSalePrice | Number | Price of prior sale |
latitude | Number | Property latitude |
livingSquareFeet | Number | Living area square footage |
longitude | Number | Property longitude |
notes | String | Additional notes |
occurrences | Number | Number of occurrences/matches |
buyerRegisteredName | String | Registered business name |
result_first_name | String | Buyer's first name |
result_last_name | String | Buyer's last name |
smartMatch | Boolean | Smart matching indicator |
state | String | Property state |
status | String | Lead status |
type | String | Buyer type (flipper/landlord) |
wireless_1 | Number | Primary wireless phone number |
wireless_1_verification | String | Wireless verification status |
wireless_2 | Number | Secondary wireless phone number |
wireless_2_verification | String | Secondary wireless verification status |
zillow_link | String | Zillow property URL |
zip | Number | Property ZIP code |
propertyType | String | Property type (SFR, etc.) |
unitsCount | Number | Number of units (for multi-family) |
lotSquareFeet | Number | Lot size in square feet |
possible_buyer_address | String | Buyer's address |
possible_buyer_city | String | Buyer's city |
possible_buyer_state | String | Buyer's state |
possible_buyer_zip | Number | Buyer's ZIP code |
purchasePricePerSqFt | Number | Purchase price per square foot |
corporateBuyer | Boolean | Corporate buyer indicator |
Error Handling
All endpoints return consistent error responses in the following format:
{
"error": "Error description"
}Common HTTP Status Codes
| Status Code | Description |
|---|---|
200 OK | Request successful |
400 Bad Request | Missing or invalid parameters |
401 Unauthorized | Invalid API key or authentication token |
404 Not Found | User or resource not found |
405 Method Not Allowed | Incorrect HTTP method |
500 Internal Server Error | Server-side error |
Integration Workflow
Setting Up Zapier Integration
- Authenticate User: User logs into InvestorBase application
- Generate API Key: Call
/api/zapier/setupwith Firebase JWT token - Store API Key: Save the returned encrypted API key for Zapier use
- Test Authentication: Use
/api/zapier/authto verify the key works - Subscribe to Webhooks: Use
/api/zapier/sendBuyerInfo/subscribeto add webhook URLs
Typical Data Flow
- New Buyer Data: InvestorBase identifies a new buyer match
- Trigger Webhooks: User presses trigger button and system calls
/api/zapier/sendBuyerInfo/triggerwith buyer data - Zapier Processing: Zapier receives the data and processes according to user's workflow
- Actions: Zapier can send emails, update CRM, create tasks, etc.
Testing and Development
- Use
/api/zapier/sendBuyerInfo/exampleto 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
- Invalid API Key: Regenerate key using setup endpoint
- Webhook Not Triggered: Verify subscription and URL validity
- Authentication Failed: Check Firebase JWT token validity
- 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
- Use HTTPS: Always use HTTPS for all API requests to ensure data security.
- Error handling: Implement robust error handling for all API calls.
- Data validation: Validate all data before sending to webhooks.
- Secure storage: Store API keys securely and never expose them in client-side code.
- Monitor webhooks: Regularly monitor webhook delivery success rates.
- 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.