X Enterprises
fastify-xwhatconverts

leads.list

List WhatConverts leads with optional filtering by type, status, date range, and account.

leads.list

List leads with optional filters. Returns a paginated result from the WhatConverts API.

Signature

fastify.xWhatConverts.leads.list(params?: {
  leadsPerPage?: number;
  pageNumber?: number;
  accountId?: string;
  profileId?: string;
  leadType?: "phone_call" | "form" | "chat" | "transaction";
  leadStatus?: "unique" | "repeat";
  startDate?: string;
  endDate?: string;
  order?: "asc" | "desc";
  quotable?: boolean;
  spam?: boolean;
  duplicate?: boolean;
}): Promise<object>

Params

NameTypeRequiredDescription
leadsPerPagenumberNoResults per page. Default 25, max 250.
pageNumbernumberNoPage number for pagination.
accountIdstringNoFilter by account ID.
profileIdstringNoFilter by profile ID.
leadTypestringNoFilter by type: phone_call, form, chat, transaction.
leadStatusstringNoFilter by status: unique or repeat.
startDatestringNoStart date in YYYY-MM-DD format.
endDatestringNoEnd date in YYYY-MM-DD format.
orderstringNoSort order: asc or desc.
quotablebooleanNoFilter by quotable status.
spambooleanNoFilter by spam status.
duplicatebooleanNoFilter by duplicate status.

Returns

A paginated WhatConverts leads response object containing a leads array and pagination metadata.

Throws

  • [xWhatConverts] Network error: <message> — network-level failure.
  • [xWhatConverts] API error: <status> — non-2xx HTTP response from WhatConverts.

Examples

Basic — list all leads

const result = await fastify.xWhatConverts.leads.list();
console.log(result.leads); // array of lead objects

Realistic — paginate phone call leads by date range

fastify.get("/leads", async (request) => {
  const { page = 1, startDate, endDate } = request.query;

  const result = await fastify.xWhatConverts.leads.list({
    leadType: "phone_call",
    leadStatus: "unique",
    startDate,
    endDate,
    pageNumber: page,
    leadsPerPage: 100,
    order: "desc",
  });

  return {
    leads: result.leads,
    total: result.total_leads,
    page: result.page_number,
  };
});

See Also

AI Context

package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xWhatConverts.leads.list(params?)
use-when: List WhatConverts leads with optional filters — lead type, status, date range, account/profile, pagination
params: leadsPerPage (number, default 25, max 250), pageNumber, accountId, profileId, leadType (phone_call|form|chat|transaction), leadStatus (unique|repeat), startDate (YYYY-MM-DD), endDate (YYYY-MM-DD), order (asc|desc), quotable, spam, duplicate
returns: paginated WhatConverts response object with a leads array and pagination metadata
Copyright © 2026