Quickstart

Quickstart the Public API

Use this guide to move from account creation to your first authenticated request, first lead write, first list sync and first webhook subscription.

Base path
/api/public/v1
First endpoint
/me
Mutation safety
Idempotency-Key
Tracing
request_id

1. Create a workspace and generate credentials

Credential generation requires a workspace. Reading docs does not.

  • Use the signup flow at https://www.login.prospectb2b.com/signup when you need workspace access.
  • Open Settings > Integrations > API in the authenticated product to create a tenant-scoped API key.
  • Choose the smallest scope set that covers your automation. Scopes inherit the creator membership permissions.
  • Store the secret immediately. The UI shows the secret once at creation or rotation time.

2. Verify the key with /me

Call /me first so your integration can confirm scopes and read_only semantics before writing.

curl https://login.prospectb2b.com/api/public/v1/me \
  -H "Authorization: Bearer pb2b_live_xxxxx_xxxxx"

3. Create a lead safely

ProspectB2B supports idempotent write flows for safe retries across network or worker failures.

curl https://login.prospectb2b.com/api/public/v1/leads \
  -X POST \
  -H "Authorization: Bearer pb2b_live_xxxxx_xxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: lead-create-001" \
  -d '{
    "full_name": "Ada Lovelace",
    "email": "[email protected]",
    "company_name": "Analytical Engine Inc."
  }'
const response = await fetch('https://login.prospectb2b.com/api/public/v1/leads', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer pb2b_live_xxxxx_xxxxx',
    'Content-Type': 'application/json',
    'Idempotency-Key': 'lead-create-001'
  },
  body: JSON.stringify({
    full_name: 'Ada Lovelace',
    email: '[email protected]',
    company_name: 'Analytical Engine Inc.'
  })
});

const body = await response.json();
import requests

response = requests.post(
    "https://login.prospectb2b.com/api/public/v1/leads",
    headers={
        "Authorization": "Bearer pb2b_live_xxxxx_xxxxx",
        "Idempotency-Key": "lead-create-001"
    },
    json={
        "full_name": "Ada Lovelace",
        "email": "[email protected]",
        "company_name": "Analytical Engine Inc."
    },
    timeout=30,
)

print(response.json())

4. List leads for incremental sync

Use cursor pagination plus updated_after to mirror changes into your CRM or data warehouse.

curl https://login.prospectb2b.com/api/public/v1/leads?limit=25&updated_after=2026-03-10T00:00:00.000Z \
  -H "Authorization: Bearer pb2b_live_xxxxx_xxxxx"

5. Configure webhook delivery

Webhook endpoint management requires a workspace. The product shows the signing secret once and keeps delivery history in Settings > API.

curl https://login.prospectb2b.com/api/public/v1/webhooks \
  -X POST \
  -H "Authorization: Bearer pb2b_live_xxxxx_xxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: webhook-create-001" \
  -d '{
    "url": "https://example.com/webhooks/prospectb2b",
    "events": ["lead.created", "export.completed"]
  }'

6. Understand request_id, exports and readiness

Every response includes request_id. Export downloads return readiness metadata instead of a streamed object.

  • Persist request_id in logs or error notifications so support can trace the exact request.
  • Treat 409 as an idempotency conflict when a key was reused with a different payload.
  • Treat GET /exports/{export_id}/download as a readiness probe. Poll until download_ready is true.
  • Inspect Settings > API > Webhooks > Deliveries in-app when a webhook sink fails or needs a manual retry.