Maintain a per-user blocklist of domains and company names that should be excluded from prospecting.
GET — returns every blocklist entry owned by the caller, newest first.POST — adds one entry ({ domain, name?, reason? }) or many at once ({ entries: [...] }). Domains are normalized server-side: lowercased, protocol and www. stripped.domain and name are upserted on (user_id, domain) — a re-add updates the name.domain only are inserted with ignoreDuplicates: true to preserve any existing name on that domain.name only go through a per-row insert; duplicate name errors are silently skipped, other errors fill failedEntries in the response.blocked differs. Single-add path returns blocked: { ... } (an object). Bulk path returns blocked: [ ... ] (an array). Check Array.isArray before reading.409 only fires on the single path. The bulk path never returns 409 — duplicates are silently skipped or upserted. If you need strict duplicate detection, use the single path.Domain normalization can surprise. https://www.Acme.com/ and acme.com both map to acme.com. Downstream dedup is based on that normalized form, not the input string.No edit-in-place. To change a name or reason, call deleteBlockedCompanyById then re-add.