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.
DocumentWorkspaceConnector is a junction table that records the relationship between a Document and the WorkspaceConnector responsible for ingesting or distributing it. Each row captures which connector handled a given document, in which direction (input = ingested from a source, output = routed to a destination), and when the link was created. It is the provenance ledger for the document sync pipeline: every document that enters or leaves Well through a connector has at least one DWC row, and the table is the primary surface queried during sync-status range checks (filtered by workspace_connector_pk + created_at BETWEEN). The entity carries no public UUID key — it is an internal infrastructure join record, not a user-facing resource.
| Naming | Value |
|---|
| Object | DocumentWorkspaceConnector |
Resource type (JSON:API type) | document_workspace_connector |
| Collection / records root | — (not a records root) |
| REST base | /v1/document-workspace-connectors |
| Entity class | DocumentWorkspaceConnector |
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/document-workspace-connectors | 🟡 Planned |
| Retrieve | GET /v1/document-workspace-connectors/{id} | 🟡 Planned |
| Create | POST /v1/document-workspace-connectors | 🟡 Planned |
| Update | PATCH /v1/document-workspace-connectors/{id} | 🟡 Planned |
| Delete | DELETE /v1/document-workspace-connectors/{id} | 🟡 Planned |
Data model
Attributes
| Field | Type | Required | Constraints | Allowed values | Description |
|---|
| direction | string (native enum: direction_enum) | ✅ Yes | NOT NULL; stored as PostgreSQL native enum core_api.direction_enum | ’input’ | ‘output’ | Flow direction of the document through the connector. ‘input’ means the connector ingested the document into Well (source connector). ‘output’ means Well routed the document outward through the connector (destination connector). |
| created_at | 🔒 system — timestamptz | ✅ Yes | NOT NULL; set by onCreate: () => new Date() | — | Timestamp when the DWC link was created. Set once via onCreate hook; also set explicitly by DocumentWorkspaceConnectorService. Used as the right-hand operand in sync-status range queries (indexed via idx_dwc_wc_created_at and idx_dwc_input_active_doc_created). |
| updated_at | 🔒 system — timestamptz | ⚪ No | NULLABLE | — | Timestamp of the last mutation. Set by onCreate and onUpdate hooks; also set explicitly by the service methods. |
| deleted_at | 🔒 system — timestamptz | ⚪ No | NULLABLE | — | Soft-delete timestamp. NULL means the link is active. Set by application code; never populated by the normal create/stage paths. |
Relationships
| Name | Type | Required | Description |
|---|
| document | to-one (ManyToOne) | ✅ Yes | The Document this connector link is associated with. Foreign key references core_api.documents(pk) ON UPDATE CASCADE. Indexed as the leading column of idx_dwc_input_active_doc_created (document_pk, created_at) for document-first access patterns. |
| workspaceConnector | to-one (ManyToOne) | ✅ Yes | The WorkspaceConnector (activated connector instance for a workspace) that ingested or distributed this document. Foreign key references core_api.workspace_connectors(pk) ON UPDATE CASCADE. Indexed as the leading column of idx_dwc_wc_created_at (workspace_connector_pk, created_at) for sync-status range queries. |
System-computed
- created_at — set once by onCreate: () => new Date(); also set explicitly to new Date() by DocumentWorkspaceConnectorService.createDocumentWorkspaceConnector() and .stage()
- updated_at — set by onCreate and onUpdate hooks; also set explicitly by the service methods
- deleted_at — soft-delete sentinel; NULL on creation; not written by the pipeline’s normal create/stage paths
- pk — auto-increment serial primary key assigned by Postgres; internal join target only, never exposed in the public API
- No public UUID (*_id) column — this is a pure infrastructure junction record with no user-facing stable identifier beyond pk
Example
{
"data": {
"type": "document_workspace_connector",
"attributes": {
"direction": "input",
"created_at": "2026-01-15T09:23:11.000Z",
"updated_at": "2026-01-15T09:23:11.000Z",
"deleted_at": null
},
"relationships": {
"document": {
"data": { "type": "document", "id": "e3f1a2b4-cc90-4d5e-b8f7-123456789abc" }
},
"workspace_connector": {
"data": { "type": "workspace_connector", "id": "a9b2c3d4-1111-2222-3333-abcdef012345" }
}
}
}
}
Source: apps/api/src/database/entities/DocumentWorkspaceConnector.ts · domain: ingestion · tier: Infrastructure