Quickstart
This guide takes you from a new account to a delivered lead. You will create a provider that uses direct post, a priority campaign that routes to it, and submit one lead with curl.
All examples use synthetic data. Replace the buyer URL, token and identifiers with your own values.
-
Create an account
Register in the Pingdex app. Registration creates your account and your first user. Everything you create next belongs to that account.
-
Create an API key
In the app, go to Settings, then API keys, and create a key. Select these scopes:
Scope Used in this guide to providers:manageCreate the provider campaigns:manageCreate the campaign leads:ingestSubmit a lead leads:readRead the lead back Copy the token when it is shown. Then set it in your shell. The value below is fictional.
Terminal window export PINGDEX_TOKEN="pdx_example_4f8a1c2e9b7d"See API keys and API authentication.
-
Create a direct-post provider
A direct-post provider has an integration with a single
commitleg. This one sends the lead’s email address and a static source value to a buyer endpoint, and authenticates with a secret.Terminal window curl -X POST https://api.pingdex.io/api/v1/providers \-H "Authorization: Bearer $PINGDEX_TOKEN" \-H "Content-Type: application/json" \-H "Accept: application/json" \-d '{"name": "Example Buyer","enabled": true,"integration": {"legs": [{"name": "post","role": "commit","request": {"method": "POST","url": "https://buyer.example/leads","fields": {"Email": { "type": "field", "source": "payload.email" },"FirstName": { "type": "field", "source": "payload.first_name" },"Source": { "type": "static", "value": "pingdex" },"ApiKey": { "type": "secret", "secret": "api_token" }}}}]},"secrets": {"api_token": "example-buyer-api-token"}}'The response includes the provider
id. Keep it for the next step. Secret values are never returned. The response lists only the secret names.{"id": "01932a1e-7c3a-7000-8000-000000000020","name": "Example Buyer","enabled": true}Pingdex compiles the integration before saving it. If the integration is invalid, you receive a
422response with the path and reason, and nothing is saved. See Create a provider and Integration specification. -
Create a priority campaign with a schema
A
prioritycampaign commits to the first eligible provider in assignment order, so it requires commit-only providers. The schema describes the fields a lead must carry.provider_idslists providers in priority order.Terminal window curl -X POST https://api.pingdex.io/api/v1/campaigns \-H "Authorization: Bearer $PINGDEX_TOKEN" \-H "Content-Type: application/json" \-H "Accept: application/json" \-d '{"name": "Example campaign","enabled": true,"routing_strategy": "priority","schema": [{ "name": "first_name", "type": "string", "required": true },{ "name": "email", "type": "string", "required": true },{ "name": "age", "type": "integer", "required": false }],"provider_ids": ["01932a1e-7c3a-7000-8000-000000000020"]}'The response includes the campaign
id. This guide uses01932a1e-7c3a-7000-8000-000000000010as an example.See Create a campaign and Lead schema.
-
Submit a lead
Send the campaign’s
campaign_idand a JSON object aspayload.external_idis optional and lets you correlate the lead with your own records. TheIdempotency-Keyheader is optional and makes it safe to retry the request.Terminal window curl -X POST https://api.pingdex.io/api/v1/leads \-H "Authorization: Bearer $PINGDEX_TOKEN" \-H "Content-Type: application/json" \-H "Accept: application/json" \-H "Idempotency-Key: quickstart-0001" \-d '{"campaign_id": "01932a1e-7c3a-7000-8000-000000000010","external_id": "web-form-1001","payload": {"first_name": "Alex","email": "alex@example.com","age": 34}}'Pingdex responds with
202and the lead’s id. Processing continues after the response, so the status isreceivedat this point.{"id": "01932a1e-7c3a-7000-8000-000000000001","status": "received"}The request body accepts only
campaign_id,payloadandexternal_id. Any other top-level field is rejected. See Submit a lead and Leads API. -
Check the lead
Open the lead in the dashboard, or read it with the API using the
leads:readscope.Terminal window curl "https://api.pingdex.io/api/v1/leads?external_id=web-form-1001" \-H "Authorization: Bearer $PINGDEX_TOKEN" \-H "Accept: application/json"Look at
statusand, if the provider has a commit response mapping,commercial_status. To see each contact with a provider, request the lead’s attempts:Terminal window curl https://api.pingdex.io/api/v1/leads/01932a1e-7c3a-7000-8000-000000000001/attempts \-H "Authorization: Bearer $PINGDEX_TOKEN" \-H "Accept: application/json"A lead whose commit received a successful HTTP response has the status
delivered. Read Lifecycle and statuses for every outcome.
If something goes wrong
Section titled “If something goes wrong”| Symptom | Likely cause |
|---|---|
401 |
The token is missing, wrong or expired. |
403 |
The key lacks the scope for that endpoint. |
422 on lead submission |
The campaign is disabled or belongs to another account, or the payload does not match the schema. |
Lead status failed with no attempt |
No eligible provider. Check that the provider and campaign are enabled and that the provider is assigned to the campaign. |
409 on lead submission |
The Idempotency-Key was already used with a different request. |
See API errors and Lead troubleshooting.
Next steps
Section titled “Next steps”- What is ping/post? explains how to add a quote leg and use
highest_bidrouting. - Request mapping and Response mapping cover field types and commercial outcomes.
- Webhooks explains how to be notified when a lead reaches a final delivery status.
- MCP shows how to do the same from an MCP client.