> ## Documentation Index
> Fetch the complete documentation index at: https://developers.activeprospect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Onboards

Onboards are records that track the buyer connection onboarding process in LeadConduit. When a buyer accepts an invitation to connect with a seller, an onboard record is created to manage and track the setup workflow.

## Overview

The onboarding process involves:

1. **Creating an Onboard** - When a buyer accepts a connection invitation, an onboard record is created with status `created`. Optionally, the UI can send a `flow_id` if already available
2. **In Progress** - The UI sends a PUT with the user's `flow_id` and status `in_progress`
3. **Completing Setup** - The UI must send a PUT with status `completed` to notify the backend that the onboard process is finished. The backend then calls `/onboard/buyer` to finish the flow synchronization

**Note:** The `/onboard/buyer` endpoint can also be called directly by the UI modal when the user has already completed a previous onboard process.

## Onboard Statuses

| Status        | Description                                                               |
| ------------- | ------------------------------------------------------------------------- |
| `created`     | Initial state when the onboard is first created                           |
| `in_progress` | The UI has sent the user's `flow_id`                                      |
| `completed`   | The backend triggers the buyer delivery setup by calling `/onboard/buyer` |
| `failed`      | The setup process encountered an error                                    |

## Buyer Setup Process

The backend automatically triggers the buyer delivery setup when the onboard status is set to `completed`. This process performs:

1. **Connection Validation** - Verifies the connection exists and hasn't already been set up
2. **Seller Flow Discovery** - Finds all seller flows that have a buyer step pointing to this buyer
3. **Buyer Flow Setup** - Creates or updates the buyer's flow to receive leads from the seller
4. **Seller Flow Updates** - Adds the buyer's `flow_id` to the seller's flow mappings
5. **Notifications** - Sends email notifications to seller account users about the new connection
6. **Connection Flagging** - Marks the connection as having buyer delivery configured
