Documentation Index
Fetch the complete documentation index at: https://docs.wellapp.ai/llms.txt
Use this file to discover all available pages before exploring further.
WorkspaceConnectorSyncTarget is the junction table that maps a single WorkspaceConnector to one or more target Workspace rows, enabling multi-workspace sync: one connector can ingest data into N workspaces, not only its own carrier workspace. Each row asserts “this connector must push synced records into this workspace.” The table is soft-deleted (tombstones preserve audit history and allow re-add), and a partial unique index prevents a connector from targeting the same workspace twice while active. Backfill rows (one per legacy connector) were inserted by the creation migration so existing connectors continue to behave identically without code changes.
| Naming | Value |
|---|
| Object | WorkspaceConnectorSyncTarget |
Resource type (JSON:API type) | workspace |
| Collection / records root | — (not a records root) |
| REST base | /v1/workspace-connector-sync-targets |
| Entity class | WorkspaceConnectorSyncTarget |
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.
API operations
| Operation | Method & path | Status |
|---|
| List | GET /v1/workspace-connector-sync-targets | 🟡 Planned |
| Retrieve | GET /v1/workspace-connector-sync-targets/{id} | 🟡 Planned |
| Create | POST /v1/workspace-connector-sync-targets | 🟡 Planned |
| Update | PATCH /v1/workspace-connector-sync-targets/{id} | 🟡 Planned |
| Delete | DELETE /v1/workspace-connector-sync-targets/{id} | 🟡 Planned |
Data model
Attributes
| Field | Type | Required | Constraints | Allowed values | Description |
|---|
| created_at | datetime (TIMESTAMPTZ) 🔒 system | ✅ Yes | NOT NULL; set once on INSERT via MikroORM onCreate hook; never updated | — | Timestamp when the sync-target row was created. Stamped by the ORM onCreate hook; not editable by the user. |
| updated_at | datetime (TIMESTAMPTZ) 🔒 system | ⚪ No | Nullable; set on INSERT and on every UPDATE via MikroORM onUpdate hook | — | Timestamp of the last modification to this row. Managed automatically by the ORM. |
| deleted_at | datetime (TIMESTAMPTZ) 🔒 system | ⚪ No | Nullable; NULL means active; non-NULL means soft-deleted. The partial unique index idx_wcst_unique_active only covers rows WHERE deleted_at IS NULL. | — | Soft-delete sentinel. Set by the service layer when the target is removed (PUT set-semantics diff). NULL = active row. A soft-deleted tombstone does not block a future re-add of the same (connector, workspace) pair. |
Relationships
| Name | Type | Required | Description |
|---|
| workspaceConnector | to-one (ManyToOne) | ✅ Yes | The WorkspaceConnector that sources the sync. FK column: workspace_connector_pk. On DELETE CASCADE at the database level. Indexed via idx_wcst_connector_deleted for hot-path persister lookups. |
| targetWorkspace | to-one (ManyToOne) | ✅ Yes | The Workspace that will receive synced records from the connector. FK column: target_workspace_pk. On DELETE CASCADE at the database level. Indexed via idx_wcst_target_workspace_deleted for reverse-lookup (which connectors push into a given workspace). |
| createdBy | to-one (ManyToOne) | ⚪ No | The People record (authenticated user) who created this sync-target row. FK column: created_by_pk. Nullable by design: backfill rows inserted by the migration carry NULL because there is no human author to credit. On DELETE SET NULL at the database level. Controllers on the API path are required to stamp this from req.user.person_pk. |
System-computed
- pk — auto-increment SERIAL primary key assigned by PostgreSQL on INSERT; never exposed as a public UUID. The formatter surfaces String(row.pk) as the JSON:API
id field because this junction has no dedicated *_id UUID column by design — consumers are expected to reference targets by their (workspace_connector_id, target_workspace_id) tuple.
- created_at — stamped once on INSERT by MikroORM onCreate: () => new Date().
- updated_at — stamped on INSERT and on every subsequent UPDATE by MikroORM onUpdate: () => new Date().
- deleted_at — set to the current timestamp by WorkspaceConnectorSyncTargetService when a target is removed via the PUT set-semantics diff; set to NULL (re-add) when a soft-deleted row is reactivated. Never set by the connector sync pipeline directly.
- Backfill rows — the creation migration (Migration20260527140000) inserts one row per active WorkspaceConnector pointing at its own carrier workspace with created_by_pk = NULL, preserving pre-feature 1:1 behaviour for legacy connectors without any code change.
- Partial unique index idx_wcst_unique_active — enforced by PostgreSQL: UNIQUE (workspace_connector_pk, target_workspace_pk) WHERE deleted_at IS NULL. Guarantees at most one active target per (connector, workspace) pair; soft-deleted tombstones are excluded so a re-add is always safe.
Example
{
"data": {
"type": "workspaceConnectorSyncTarget",
"id": "4182",
"attributes": {
"created_at": "2026-05-27T14:12:33.000Z",
"updated_at": "2026-05-27T14:12:33.000Z"
},
"relationships": {
"workspace_connector": {
"data": {
"type": "workspaceConnector",
"id": "wc_01hwzgq3pk8f0qb3cns7x4ye2t"
}
},
"target_workspace": {
"data": {
"type": "workspace",
"id": "ws_01hwzgq3pk8f0qb3cns7x4ye2t"
}
},
"created_by": {
"data": {
"type": "people",
"id": "ppl_01hwzgq3pk8f0qb3cns7x4ye2t"
}
}
}
}
}
Source: /Users/maximechampoux/platform/apps/api/src/database/entities/WorkspaceConnectorSyncTarget.ts · domain: ingestion · tier: Infrastructure