v4

latestOpenAPI 3.1.02026-08-03427198448.4 KB
Business Intelligence

Onboarding Bootstrap Jobs

Enqueue the signup-time job chain: BI + voice + add_clients(waits on BI).

This endpoint replaces the React signup flow's prior three-parallel-calls pattern with a single backend call that wires the dependency correctly: add_clients_and_deals_from_google_workspace is gated on business_intelligence_report completing AND writing business_context.

IMPORTANT: This endpoint is for ONBOARDING ONLY. Manual BI refresh elsewhere (POST /api/business-intelligence/report) must NOT enqueue add_clients — that endpoint stays single-job by design.

post/api/onboarding/bootstrap-jobs

Query parameters

user_idstring nullable
org_idstring nullable

Request body

lookback_days_calendarinteger

Days of Google Calendar history to scan for meeting attendees.

lookback_days_inbox_clientinteger

Days of Gmail history to scan for paid-client signals (invoices, payments, contracts).

lookback_days_inbox_leadinteger

Days of Gmail history to scan for active-lead signals (proposals, intros, outreach).

max_recordsinteger

Maximum records to create in a single import run. Hard cap to bound cost and noise.

phase'early' | 'final' nullable

Optional onboarding phase. Omit for the legacy all-jobs behavior; 'early' starts BI + voice while waiting for survey answers; 'final' starts the import after the survey is saved.

Response

Successful Response

bi_job_idstring nullable

business_intelligence_report job ID, if enqueued

voice_profile_job_idstring nullable

voice_profile_refresh job ID, if enqueued

import_job_idstring nullable

add_clients_and_deals_from_google_workspace job ID, if enqueued (waits on bi_job_id)

phase'early' | 'final' nullable

Echoes the requested phase when provided.

import_depends_on_job_idstring nullable

BI job ID used as the dependency for the import job, when applicable.

bi_await_surveyboolean nullable

Current await_survey gate value written to the BI job_input_data, when applicable.

fallback_to_defaultboolean nullable

True when phase='final' fell back to legacy all-jobs enqueue because no BI job existed.