Skip to main content
Lead API Examples
Zoltan Wagner avatar
Written by Zoltan Wagner
Updated over 2 years ago

The Lead API is available only for clients using Envoke's lead distribution and lead attribution functionality. The vast majority of our customers use the Contact API or email sending API.


Endpoint

/leads

Supported HTTP Methods

  • GET

  • POST

  • PATCH

Lead Lifecycle

  1. New lead

  2. Marketing rating

  3. Sales rating

  4. Opportunity

  5. Sale

Lead Fields

Lead Statuses / Marketing rating

Field: "marketing_rating_status"
Values:

  • "Not applicable"

  • "Unprocessed"

  • "Passed to sales"

  • "Deferred"

  • "Lead updated"

Sales rating 

Field: "sales_rating_status"
Values:

  • "Not applicable"

  • "Unprocessed"

  • "Rated good"

  • "Rated bad"

  • "Contact attempted"

Opportunity 

Field: "opportunity"
Values:

  • "None"

  • "Yes"

  • "Cancelled"

Sale 

Field: "sale"
Values: 

  • "None"

  • "Yes"

  • "Cancelled"

cURL Examples

Return a list of leads:

curl -X GET -u USERNAME:PASSWORD "https://e1.envoke.com/v1/leads"

Find 5 leads that have been converted to opportunities

curl -X GET -u USERNAME:PASSWORD "https://e1.envoke.com/v1/leads?filter%5Bopportunity%5D=YES&limit=5"

Find a single lead with the id "1234"

curl -X GET -u USERNAME:PASSWORD "https://e1.envoke.com/v1/leads/1234"

Create a new "Hot" lead and contact

curl -X POST -u USERNAME:PASSWORD -d "{\"contact\":{\"email\":\"new-contact@api-testing.com\"},\"rule_rating\":\"Hot\"}" "https://e1.envoke.com/v1/leads"

Update a lead with the id "1234"

curl -X PATCH -u USERNAME:PASSWORD -d "{\"marketing_rating_status\":\"DEFERRED\",\"marketing_rating\":\"Cold\"}" "https://e1.envoke.com/v1/leads/1234"

 

Envoke Lead Object (with embedded Contact Data Object)

{
   "id": "1234",
   "contact": {
      "id": "321654",
      "remote_id": "",
      "first_name": "John",
      "last_name": "Purchase",
      "title": "Chief Architect",
      "email": "new-contact@api-testing.com",
      "company": "Art Vandelay Import/Exports",
      "phone": "647-987-1234",
      "address_1": "401 Richmond Street West",
      "address_2": "",
      "city": "Toronto",
      "country": "CA",
      "province": "ON",
      "postal_code": "M5V 5K7",
      "website": "",
      "language": "en",
      "feedback": "Hello. I'm interested in buying many of your widgets, please have someone contact me immediately!",
      "consent_status": "Express",
      "consent_description": "Lead is interested in receiving our widget updates",
      "custom_fields": [
         "widget_name": "Gold Deluxe Model 5X33"
      ],
      "interests": [
         "Business Products",
         "International",
         "Consumer"
      ],
      "autoresponders": [
         "Marketing Sequence 1",
         "Whitepaper Download"
      ]
   },
   "business_unit": "B2B Widgets",
   "remote_id": "",
   "marketing_user": "Jane Manager",
   "salesperson": "Tom Salesman",
   "create_time": "2016-02-05 09:13:06",
   "create_note": "",
   "rule_rating": "Hot",
   "marketing_rating_status": "Passed to sales",
   "marketing_rating": "Hot",
   "marketing_rating_time": "2016-02-05 10:57:42",
   "marketing_rating_note": "This is a great lead! You should check it out",
   "sales_rating_status": "Rated good",
   "sales_rating": "Contacted: Good",
   "sales_rating_time": "2016-02-06 14:17:37",
   "sales_rating_note": "",
   "opportunity": "Yes",
   "opportunity_time": "2016-02-06 14:17:37",
   "opportunity_note": "They are interested in buying widgets",
   "sale": "Yes",
   "sale_time": "2016-02-08 11:43:27",
   "sale_note": "Purchased 6 widgets",
   "revenue": "7595.00",
   "cost_of_goods_sold": "6200.00",
   "lead_region": "North America",
   "sales_channel": "Consumer",
   "industry": "Telecommunications",
   "timing": "< 1 month",
   "budget": "$5000+",
   "marketing_source": "Google",
   "marketing_medium": "cpc",
   "marketing_campaign": "early-funnel-campaign",
   "visitor_id": "1434636651779",
   "visit_id": "1455028009329",
   "pageview_id": "1455032370950"
}

Did this answer your question?