Documentation Index
Fetch the complete documentation index at: https://docs.auditynow.com/llms.txt
Use this file to discover all available pages before exploring further.
What a lead is
A lead in Audity is a survey response from a ReadyLink. When a prospect fills out your survey, a row lands inlead_surveys with their answers, optional web research, and a computed aiReadinessScore.
Each lead has:
- Survey responses (industry, size, pain points, etc.)
- Optional web research (
webResearchStatus, populated by eligible accounts via the web app) - Two scores:
aiReadinessScore(from the survey logic) andcompositeScore(which factors web research in) - A
surveyStatusfield,pending,completed,converted, orarchived
The status vocabulary, two of them
There are two related-but-different status fields. This catches people out:| Field | Where you see it | Values |
|---|---|---|
surveyStatus (on each lead) | Per-row state | pending, completed, converted, archived |
?status= query param | The GET /api/lead-generation/leads filter | active (= pending + completed + converted), archived, all |
?status=active, which returns everything that isn’t archived. To find leads that haven’t been converted yet, filter the response client-side for surveyStatus !== 'converted'.
Recipe 1: Triage the inbox
GET /api/lead-generation/leads?status=active&sortBy=ai_readiness_score&sortOrder=desc&limit=50(response wrapped:{ data: [...], pagination, filters })- The agent filters client-side for
surveyStatus !== 'converted'andcreatedAtwithin the last 14 days - The agent formats the top 10 from the filtered set
since parameter, the date filter is client-side.
Recipe 2: Inspect one lead in depth
GET /api/lead-generation/leads/{id}returns{ lead: LeadDetail }with the full survey response payload and tracking URL metadata- The agent reads
surveyResponses,aiReadinessScore,compositeScore,webResearchStatus, and any tracking URL data - The agent synthesizes a profile
Recipe 3: Convert and audit in one shot
POST /api/lead-generation/leads/{id}/convert, creates a project, deducts 1,000 credits, marks the lead asconverted, dispatches Inngest events. Response:{ success: true, data: { auditId, creditsUsed, pdfAttached } }.- Trigger audit analysis. Use
POST /api/projects/{auditId}/audit-analysisif the client can wait 60–300 seconds. UsePOST /api/agent/projects/{auditId}/audit-analysis/asynconly when the converted project already has current document and interview analyses, then pollGET /api/agent/jobs/{jobId}. - The agent reports
auditIdand the expected completion time.
Recipe 4: Bulk triage and convert
GET /api/user/credits, show available headroomGET /api/lead-generation/leads?status=active&sortBy=composite_score&sortOrder=desc&limit=50- Filter client-side for
compositeScore > 70andsurveyStatus !== 'converted' - Multiply count × 1,000 credits, surface the math
- Wait for explicit approval before any
POST .../convertcalls - After approval, loop through and convert sequentially. If the converted projects already have the prerequisite analyses, use the async audit endpoint for batch analysis so the agent can poll jobs instead of keeping long requests open.
Recipe 5: Stale lead nudge
GET /api/lead-generation/leads?status=active&sortBy=created_at&sortOrder=desc, filters for surveyStatus === 'completed' (not yet converted), age > 7 days, and score > 60, then composes nudge suggestions client-side. You send the actual outreach yourself.
Filtering by ReadyLink
If you want leads from one specific ReadyLink, passstaticSlugId={uuid} in the query. You can copy a slug ID from the web app or fetch your ReadyLinks through the API reference’s ReadyLinks endpoints.
GET /api/agent/readylinks from a PAT-backed agent.
Edge cases
Lead is already converted
Lead is already converted
POST .../convert returns 400 (not 409) on a re-conversion attempt. The agent should check surveyStatus first and skip rather than retry.Insufficient credits
Insufficient credits
POST .../convert returns 402 with an error body when you’re out of credits. Always check GET /api/user/credits before a batch.Partial batch failure
Partial batch failure
The convert endpoint isn’t transactional across leads. If you’re converting 5 leads and the third fails, the first two are converted and the last two never started. The agent should report what succeeded vs. what didn’t.
Web research takes a while
Web research takes a while
Web research happens in the web app, not via the agent API. If the agent surfaces a lead with
webResearchStatus: 'pending' or null, that means a human needs to trigger research from the dashboard.
