Skip to main content
POST
cURL

Overview

The Database Source Lead Posting API creates a new lead record directly in a database source. Unlike the offer campaign form API, this endpoint stores leads in a standalone database source — used as a centralised lead repository, suppression list, or feed for downstream campaigns. Both GET and POST HTTP methods are supported. Authentication is via the database source’s API key, which is auto-generated when the source is created.

Endpoint

Replace {db-source-id} with the MongoDB Object ID of the database source. This is available in the Pingtree dashboard under Database Sources.

Authentication

Include the database source API key in the Authorization header:
The API key is generated when the database source is created and can be found on the source’s detail page.

Request Parameters

Path Parameters

Body / Query Parameters

Fields accepted depend on the required fields configured for the database source. Common system fields include: For GET requests, pass parameters as query string values. For POST requests, send as a JSON body or form-encoded body. The exact required fields are configured per database source. Invalid or missing required fields result in rejection with a list of affected field names.

Example Request — POST

Example Request — GET

Example Responses

Success — Lead Created

Success — Duplicate Lead

Error — Missing Required Field

Error — Invalid Field

Error — Unauthorized

Error — Source Not Found or Inactive

Status Codes

Deduplication

If the database source has deduplication enabled, the configured duplicate field (e.g. email or mobile) is checked against existing records before the lead is stored. If a match is found, the lead status is duplicate and the record is not stored again.

Tips

  • API key security. The database source API key grants write access to that source. Keep it confidential and rotate it if compromised (via the Pingtree dashboard).
  • GET vs POST. GET requests are useful for simple server-to-server integrations or pixel-style firing. POST with a JSON body is recommended for production use.
  • Allowed fields list. The source can be configured with an allowed fields list that restricts which fields are accepted. Fields outside this list are silently ignored.
  • TrustedForm fields. xxTrustedFormToken, xxTrustedFormCertUrl, and xxTrustedFormPingUrl are automatically mapped to internal fields if present in the request.
  • Rate limiting. Database source endpoints are rate-limited per source. Contact your account manager if you need higher throughput limits.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

db-source-id
string
required

Your database source ID

Body

application/json

Lead details to add to the database source

first_name
string

First name of the lead

last_name
string

Last name of the lead

email
string

Email of the lead

mobile
string

Mobile of the lead

address
string

Address of the lead

state
string

State of the lead

city
string

City of the lead

zip_code
string

Zip Code of the lead

date_of_birth
string

Date of Birth of the lead

Response

Lead successfully created

status
string

Status code of API response

message
string

Message of API response

data
object

Created lead information such as transaction_id, lead_status, etc.