Create a lead
To create a lead, send a POST
request to https://api.agencymvp.com/v1/leads
, with the Content-Type: application/json
header and the
appropriate authorization headers.
The body of your request should be a JSON encoded object.
Parameters
Leads are created with a lead
key and an object, which represents the lead, as value.
The object also contains the origin member, secondary members, auto quote, home quotes, and life quotes of the lead.
Request
curl -X POST \
https://api.agencymvp.com/v1/leads \
-H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
-d '{
"lead": {
"organization_id": "organizationToken",
"street1": "1000 N Walnut Creek Ste 150",
"city": "Mansfield",
"state": "TX",
"postal_code": "76063",
"preferred_callback": "Afternoon",
"notes": "Some notes",
"origin_member": {
"first_name": "Doretha",
"last_name": "Bauch",
"gender": "Female",
"birth_date": "1988-07-21",
"is_married": true,
"email": "doretha.bauch@hudsontreutel.biz",
"phone_number": "7153094580",
"mobile_number": "6123139988",
"has_sms_consent": true,
"occupation": "Pharmacist",
"household_relationship": "Self",
"height": "5ft 9in",
"weight": 175.5,
"is_tobacco_user": false,
"has_pre_existing_conditions": true,
"has_prescriptions": null,
"has_military_service": true,
"credit_rating": "Excellent",
"has_dui": false,
"notes": "Pre-existing diagnosis of ..."
},
"secondary_members": [{
"first_name": "Vicente",
"last_name": "Hessel",
"gender": "Male",
"birth_date": "1966-08-21",
"is_married": true,
"email": "vicente.hessel@oconnellhoppe.org",
"phone_number": "8033030747",
"mobile_number": "7195025680",
"has_sms_consent": false,
"occupation": "Engineer",
"household_relationship": "Parent"
}],
"auto_quote": {
"insurance_carrier": "Allstate",
"existing_policy_number": "AUTOEPN123",
"policy_renewal_date": "2021-05-25",
"policy_term": "12 months",
"eft_draft_date": 1,
"payment_plan": "Pay-in-Full",
"full_term_premium": "1800",
"bodily_injury_liability_coverage": "30/60",
"property_damage_coverage": "40",
"um_uim_liability_coverage": "50/100",
"um_uim_property_damage_coverage": "50",
"personal_injury_protection_coverage": "7500",
"medical_protection_coverage": "7500",
"vehicles": [{
"year": 2019,
"make": "Buick",
"model": "Regal",
"vin": "DR87F4426J0231367",
"license_plate": "GTG-3832",
"owner_full_name": "Doretha Bauch",
"ownership_status": "Owned",
"annual_mileage": 8937,
"collision_coverage": 500,
"comprehensive_coverage": 500,
"rental_car_coverage": "80",
"towing_coverage": "20/600"
}]
},
"home_quotes": [{
"is_owner": true,
"is_escrowed": true,
"residence_type": "Secondary",
"insurance_carrier": "Allstate",
"policy_renewal_date": "2021-12-31",
"payment_plan": "Pay-in-Full",
"full_term_premium": 2208,
"dwelling_coverage": 235730,
"separate_structures_coverage": 23573,
"personal_property_coverage": 153225,
"personal_liability_coverage": 300000,
"loss_of_use_coverage": 58933,
"living_expense_term": "24 months",
"guest_medical_coverage": 5000,
"wind_hail_deductible": 2357,
"hurricane_deductible": 2357,
"other_deductible": 2357,
"home": {
"street1": "1155 Brad Spur",
"city": "West Demarcus",
"state": "AZ",
"postal_code": "85719",
"baths": 7.5,
"fireplaces": 5,
"garages": 4.5,
"stories": 4.0,
"square_feet": 4077,
"roof_year": 1992,
"has_electric_heating": true,
"has_gas_heating": true,
"has_pool": true,
"build_year": 1992,
"total_market_value": 761000
}
}],
"life_quotes": [{
"insurance_carrier": "Metlife",
"policy_renewal_date": "2021-12-31",
"payment_plan": "Pay-in-Full",
"full_term_premium": 1050.24,
"policy_type": "Whole Life",
"face_amount": 500000,
"first_name": "Doretha",
"last_name": "Bauch"
}],
"metadata": {
"tags": [
"customTag1",
"customTag2"
]
}
}
}'
Success Response
Given an app named Sample App, the response would be:
{
"id": 1,
"organization_id": "organizationToken",
"created_at": "2020-06-03T15:02:28.645Z",
"updated_at": "2020-06-03T15:02:28.645Z",
"preferred_callback": "Afternoon",
"notes": "Some notes",
"address": {
"street1": "1000 N Walnut Creek Ste 150",
"city": "Mansfield",
"state": "Texas",
"postal_code": "76063"
},
"origin_member": {
"first_name": "Doretha",
"last_name": "Bauch",
"gender": "Female",
"email": "doretha.bauch@hudsontreutel.biz",
"birth_date": "1988-07-21",
"is_married": true,
"phone_number": "7153094580",
"mobile_number": "6123139988",
"has_sms_consent": true,
"occupation": "Pharmacist",
"household_relationship": "Self",
"height": "5ft 9in",
"weight": 175.5,
"is_tobacco_user": false,
"has_pre_existing_conditions": true,
"has_prescriptions": null,
"has_military_service": true,
"credit_rating": "Excellent",
"has_dui": false,
"notes": "Pre-existing diagnosis of ..."
},
"secondary_members": [
{
"first_name": "Vicente",
"last_name": "Hessel",
"gender": "Male",
"email": "vicente.hessel@oconnellhoppe.org",
"birth_date": "1966-08-21",
"is_married": true,
"phone_number": "8033030747",
"mobile_number": "7195025680",
"has_sms_consent": false,
"occupation": "Engineer",
"household_relationship": "Parent"
}
],
"auto_quote": {
"insurance_carrier": "Allstate",
"existing_policy_number": "AUTOEPN123",
"policy_renewal_date": "2021-05-25",
"policy_term": "12 months",
"eft_draft_date": 1,
"payment_plan": "Pay-in-Full",
"full_term_premium": "1800",
"bodily_injury_liability_coverage": "30/60",
"property_damage_coverage": "40",
"um_uim_liability_coverage": "50/100",
"um_uim_property_damage_coverage": "50",
"personal_injury_protection_coverage": "7500",
"medical_protection_coverage": "7500",
"vehicles": [
{
"year": 2019,
"make": "Buick",
"model": "Regal",
"vin": "DR87F4426J0231367",
"license_plate": "GTG-3832",
"owner_full_name": "Doretha Bauch",
"ownership_status": "Owned",
"annual_mileage": 8937,
"collision_coverage": 500,
"comprehensive_coverage": 500,
"rental_car_coverage": "80",
"towing_coverage": "20/600"
}
]
},
"homes_quotes": [
{
"is_owner": true,
"is_escrowed": true,
"policy_renewal_date": "2021-12-31",
"residence_type": "Secondary",
"insurance_carrier": "Allstate",
"payment_plan": "Pay-in-Full",
"full_term_premium": 2208,
"dwelling_coverage": 235730,
"separate_structures_coverage": 23573,
"personal_property_coverage": 153225,
"personal_liability_coverage": 300000,
"loss_of_use_coverage": 58933,
"living_expense_term": "24 months",
"guest_medical_coverage": 5000,
"wind_hail_deductible": 2357,
"hurricane_deductible": 2357,
"other_deductible": 2357,
"home": {
"baths": 7.5,
"fireplaces": 5,
"garages": 4.5,
"stories": 4.0,
"square_feet": 4077,
"roof_year": 1992,
"has_electric_heating": true,
"has_gas_heating": true,
"has_pool": true,
"build_year": 1992,
"total_market_value": 761000,
"address": {
"street1": "1155 Brad Spur",
"city": "West Demarcus",
"state": "Arizona",
"postal_code": "85719"
}
}
}
],
"life_quotes": [
{
"is_owner": true,
"is_escrowed": true,
"policy_renewal_date": "2021-12-31",
"residence_type": "Secondary",
"insurance_carrier": "Allstate",
"payment_plan": "Pay-in-Full",
"full_term_premium": 2208,
"dwelling_coverage": 235730,
"separate_structures_coverage": 23573,
"personal_property_coverage": 153225,
"personal_liability_coverage": 300000,
"loss_of_use_coverage": 58933,
"living_expense_term": "24 months",
"guest_medical_coverage": 5000,
"wind_hail_deductible": 2357,
"hurricane_deductible": 2357,
"other_deductible": 2357,
"member": {
"first_name": "Doretha",
"last_name": "Bauch",
"gender": "Female",
"email": "doretha.bauch@hudsontreutel.biz",
"birth_date": "1988-07-21",
"is_married": true,
"phone_number": "7153094580",
"mobile_number": "6123139988",
"has_sms_consent": true,
"occupation": "Pharmacist",
"household_relationship": "Self"
}
}
]
}
Error Response
Given an attempt was made to create a lead with no origin member, the response would be:
{
"message": "Validation failed: Quote origin member must exist"
}