URL: /code/how-it-works · Id: `page:/code/how-it-works`

# How SalesBuilder is built

> Six layers, from who you reach to what you try next, on three base records: each calls only the layers below it.

Six layers sit on three base records. A layer calls only the layers below it, and [Events](https://startupbuilder.dev/business/nouns/event) flow up.

```text title="One call per layer · Ask"
Show me one call from each layer for our first cold email, as a dry run.
```

```ts title="One call per layer · SDK"
import { $ } from 'startup-builder'
const sb = $.with({ namespace: 'leaseline.app' })

await sb.Contact.enrich({ contact: 'contact_22' }, { mode: 'try' })   // Lists: who it goes to
await sb.Message.schedule({ message: 'message_3', at: '2026-11-03T14:00:00Z' }, { mode: 'try' })   // Sending: from dana@leaseline.app
await sb.Contact.enroll({ contact: 'contact_22', sequence: 'founder-thread' }, { mode: 'try' })   // Sequences: follow-ups that stop when they reply
const { task } = await sb.Task.next()   // Team: your SDR agent’s next Task
return await sb.PlayMix.compile({ startup: 'leaseline.app' }, { mode: 'try' })   // Plays: what to try next
```

```json title="One call per layer · Response · sample"
{
  "$id": "https://api.sb/leaseline.app/play-mixes/play-mix_1",
  "$type": "PlayMix",
  "customers": 0,
  "hours": 3,
  "budget": 0,
  "plays": [
    {
      "play": "warm-intros",
      "rank": 1
    },
    {
      "play": "cold-email",
      "rank": 2
    },
    {
      "play": "signup-interviews",
      "rank": 3
    }
  ]
}
```

A layer calls only the layers below it, and Events flow up: a Sequence never calls a Play, it emits an Event that a Play hears.

## Lists
| It answers | Its files | Its calls | Not live yet |
| --- | --- | --- | --- |
| Who you sell to | `audiences/` | <Op verb="Contact.enrich" />, <Op verb="Contact.merge" />, <Op verb="Visitor.identify" />, <Op verb="Lead.qualify" />, <Op verb="Lead.assign" />, <Op verb="Contact.suppress" /> | `Organization.enrich` (Not live yet, gaps #2), `Contact.import` (Not live yet, gaps #2), `Prospect.find` (Not live yet, gaps #2) |

| Pages in this layer |
| --- |
| [Find your first customers](/capabilities/find-customers) |

## Content
| It answers | Its files | Its calls | Not live yet |
| --- | --- | --- | --- |
| What you say | `content/` | <Op verb="Content.draft" />, <Op verb="Content.publish" />, <Op verb="Post.publish" />, <Op verb="Video.draft" />, <Op verb="Keyword.measure" />, <Op verb="Review.publish" /> | `Content.refresh` (Not live yet, gaps #2), `Content.withdraw` (Not live yet, gaps #2) |

| Pages in this layer |
| --- |
| [Research demand](/capabilities/research-demand), [Check AI answers](/capabilities/check-ai-answers), [Size up competitors](/capabilities/size-up-competitors), [Make content](/capabilities/make-content), [Publish and post](/capabilities/publish-and-post), [Get indexed](/capabilities/get-indexed), [Earn first links](/capabilities/earn-first-links), [Directory submissions](/capabilities/earn-first-links/directory-submissions), [Launch circuit](/capabilities/earn-first-links/launch-circuit), [Run ads](/capabilities/run-ads), [Measure](/capabilities/measure) |

## Sending
| It answers | Its files | Its calls | Not live yet |
| --- | --- | --- | --- |
| Where it runs | `systems/`, `domains/` | <Op verb="Domain.authenticate" />, <Op verb="Mailbox.warm" />, <Op verb="Handle.connect" />, <Op verb="Message.schedule" />, <Op verb="Message.broadcast" />, <Op verb="Post.schedule" /> | mail and gifts |

| Pages in this layer |
| --- |
| [Reach out](/capabilities/reach-out), [Instant response](/revenue/instant-response), [Replies and routing](/revenue/replies-and-routing), [Signup flows](/revenue/signup-flows), [Meetings](/revenue/meetings), [Sequences](/revenue/sequences), [When to reach out](/revenue/when-to-reach-out), [Work old leads](/revenue/work-old-leads) |

## Sequences
| It answers | Its files | Its calls | Not live yet |
| --- | --- | --- | --- |
| When it happens | `sequences/`, `funnels/`, `workflows/` | <Op verb="Contact.enroll" />, <Op verb="Enrollment.pause" />, <Op verb="Lead.nurture" />, <Op verb="Meeting.book" />, <Op verb="Deal.advance" />, <Op verb="Renewal.open" /> | `Referral.invite` (Not live yet, gaps #3) |

| Pages in this layer |
| --- |
| [Offers and trials](/revenue/offers), [Quotes and discount approval](/revenue/quotes), [Open Deals](/revenue/deals), [Onboarding](/revenue/onboarding), [Open](/revenue/deals/status/open), [Qualified](/revenue/deals/status/qualified), [Proposed](/revenue/deals/status/proposed), [Won](/revenue/deals/status/won), [Lost](/revenue/deals/status/lost), [Who might cancel](/revenue/health), [When someone cancels](/revenue/cancel-and-save), [Failed payments](/revenue/failed-payments), [Win-back](/revenue/win-back), [Renewals](/revenue/renewals), [More seats and upgrades](/revenue/upgrades-and-seats), [What they tell you](/revenue/what-they-tell-you), [Reviews, references and referrals](/revenue/reviews-references-referrals) |

## Team
| It answers | Its files | Its calls | Not live yet |
| --- | --- | --- | --- |
| Who does it | `agents/` | <Op verb="Role.staff" />, <Op verb="Mandate.authorize" />, <Op verb="Approval.approve" />, <Op verb="Task.next" />, <Op verb="Action.redirect" />, <Op verb="Action.evaluate" /> | round-robin across agents |

| Pages in this layer |
| --- |
| [How your agents act](/capabilities/how-your-agents-act) |

## Plays
| It answers | Its files | Its calls | Not live yet |
| --- | --- | --- | --- |
| What to try next | `plays/` | <Op verb="PlayMix.compile" />, <Op verb="Experiment.start" />, <Op verb="Experiment.conclude" />, <Op verb="Process.pause" /> | `Campaign.start` (Not live yet, gaps #2), `Campaign.pause` (Not live yet, gaps #2) |

| Pages in this layer |
| --- |
| [Plays](/plays), [Agent legibility](/plays/agent-legibility), [Answer engine optimization](/plays/aeo), [Category kit](/plays/category-kit), [Community answers](/plays/community-answers), [Data stories](/plays/data-stories), [Editorial SEO](/plays/editorial-seo), [Guest circuit](/plays/guest-circuit), [Integration partners](/plays/integration-partners), [Launch sites](/plays/launch-sites), [Launch week](/plays/launch-week), [Paid search](/plays/paid-search), [Paid social](/plays/paid-social), [Programmatic SEO](/plays/programmatic-seo), [Review requests](/plays/review-requests), [Sponsorships](/plays/sponsorships), [Tools on request](/plays/request-desk), [Account ads](/plays/account-ads), [Account visits](/plays/account-visits), [Agent registries](/plays/agent-registries), [Archive repurposing](/plays/archive-repurposing), [Benchmark rows](/plays/benchmark-rows), [Build in public](/plays/build-in-public), [Buying committee](/plays/buying-committee), [Cold email](/plays/cold-email), [Creator ads](/plays/creator-ads), [Creator probe](/plays/creator-probe), [Creator retainers](/plays/creator-retainers), [Directory listings](/plays/directory-listings), [Engagement bridge](/plays/engagement-bridge), [Events and webinars](/plays/events-and-webinars), [Field presence](/plays/field-presence), [Founder voice](/plays/founder-voice), [Free tools](/plays/free-tools), [Gifting](/plays/gifting), [Give before you ask](/plays/give-first), [Hosted gatherings](/plays/gatherings), [Instant response](/plays/instant-response), [Lead reactivation](/plays/lead-reactivation), [LinkedIn outbound](/plays/linkedin-outbound), [Made-with line](/plays/made-with), [Marketplace listings](/plays/marketplace-listings), [Moment outreach](/plays/moment-outreach), [Organic social](/plays/organic-social), [Outbound calling](/plays/outbound-calling), [Owned community](/plays/owned-community), [Owned newsletter](/plays/owned-newsletter), [Positioning tournament](/plays/positioning-tournament), [Product signals](/plays/product-signals), [Promote winners](/plays/promote-winners), [Proof-of-work outreach](/plays/proof-of-work-outreach), [Retargeting](/plays/retargeting), [Video ladder](/plays/video-ladder), [Warm intros](/plays/warm-intros), [Agent-to-agent selling](/plays/agent-to-agent), [Closer handoff](/plays/closer-handoff), [Data residency](/plays/data-residency), [Deposits before you build](/plays/reserve-drop), [Developer relations](/plays/developer-relations), [Lead nurture](/plays/lead-nurture), [Open source](/plays/open-source), [Paid pilot](/plays/paid-pilot), [Product-led growth](/plays/product-led), [Risk-reversal offers](/plays/risk-reversal-offers), [Switch kit](/plays/switch-kit), [Trust pack](/plays/trust-pack), [Waitlist interviews](/plays/signup-interviews), [Written references](/plays/written-references), [Annual prepay](/plays/annual-prepay), [Next order due](/plays/next-outcome), [Objection watch](/plays/objection-watch), [Run it beside the old tool](/plays/run-beside), [Signal expansion](/plays/signal-expansion), [Single sign-on upgrade](/plays/sso-rung), [Usage upsell](/plays/usage-upsell), [Category hubs](/plays/category-hubs), [Champion follow](/plays/champion-follow), [Commission partners](/plays/commission-partners), [Creator partnership](/plays/creator-partnership), [Customer referrals](/plays/customer-referrals), [Family opt-in](/plays/family-opt-in), [House ads](/plays/house-ads), [Portfolio cross-sell](/plays/cross-sell), [Sibling audiences](/plays/sibling-audiences) |

## The base
| The base | Its files | Its calls | Where it lives |
| --- | --- | --- | --- |
| What you sell | `offers/` | <Op verb="Offer.publish" />, <Op verb="Offer.trial" />, <Op verb="Order.place" />, <Op verb="Quote.send" /> | [Offers and trials](/revenue/offers) |
| Who has paid | the Customer records | <Op verb="Customer.activate" />, <Op verb="Subscription.keep" />, <Op verb="Subscription.resize" />, <Op verb="Invoice.collect" /> | [Customers](/revenue) |
| How you score | `metrics/` | <Op verb="Metric.define" />, <Op verb="Metric.query" />, <Op verb="Metric.watch" /> | [Revenue](/revenue) |