Skip to main content

Attorney & Firm Tables

The attorney and firm tables form the enrichment data layer. Attorneys are enriched via the Blitz API and firm website scraping. Firms are seeded with 200 AmLaw firms.

Created via Dashboard

The attorneys table was created via the Supabase dashboard, not in migration files. It will not appear in auto-generated types. The TypeScript interface is manually defined in src/lib/attorney-utils.ts.

attorneys

The attorney enrichment table with 76 columns. Each row represents an attorney at a law firm, enriched from LinkedIn data via the Blitz API and (optionally) from firm website scraping.

Identity Fields

ColumnTypeNullableDescription
iduuidNOPrimary key
firm_iduuidYESFK to firms.id
firm_nametextYESFirm name (denormalized)
full_nametextYESFull name
first_nametextYESFirst name
last_nametextYESLast name

Position Fields

ColumnTypeNullableDescription
job_titletextYESCurrent job title
senioritytextYESDerived seniority level (see values below)
job_descriptiontextYESJob description from LinkedIn
job_start_datetextYESStart date of current position

Seniority values: partner, counsel, senior_associate, associate, other

Column Name

The column is seniority, NOT seniority_level. This is a common source of bugs.

LinkedIn Fields

ColumnTypeNullableDescription
linkedin_urltextYESLinkedIn profile URL (unique constraint)
linkedin_headlinetextYESLinkedIn headline
linkedin_abouttextYESLinkedIn about section
linkedin_connectionsintegerYESNumber of LinkedIn connections
linkedin_work_historyjsonbYESFull work history from LinkedIn

Location Fields

ColumnTypeNullableDescription
citytextYESCity
statetextYESState
countrytextYESCountry
country_codetextYESCountry code (e.g., US)
office_nametextYESOffice location name

Contact Fields

ColumnTypeNullableDescription
email_primarytextYESPrimary email address
email_statustextYESEmail validation status
email_worktextYESWork email
email_alljsonbYESAll known email addresses
phone_mobiletextYESMobile phone number
phone_mobile_foundbooleanYESWhether mobile was found during enrichment

email_status values: valid, invalid, catch_all, unknown

No "unverified" Status

The email_status column only accepts valid, invalid, catch_all, or unknown. The value "unverified" is not valid and will cause insert errors.

Education Fields

ColumnTypeNullableDescription
law_schooltextYESLaw school name
law_school_yeartextYESLaw school graduation year
law_school_degreetextYESLaw degree (e.g., JD)
law_school_honorstextYESHonors (requires website scraping)
undergrad_schooltextYESUndergraduate institution
undergrad_yeartextYESUndergrad graduation year
undergrad_degreetextYESUndergrad degree
undergrad_majortextYESUndergrad major (requires website scraping)
other_educationjsonbYESOther education entries

Career Fields

ColumnTypeNullableDescription
years_experienceintegerYESCalculated years of experience
prior_firmsjsonbYESList of prior firms from work history

Enrichment Tracking

ColumnTypeNullableDescription
enrichment_statustextYESCurrent enrichment state
enrichment_leveltextYESHow complete the enrichment is
credits_usedintegerYESTotal Blitz API credits consumed
enriched_attimestamptzYESLast enrichment timestamp
source_waterfalltextYESEnrichment source chain
source_persontextYESSource for person data
source_emailtextYESSource for email data
source_phonetextYESSource for phone data
source_websitetextYESSource for website-scraped data
is_activebooleanYESWhether attorney is currently active

Website Scraping Fields (34 columns)

These fields are populated by firm website scraping, not the Blitz API:

ColumnTypeNullableDescription
practicetextYESPrimary practice area
practice_secondarytextYESSecondary practice area
practice_specialtiesjsonbYESSpecific specialties
client_typesjsonbYESTypes of clients served
representative_mattersjsonbYESNotable matters/cases
bar_admissionsjsonbYESBar admissions list
bar_court_admissionsjsonbYESCourt admissions list
rankingsjsonbYESIndustry rankings (Chambers, etc.)
awardsjsonbYESAwards and recognitions
is_rankedbooleanYESWhether attorney has any ranking
has_publicationsbooleanYESWhether attorney has publications
publications_countintegerYESNumber of publications
phone_officetextYESOffice phone number
firm_website_profiletextYESURL to attorney's firm bio page
languagesjsonbYESLanguages spoken
icp_scorenumericYESICP match score
icp_rankingtextYESICP tier ranking
icp_what_matchedjsonbYESWhich ICP criteria matched
is_verifiedbooleanYESManual verification flag
is_prioritybooleanYESPriority flag for outreach
notestextYESFree-text notes
tagsjsonbYESCustom tags
website_scraped_attimestamptzYESLast website scrape timestamp
email_validated_attimestamptzYESLast email validation timestamp
firm_domaintextYESFirm's domain (e.g., kirkland.com)
firm_linkedin_urltextYESFirm's LinkedIn company page URL
created_attimestamptzYES
updated_attimestamptzYES

Enrichment Data Flow


firms

Law firm database. Seeded with 200 AmLaw firms via migration 20260206_seed_amlaw_firms.sql.

ColumnTypeNullableDescription
iduuidNOPrimary key
nametextNOFull firm name
short_nametextYESAbbreviated name
linkedin_urltextYESLinkedIn company page URL
domaintextYESPrimary domain (e.g., kirkland.com)
websitetextYESFull website URL
amlaw_rankintegerYESAmLaw ranking number
tiertextYESTier classification
attorney_countintegerYESTotal attorney count
partner_countintegerYESNumber of partners
associate_countintegerYESNumber of associates
office_countintegerYESNumber of offices
hq_citytextYESHeadquarters city
hq_statetextYESHeadquarters state
hq_countrytextYESHeadquarters country
office_citiesjsonbYESList of office cities
profile_url_patterntextYESURL pattern for attorney bio pages
enrichment_statustextYESEnrichment state
last_enriched_attimestamptzYESLast enrichment timestamp
rankintegerYESGeneral rank field
descriptiontextYESFirm description
logo_urltextYESLogo image URL
created_attimestamptzYES
updated_attimestamptzYES

Tier Values

TierDescriptionCount
amlaw_10Top 10 AmLaw firms10
amlaw_25AmLaw 11-2515
amlaw_50AmLaw 26-5025
amlaw_100AmLaw 51-10050
amlaw_200AmLaw 101-200100

Profile URL Patterns

The profile_url_pattern column stores the detected URL template for finding attorney bio pages on the firm's website. These are detected by scripts/detect-profile-patterns.ts.

Common patterns:

FirmPattern
Most firms/people/{first}-{last}
Kirkland & Ellis/lawyers/{last_initial}/{last}-{first}
Gibson Dunn/lawyers/{last}
Latham & Watkins/people/{last}
Cleary Gottlieb/professionals/{first}-{last}
WilmerHale/bio/{first}-{last}

Pattern variables: {first}, {last}, {first_initial}, {last_initial}, {full} (first-last).

Entity Relationships