Skip to content

Data & Integrations

How the Brand Match App connects to external systems, what it reads and writes, and how data flows through the pipeline.


ca-data Backend

The Brand Match App has no direct database connection. All data is fetched from ca-data (https://ca-data.vercel.app), an internal Next.js API layer that reads from Neon Postgres. The app uses a server-side caDataFetch() helper for all API routes and Server Components.

Authentication: All ca-data requests include a Bearer token from the CA_DATA_TOKEN environment variable.

Caching: All ca-data calls use cache: 'no-store' — data is always fresh.

ca-data Endpoints Used

EndpointWhat the App Uses It For
GET /matchesAll match data, filterable by agent/brand/creator/status/score
GET /match-statsAggregate stats for home dashboard cards
PATCH /matches/:idUpdate pipeline status and notes on a match
GET /brand-intelBrand intelligence for a specific brand
GET /brand-intel/availableUnclaimed brands list with last-contact data
GET /brand-intel/listBrand list for dropdowns/search
GET /profilesCreator profiles (rate, CPM, views, niches, platform)
GET /cross-sellCross-sell recommendations
GET /contractsContract lifecycle data
GET /conflictsCreator conflict detections
GET /brand-emails/:brandLatest email thread + AI summary for a brand
GET /fathom/:brandFathom call history for a brand
GET /non-roster/:brandNon-roster creators sponsored by a brand
POST /claimAssign an unclaimed brand to an agent

Monday.com

Monday.com is the source of truth for deal data and deliverable history. The app reads from Monday indirectly through ca-data, which syncs Monday data to Neon on a schedule.

What comes from Monday:

  • total_deals per brand — COUNT of rows in monday_deliverables
  • avg_rate per brand — AVG of creator_payment in monday_deliverables
  • last_activity_date — most recent deal date per brand (synced every 6h by sync-brand-activity.js)
  • Open deal pipeline on the Creator Dashboard

Deal name normalization: Deal names have renewal/extension/upsell/copy suffixes stripped (e.g. "SoFi Deal (renewal copy)" → "SoFi Deal") before matching to creator names or computing stats.


Close CRM

Close has replaced Copper as the primary CRM. Close contact and lead data is synced daily to the brand_intel Neon table.

Sync script: sync-close-contacts.js (cron: daily 4am UTC)

What syncs per brand:

  • last_contacted_date — most recent outbound email timestamp
  • last_contact_agent — the CA agent who sent it
  • last_contact_subject — email subject line
  • last_contact_summary — AI summary via gpt-4o-mini

Brand intel size: 2,786 brands in brand_intel, including 1,608 imported from Close leads.

API: Close REST API, key at .secrets/close_api_key.txt. Values are in cents (e.g. 4750000 = $47,500).


Airtable (Creators DB)

Creator headshots, niche tags, and contact info come from the Airtable Creators Database. The app reads this data via ca-data's creator sync, which pulls from Airtable on startup and every 2 hours.

Headshot images are served directly from Airtable's CDN via the URL stored in the creator's record. The app shows a placeholder if the headshot fails to load.


Fathom (Call Recordings)

Past sales calls with brands are surfaced on brand detail pages. Data comes from Fathom via per-agent API keys:

AgentKey file
Anniefathom_annie_key.txt
Charliefathom_charlie_key.txt
Henryfathom_henry_key.txt

ca-data syncs Fathom calls on demand via GET /api/fathom-brand. Summaries are stored in the brand_intel table's fathom_calls column.


The conflict_database is populated by a separate sponsor detection pipeline that monitors YouTube channel transcripts for brand mentions. Results are stored in Neon and served via GET /api/conflicts. If a creator in a match is actively working with the brand being pitched (or a direct competitor), a conflict warning badge appears in the UI.


OpenAI

Two features use OpenAI:

FeatureModelTrigger
Pitch email generationgpt-4oAgent clicks Pitch button — POST /api/generate-pitch
Brand email summarygpt-4o-minisync-close-contacts.js — run nightly

The OPENAI_API_KEY env var must be set in the Vercel project for pitch generation to work.


Brand DB (36K+ brands)

A separate dataset of 36,762 known brands (grown from 33,380 by a nightly merge cron at 3am CT). This is used for the category-gaps and agent-blind-spots features — it contains brands that sponsor in our creators' niches but are not CA clients. Separate from the 2,786-brand brand_intel table.


Env Vars

VariableWhat
CA_DATA_URLhttps://ca-data.vercel.app
CA_DATA_TOKENBearer token for ca-data API
OPENAI_API_KEYFor pitch generation