---
title: "Onboarding Bootstrap Jobs"
method: POST
path: "/api/onboarding/bootstrap-jobs"
tags: ["Business Intelligence"]
---

# Onboarding Bootstrap Jobs

`POST /api/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.

## Query parameters

- `user_id` string, nullable
- `org_id` string, nullable

## Request body

- OnboardingBootstrapJobsRequest
  - `lookback_days_calendar` integer — Days of Google Calendar history to scan for meeting attendees.
  - `lookback_days_inbox_client` integer — Days of Gmail history to scan for paid-client signals (invoices, payments, contracts).
  - `lookback_days_inbox_lead` integer — Days of Gmail history to scan for active-lead signals (proposals, intros, outreach).
  - `max_records` integer — 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 `200`

Successful Response

- PhasedOnboardingBootstrapJobsResponse
  - `bi_job_id` string, nullable — business_intelligence_report job ID, if enqueued
  - `voice_profile_job_id` string, nullable — voice_profile_refresh job ID, if enqueued
  - `import_job_id` string, 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_id` string, nullable — BI job ID used as the dependency for the import job, when applicable.
  - `bi_await_survey` boolean, nullable — Current await_survey gate value written to the BI job_input_data, when applicable.
  - `fallback_to_default` boolean, nullable — True when phase='final' fell back to legacy all-jobs enqueue because no BI job existed.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/every/apis/every-api.md) · [All operations](https://skmtc.net/every/apis/every-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/every/every-api/versions/f8600f7a4ae3/schema)
