# Follow Up Boss

> Send new Follow Up Boss people to CallView, and log the call's outcome back on the person.

This follows the three moves in [How every recipe works](https://developers.callview.ai/recipes/). Follow Up Boss works best with a small receiver of your own in the middle, because its own automations don't send custom HTTP requests. Zapier or Make can stand in if you'd rather not run code.

## Send new people

1. In Follow Up Boss, register a webhook for the `peopleCreated` event (through its API). It sends the new person's ID to your receiver.
2. Your receiver fetches the person from Follow Up Boss's API, then sends the lead to CallView:

```js
// In your receiver, after you've fetched the person from Follow Up Boss:
await fetch('https://v2-api.callview.ai/api/v1/external/leads', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLVIEW_SECRET}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': `fub-${person.id}-create`,
  },
  body: JSON.stringify({
    campaign_id: '7c1f2b9e-4a3d-4e8f-9b21-5d6a7e8f9a01',
    external_id: `fub-${person.id}`,
    phone: person.phones?.[0]?.value,
    name: person.name,
    email: person.emails?.[0]?.value,
    fields: { source: person.source ?? '' },
    consent: { source: 'crm', agreed_at: person.created, text: 'Opted in on the lead form' },
    call_now: true,
  }),
});
```

Change the consent to match how your leads really agree to be called.

## Log the outcome

1. Point a CallView webhook endpoint at your receiver, with `"events": ["call.completed", "lead.opted_out"]`. [Check the signature](https://developers.callview.ai/guides/webhooks/#check-the-signature) on every delivery.
2. On `call.completed`, take the person's ID from `data.object.lead.external_id` (minus `fub-`) and use Follow Up Boss's API to:
   - add a note with `data.object.note` and who took the call (`data.object.handled_by.name`),
   - set a stage or a tag from `data.object.outcome` (for example `interested` moves them to "Hot"),
   - create a task for `data.object.callback_at` when the outcome is `callback`.
3. On `lead.opted_out`, mark the person do-not-call in Follow Up Boss as well.
