Embed customizable forms and widgets on your website to capture leads directly into GHL. The Widget API automatically creates contacts and can optionally generate opportunities based on form submissions.
Method: POST
URL: /api/widget/test-location-123
Headers:
{
"Content-Type": "application/json",
"m4-connect-key": "[your-api-key]"
}Body:
firstName
string (required) - First name of the lead
lastName
string (optional) - Last name of the lead
string (optional) - Email address of the lead
phone
string (optional) - Phone number of the lead
message
string (optional) - Message or inquiry from the lead
{
"success": true,
"data": {
"id": "contact-id",
"contactId": "contact-id",
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+1234567890"
}
}400 Bad Request
Missing required fields or invalid data format
401 Unauthorized
Invalid or missing API key header
500 Server Error
Internal server error while processing request