Database Source
Lead Posting API
The Create Lead API is used to add new lead data directly to the database source. This API is essential for maintaining comprehensive lead records and ensuring data is accurately stored across database source.
POST
cURL
Documentation Index
Fetch the complete documentation index at: https://docs.pingtree.com/llms.txt
Use this file to discover all available pages before exploring further.
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
{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 theAuthorization header:
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
db-source-id | string | Yes | MongoDB Object ID of the database source |
Body / Query Parameters
Fields accepted depend on the required fields configured for the database source. Common system fields include:| Parameter | Type | Required | Description |
|---|---|---|---|
first_name | string | Conditional | Consumer’s first name |
last_name | string | Conditional | Consumer’s last name |
email | string | Conditional | Email address (validated as a valid email format) |
mobile | string | Conditional | 10-digit phone number (digits only) |
address | string | Conditional | Street address |
city | string | Conditional | City name (letters and spaces only) |
state | string | Conditional | 2-letter state abbreviation |
zip_code | string | Conditional | 5-digit ZIP code |
transaction_id | string | No | Custom transaction ID; auto-generated if omitted |
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
| HTTP Code | Lead Status | Description |
|---|---|---|
| 201 | accept | Lead created successfully |
| 201 | duplicate | Lead already exists (deduplication enabled and matched) |
| 400 | missingField | One or more required fields are absent |
| 400 | invalidField | One or more fields failed format validation |
| 401 | — | Invalid or missing API key |
| 500 | — | Internal server error |
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, andxxTrustedFormPingUrlare 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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Your database source ID
Body
application/json
Lead details to add to the database source
First name of the lead
Last name of the lead
Email of the lead
Mobile of the lead
Address of the lead
State of the lead
City of the lead
Zip Code of the lead
Date of Birth of the lead
cURL