How do I read/get leads via API?

Modified on Wed, 6 May at 7:02 AM

How do I read/get leads via API?

Pull lead data from Hubhus into any external CRM, ERP, BI tool, or automation platform using the Hubhus REST API.

TL;DR

GET https://api.leadvalidator.dk/v2/campaigns/{id}/leads with Authorization: Bearer {token}. Filter with query params: status=contacted, updated_after=2025-01-01, source=partner-west. Paginate with ?page=2. Use updated_after for incremental sync.

4 things to know

1

Basic GET request

You need your API token and campaign ID (visible in the URL: campaigns/362/... → id = 362).

GET https://api.leadvalidator.dk/v2/campaigns/362/leads
Authorization: Bearer 123456789abcdef
2

Filtering with query parameters

All filters use AND logic. Select field values use their slug, not label.

?status=contacted
?created_after=2025-01-01
?updated_after=2025-02-01
?customer-type=commercial
?status=new&source=partner-north
3

Pagination

Results are paginated. The response includes pagination.total_pages. Fetch additional pages with ?page=2 or increase page size:

GET /campaigns/362/leads?page=2&per_page=100
4

Best practices

Use updated_after for incremental sync instead of full fetches. Use campaign-scoped tokens for external vendors. Read slugs from live API documentation — never hardcode manually. Implement retry/backoff for large pulls. Log API errors — they explain exactly what failed.

Read more — response format and advanced filters

Pagination response structure

{
  "data": [...],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total": 143,
    "total_pages": 3
  }
}

Loop through pages until page = total_pages.

Practical examples

Incremental sync — updated in last 24 hours

GET /campaigns/362/leads?updated_after=2025-02-21T00:00:00Z

All "new" leads from a specific partner

GET /campaigns/362/leads?status=new&source=partner-north

Page 3 with 100 leads per page

GET /campaigns/362/leads?page=3&per_page=100

Official API resources

Always use the live API documentation for the current field list — the exact structure depends on your campaign schema.

Common searches

get leads api • read leads api • api GET request • api integration • fetch leads programmatically

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article