Skip to main content

Insert leads using the API

Written by Line Jensen

Requires an API user access with Admin or Custom routes.


This article will explain how you insert leads into a campaign using the POST /leads endpoint.

We also have a video explaining how to do this as well here.

If you're looking for bulk imports, please have a look at this article. If you're looking for API documentation, please follow this link.


When a successful request is sent to this endpoint, the following two things will happen:

  • A contact is created in a pool.

  • The contact is associated with a campaign, resulting in a lead being created.

To get a better understanding of the difference between contacts and leads, please refer to this article.

The only required parameters for a simple POST leads request are the campaignId, pool, and masterData, a collection of field ids and values.

curl --location --request POST 'https://api.adversus.io/v1/leads' \--header 'Authorization: Basic XX' \--header 'Content-Type: application/json' \--data-raw '{  "campaignId": 27305,  "pool": 26024,  "masterData":[     {        "id": 1, // field id        "value": "adversus.io" // value     },     {        "id": 2,        "value": "+1 (337) 385 5102"     }  ]}'

Please check the official API documentation for details on how to get campaign, pool, and field IDs.

You can add the following parameters to your request if needed:

Parameter

Purpose

nextContactTime

The lead is, by default, ready to call after insert. If you want to schedule a call in the future, set this date/time parameter.

lastContactedBy

If you insert a private callback, this field can be populated with the user ID of whom should receive the callback.

status

The status field defaults to Unprocessed. Use this parameter if you want to insert a lead with another status.

externalId

External IDs can be useful when integrating with external systems. Please refer to this article for more details.


Did this answer your question?