Birch & Co. Brokerage Zapier API Documentation

The Birch & Co. Brokerage Zapier API enables seamless integration between Birch & Co. Brokerage and Zapier's automation platform. This RESTful API uses OAuth 2.0 for authentication and provides triggers for real-time lead management automation.

Base URL: https://hub.birchandcobrokerage.com/api/v1/zapierAPI Version: v1Authentication: OAuth 2.0

Authentication

OAuth 2.0 Authorization Code Flow

Endpoint: GET /api/oauth/zapier/authorize

Redirect users to authorize Zapier access to their Birch & Co. Brokerage account.

Parameters:

  • client_id (required): Your Zapier OAuth client ID
  • redirect_uri (required): Zapier's callback URL
  • response_type (required): Must be "code"
  • state (optional): Random string for security

GET /api/oauth/zapier/authorize?client_id=your_client_id& redirect_uri=https://zapier.com/dashboard/auth/oauth/return/App223984CLIAPI/& response_type=code&state=random_string

API Endpoints

New Lead Trigger

GETPOST/api/v1/zapier/triggers/new_lead

Retrieve new leads for Zapier trigger automation.

Query Parameters / Request Body:

ParameterTypeDescription
statusstringFilter by lead status (e.g., "new", "contacted", "qualified")
sourcestringFilter by lead source (e.g., "website", "referral", "social")
date_afterstringISO 8601 datetime to get leads created after this date
user_idstringSpecific user ID (defaults to authenticated user)
pagenumberPage number for pagination (default: 0)

Success Response (200):

[ { "id": "01590a68-0c4f-a131-3d32-55d935341c11", "created_at": "2024-01-15T10:30:00Z", "full_name": "John Doe", "email": "john@example.com", "phone": "+1234567890", "assigned_agent_id": "agent-123", "lead_id": "lead-456", "team_id": "team-789", "lead_status": "new", "lead_source": "website", "intention": "buy", "property_type": "house", "location": "New York", "min_budget": "300000", "max_budget": "500000", "bedrooms": "3", "bathrooms": "2", "timeline": "3-6 months", "pre_approved": "true", "notes": "Looking for family home", "follow_up_date": "2024-01-20T10:00:00Z", "buyer_type": "first-time" } ]

User Information

GET/api/v1/zapier/user

Retrieve authenticated user information for account validation.

Error Handling

HTTP Status Codes

CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or expired token
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Error Response Format

{ "error": "error_code", "error_description": "Human-readable error description", "code": "SPECIFIC_ERROR_CODE" }

Common Error Codes

Error CodeDescriptionSolution
invalid_tokenAccess token is invalid or malformedRefresh token or re-authenticate
TOKEN_EXPIREDAccess token has expiredUse refresh token to get new access token
invalid_clientClient ID or secret is incorrectVerify OAuth credentials
invalid_grantAuthorization code or refresh token invalidRe-authenticate user
access_deniedUser denied authorizationUser must approve Zapier access

Rate Limiting

  • Rate Limit: 100 requests per minute per user
  • Burst Limit: 10 requests per second

Headers Included:

  • X-RateLimit-Limit: Request limit per window
  • X-RateLimit-Remaining: Requests remaining in current window
  • X-RateLimit-Reset: Time when rate limit resets (Unix timestamp)

Rate Limit Exceeded Response (429):

{ "error": "rate_limit_exceeded", "error_description": "Too many requests. Try again later.", "retry_after": 60 }

Token Validation

GET/api/oauth/zapier/validate

Validate the current access token and return user information.

Success Response (200):

{ "valid": true, "user_id": "user-123", "email": "user@birchandcobrokerage.com", "scopes": ["read:leads", "write:leads"], "expires_at": "2024-01-15T11:30:00Z" }

Webhooks & Real-time Updates

Birch & Co. Brokerage supports webhook notifications for real-time lead updates.

Configuration:

  • Webhook URL: Set in Zapier app settings
  • Content-Type: application/json
  • Authentication: HMAC-SHA256 signature verification

Webhook Payload:

{ "event_type": "lead.created", "timestamp": "2024-01-15T10:30:00Z", "data": { // Lead object (same format as API response) } }

Testing & Development

Test Endpoints

Base URL: https://hub.birchandcobrokerage.com/api/v1/zapier

Test Credentials

Client ID: zapier_test_client_123 Client Secret: zapier_test_secret_456 Test User Email: zapier-test@birchandcobrokerage.com Test User Password: TestPassword123!

Sample cURL Commands

Get Access Token:

curl -X POST https://hub.birchandcobrokerage.com/api/oauth/zapier/token \ -H "Content-Type: application/json" \ -d '{ "grant_type": "authorization_code", "client_id": "your_client_id", "client_secret": "your_client_secret", "code": "auth_code_here", "redirect_uri": "https://zapier.com/dashboard/auth/oauth/return/App223984CLIAPI/" }'

Get New Leads:

curl -X GET "https://hub.birchandcobrokerage.com/api/v1/zapier/triggers/new_lead?status=new" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Support & Resources

Technical Support:

support@birchandcobrokerage.com

Developer Portal:

https://hub.birchandcobrokerage.com/developers

Status Page:

https://status.birchandcobrokerage.com

Zapier Integration:

https://zapier.com/apps/Birch & Co.crm


SDKs & Libraries

  • JavaScript/Node.js: npm install @Birch & Co./zapier-sdk
  • Python: pip install Birch & Co.-zapier
  • PHP: composer require Birch & Co./zapier-client

Changelog

v1.0.0 (Current)

  • Initial API release
  • OAuth 2.0 authentication
  • New Lead trigger
  • Real-time webhook support
  • Rate limiting implementation

Security

  • OAuth 2.0 with PKCE support
  • HTTPS only - All endpoints require SSL/TLS
  • Token expiration - Access tokens expire in 1 hour
  • Scope-based permissions - Granular access control
  • Request signing - HMAC-SHA256 webhook verification
  • Rate limiting - Protection against abuse

Lead Object Field Descriptions

FieldTypeDescription
idstringUnique lead identifier
created_atstring (ISO 8601)Lead creation timestamp
full_namestringLead's full name
emailstringLead's email address
phonestringLead's phone number
assigned_agent_idstringID of assigned real estate agent
lead_idstringHuman-readable lead ID
team_idstringAssociated team identifier
lead_statusstringCurrent lead status
lead_sourcestringHow the lead was acquired
intentionstringLead's intention (buy/sell/rent)
property_typestringType of property interest
locationstringPreferred location
min_budgetstringMinimum budget (converted to string)
max_budgetstringMaximum budget (converted to string)
bedroomsstringNumber of bedrooms (converted to string)
bathroomsstringNumber of bathrooms (converted to string)
timelinestringPurchase timeline
pre_approvedstringPre-approval status (converted to string)
notesstringAdditional notes
follow_up_datestring (ISO 8601)Scheduled follow-up date
buyer_typestringType of buyer

API Documentation v1.0.0