API Documentation

Comprehensive guides and references for seamless integration
Endpoint

POST https://localedgemarketingco.com/router.php?action=import_lead

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

  • Header: Authorization: Bearer YOUR_API_KEY_HERE
  • Header: Content-Type: application/json

Getting Your API Key:

  1. Log into your CRM account
  2. Navigate to Settings → API Keys
  3. Generate a new API key or copy an existing one
  4. Keep your API key secure and never share it publicly

Rate Limits: API requests are limited to 100 requests per minute per API key.

Sample Request Body
{
	"name": "Jane Smith",
	"email": "jane.smith@example.com",
	"phone": "5551234567",
	"source": "Zillow",
	"tags": ["zillow", "buyer", "new"],
	"addresses": [
		{
			"type": "home",
			"street": "123 Main St",
			"city": "Los Angeles",
			"state": "CA",
			"zip": "90001"
		},
		{
			"street": "456 Oak Ave",
			"city": "San Diego",
			"state": "CA",
			"zip": "92101"
		}
	],
	"stage": "new",
	"type": "buyer"
}
			
  • Required: name and at least one of email or phone
  • Optional: source, tags, addresses (array, each with type (optional, defaults to OTHER), street, city, state, zip), stage, type, etc.
Sample Success Response
{
	"success": true,
	"lead_id": "uuid-or-id-here",
	"action": "created" // or "updated"
}
			
Error Responses

400 Bad Request - Missing Required Fields:

{
	"success": false,
	"error": "Missing required field: name",
	"code": "MISSING_REQUIRED_FIELD"
}
				

401 Unauthorized - Invalid API Key:

{
	"success": false,
	"error": "Invalid or missing API key",
	"code": "UNAUTHORIZED"
}
				

403 Forbidden - API Key Disabled:

{
	"success": false,
	"error": "API key has been disabled",
	"code": "API_KEY_DISABLED"
}
				

429 Too Many Requests - Rate Limit Exceeded:

{
	"success": false,
	"error": "Rate limit exceeded. Maximum 100 requests per minute.",
	"code": "RATE_LIMIT_EXCEEDED",
	"retry_after": 60
}
				

500 Internal Server Error:

{
	"success": false,
	"error": "Internal server error occurred",
	"code": "INTERNAL_ERROR"
}
				
Integration Instructions
  1. Obtain your API key from your CRM admin or settings page.
  2. Send a POST request to the endpoint above with the required headers and JSON body.
  3. On success, you will receive a JSON response with the lead ID and action taken.

You can use tools like Postman, cURL, Zapier, Make, or any programming language that supports HTTP requests.

Sample cURL Command
curl -X POST "https://localedgemarketingco.com/router.php?action=import_lead" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-d '{
"name": "Jane Smith",
"email": "jane.smith@example.com",
"phone": "5551234567",
"source": "Zillow",
"tags": ["zillow", "buyer", "new"],
"addresses": [
  {
	"type": "home",
	"street": "123 Main St",
	"city": "Los Angeles",
	"state": "CA",
	"zip": "90001"
  },
  {
	"street": "456 Oak Ave",
	"city": "San Diego",
	"state": "CA",
	"zip": "92101"
  }
],
"stage": "new",
"type": "buyer"
}'
			
Notes & Best Practices
  • Never share your API key publicly.
  • Log and monitor incoming requests for abuse or errors.
  • Test with Postman or cURL before going live with a partner.
  • If a partner can only send data by email or in a different format, use Zapier/Make or a custom script to reformat and forward to this API.
  • Address type is optional. If not provided, it will default to OTHER.
Email-to-Lead Parsing

You can also create leads by sending an email to your CRM's lead inbox. The email parser supports the same fields as the API, using simple text patterns in the email body.

  • Supported fields: name, stage, type, tags, source, addresses (with type, street, city, state, zip), phones, emails, notes, etc.
  • Addresses: Use lines like Address (HOME): 123 Main St, Springfield, IL, 62701. The type is optional and will default to OTHER if not provided.
  • Phones/Emails: Use Phone:, Phone 2:, Email:, Email 2:, etc. for multiple values.
  • Notes: Use Note:, Note 2:, etc. for multiple notes.
  • Tags: Use Tags: tag1, tag2, tag3.

Sample Email Body:

Name: Jane Smith
Stage: prospect
Type: seller
Tags: new, test, emailparser
Source: website

Address: 100 Main St, Springfield, IL, 62701
Address 2: 200 Oak Ave, Shelbyville, IL, 62565

Phone: 5551230001
Phone 2: 5551230002
Phone 3: 5551230003

Email: janesmith001@example.net
Email 2: contact.jane.smith@fakemail.org
Email 3: jsmith.random@nowhere.test

Note: This is a test note for Jane Smith.
Note 2: Second note for testing.
Note 3: Final test note.

user: {user email}
				

All fields are optional except name and at least one of email or phone. The parser will extract as much information as possible and send it to the API automatically.