Skip to main content
All requests use a single endpoint: POST https://api.helpgenie.ai/v1 with resource: "leads".

Access control

Regular users can only access leads from agents they own. Internal admins can access all leads using adminMode: true and optionally scope to a specific user with userId.

Get lead statistics

Retrieves aggregated statistics about leads, including total count and breakdown by status. Aggregation happens at the database level for optimal performance.
string
required
Must be "leads"
string
required
Must be "stats"
object

Response

boolean
object
Leads with a null status or a status outside the four standard values are not counted in any by_status category but are included in total.

List all leads

Retrieves all leads with full field details and relations.
string
required
Must be "leads"
string
required
Must be "all"
object

Response

boolean
object

List leads (summary)

Retrieves leads with basic fields only, optimized for table views. Accepts the same parameters as all.
string
required
Must be "leads"
string
required
Must be "list"
object
Same parameters as all (filters, pagination, admin options).

Response

Same response structure as all, but each lead contains only summary fields:
object

Get a lead

Retrieves a specific lead by ID with all fields and relations.
string
required
Must be "leads"
string
required
Must be "get"
string | number
required
The lead ID.

Response

boolean
object

Create a lead

Creates a new lead associated with an agent.
string
required
Must be "leads"
string
required
Must be "create"
object
required

Response (status 201)

boolean
object
The user_id on the created lead is resolved in this order: (1) provided user_id parameter, (2) agent’s owning user, (3) current authenticated user.

Update a lead

Updates an existing lead. This is a partial update — only include the fields you want to change.
string
required
Must be "leads"
string
required
Must be "update"
string | number
required
The lead ID.
object
required
Any combination of lead fields. All fields except id and created_at can be updated. See the create action for the full list of fields.

Response

boolean
object

Delete a lead

Permanently deletes a lead. This is a hard delete with no recovery.
string
required
Must be "leads"
string
required
Must be "delete"
string | number
required
The lead ID.

Response

boolean
object
This permanently deletes the lead. The user must have access to the lead’s agent.

Log lead activity

Records an activity entry against a lead. Used to track interactions like calls, emails, and status changes.
string
required
Must be "leads"
string
required
Must be "log"
string | number
required
The lead ID.
object
required
Activity fields to record. Common fields include type, description, metadata. The data is inserted into the lead_activities table.
boolean
object
The created activity record.

Get lead activity logs

Retrieves the activity history for a specific lead, ordered by most recent first.
string
required
Must be "leads"
string
required
Must be "getLogs"
string | number
required
The lead ID.
object
boolean
array
Array of activity records for this lead.

Lead object

The full lead object returned by all, get, create, and update actions.
number
string
string
string | null
string | null
string | null
string | null
string | null
string | null
string | null
object | null
string | null
string | null
number | null
number | null
boolean | null
string | null
string | null
object | null
string
string | null
object

Enum values reference

status

priority

preferred_contact_method


Filtering reference

All list-style actions (stats, all, list) accept a filters object with the following fields:

Admin operations

Admin operations require the internal_admin role. Regular users receive a 403 Forbidden response.

View all leads across all users

View a specific user’s leads

Create a lead as another user


Error responses