core_api.web_links) is an atomic contact-channel record that stores a URL together with its social/web platform classification. WebLinks are shared, reusable objects attached to both Companies and People through the company_web_links and person_web_links bridge tables, following the same pivot-entity pattern as emails and phones. The entity holds a nullable workspace FK added in Migration20260119180000 to scope enrichment-created links. It is a Supporting root in the records layer, surfaced in composite composite_web_links_list columns on company and person pages.
| Naming | Value |
|---|---|
| Object | Web Link |
Resource type (JSON:API type) | web_link |
| Collection / records root | web_links |
| REST base | /v1/web-links |
| Entity class | WebLink |
API operations
| Operation | Method & path | Status |
|---|---|---|
| List | GET /v1/web-links | ✅ Implemented |
| List (nested) | GET /v1/people/{id}/web-links | ✅ Implemented |
| Retrieve | GET /v1/web-links/{id} | ✅ Implemented |
| Create (nested) | POST /v1/people/{id}/web-links | ✅ Implemented |
| Update | PATCH /v1/web-links/{id} | 🟡 Planned |
| Delete (nested) | DELETE /v1/people/{id}/web-links/{subId} | ✅ Implemented |
Data model
Attributes
| Field | Type | Required | Constraints | Allowed values | Description |
|---|---|---|---|---|---|
| social_link_id | string, UUID, 🔒 system | ✅ Yes | unique; default gen_random_uuid() | — | Public stable identifier for the web link, safe to expose in API responses. Generated by the database on insert. |
| platform | string (PlatformEnum) | ✅ Yes | native PostgreSQL enum core_api.platform_enum; original values twitter/linkedin/github created in Migration20250801141316; instagram/facebook/website/other added via ALTER TYPE … ADD VALUE IF NOT EXISTS in Migration20260119180000 | twitter, linkedin, github, instagram, facebook, website, other | The social network or web platform the URL belongs to. Drives icon and renderer selection in the composite_web_links_list cell. |
| url | string | ✅ Yes | varchar(255); NOT NULL; no uniqueness constraint (same URL may appear on multiple entities) | — | The fully-qualified URL of the web presence (profile page, website, repository, etc.). |
| created_at | string (ISO 8601 datetime), 🔒 system | ✅ Yes | timestamptz; set by onCreate lifecycle hook; never null | — | Timestamp when the web link record was first persisted. |
| updated_at | string (ISO 8601 datetime), 🔒 system | ⚪ No | timestamptz; nullable; set by onCreate and onUpdate lifecycle hooks | — | Timestamp of the last update. Null if the record has never been modified after creation. |
| deleted_at | string (ISO 8601 datetime), 🔒 system | ⚪ No | timestamptz; nullable | — | Soft-delete timestamp. When set, the web link is excluded from all active queries. Hard deletes do not occur on this entity. |
Relationships
| Name | Type | Required | Description |
|---|---|---|---|
| workspace | to-one (workspace) | ⚪ No | The workspace that owns this web link. Added in Migration20260119180000 to scope enrichment-created links; nullable because web links pre-dating that migration have no workspace assignment. ON DELETE SET NULL. |
System-computed
- social_link_id is generated by gen_random_uuid() at the database level on INSERT; the application never supplies it.
- created_at is set by the MikroORM onCreate lifecycle hook (new Date()); never written by application code.
- updated_at is set by both onCreate and onUpdate lifecycle hooks; it may be null on records that have never been modified.
- deleted_at is set to a non-null timestamp on soft delete; active queries must always filter deleted_at: null. No hard-delete path exists on this entity.
- workspace_pk (FK) was added as nullable in Migration20260119180000; records created before that migration have workspace = null. Enrichment pipelines may create web links with a workspace scope; connector-synced links may have workspace = null.
- PlatformEnum values instagram, facebook, website, and other were added to the native PostgreSQL enum in Migration20260119180000 via ALTER TYPE … ADD VALUE IF NOT EXISTS. The original enum (twitter, linkedin, github) was created in Migration20250801141316.
- The web_links table was created in Migration20250919154301, migrated from a legacy social_links table. The social_link_id public UUID field preserves backward-compatible identity across that rename.
Example
apps/api/src/database/entities/WebLink.ts · domain: financial-graph · tier: Supporting