WorkspaceProvider

WorkspaceProvider is the join table that records which global Provider entries a specific workspace has explicitly selected and/or was auto-matched to, acting as the per-tenant provider bookmark layer. Each row links exactly one Workspace to one Provider and carries two boolean flags โ€” is_selected (user explicitly added the provider via the API) and is_matched (system or explicit selection confirmed the relevance). The entity is owned by the WorkspaceProviderService, which upserts rows on explicit selection and soft-deletes them on removal. It is the authority for GET /v1/workspaces/:id/providers catalog responses and is read by the Vision Agent to resolve per-workspace provider scope.

NamingValue
ObjectWorkspaceProvider
Resource type (JSON:API type)workspace_provider
Collection / records rootโ€” (not a records root)
REST base/v1/workspace-providers
Entity classWorkspaceProvider

Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

OperationMethod & pathStatus
ListGET /v1/workspace-providers๐ŸŸก Planned
RetrieveGET /v1/workspace-providers/{id}๐ŸŸก Planned
CreatePOST /v1/workspace-providers๐ŸŸก Planned
UpdatePATCH /v1/workspace-providers/{id}๐ŸŸก Planned
DeleteDELETE /v1/workspace-providers/{id}๐ŸŸก Planned

Data model

Attributes

FieldTypeRequiredConstraintsAllowed valuesDescription
is_selectedbooleanโšช NoDEFAULT falsetrue, falseWhether the workspace has explicitly selected this provider through the UI or API. Set to true via POST /v1/workspaces/:id/providers; set to false implicitly on soft-delete.
is_matchedbooleanโšช NoDEFAULT false; set to true automatically whenever is_selected is set to true (repository enforces: if isSelected โ†’ is_matched = true)true, falseWhether the provider was confirmed relevant to this workspace, either through explicit user selection (which auto-sets this flag) or via system matching logic such as the workspace-provider scoring pipeline.
created_at๐Ÿ”’ system โ€” timestamptzโšช NoonCreate hook; DEFAULT now()โ€”Timestamp of row creation. Set automatically by MikroORM onCreate hook.
updated_at๐Ÿ”’ system โ€” timestamptzโšช NoonCreate + onUpdate hooksโ€”Timestamp of last row modification. Refreshed automatically by MikroORM onUpdate hook.
deleted_attimestamptz | nullโšช Nonullable; set to current timestamp on soft-delete via WorkspaceProviderRepository.softDeletenull (active) or ISO 8601 timestamp (soft-deleted)Soft-delete marker. When non-null the provider is considered deselected for the workspace. All active-provider queries filter deleted_at IS NULL.

Relationships

NameTypeRequiredDescription
workspaceto-one (ManyToOne)โœ… YesThe workspace that selected this provider. Foreign key workspace_pk โ†’ core_api.workspaces.pk. Every WorkspaceProvider row is strictly tenant-scoped to this workspace.
providerto-one (ManyToOne)โœ… YesThe global provider catalog entry being bookmarked. Foreign key provider_pk โ†’ core_api.providers.pk. Carries provider name, slug, category, logo, URL, and Vision Agent skill fields.

System-computed

  • pk โ€” auto-increment integer primary key; internal only, never exposed in the API
  • created_at โ€” set by MikroORM onCreate: () => new Date() hook
  • updated_at โ€” set by both onCreate and onUpdate: () => new Date() hooks
  • deleted_at โ€” null at creation; stamped with current timestamp by WorkspaceProviderRepository.softDelete() when the user removes the provider via DELETE /v1/workspaces/:id/providers/:providerId
  • is_matched โ€” automatically forced to true by the repository upsert logic whenever is_selected is set to true (business rule: explicit user selection always counts as matched)
  • is_selected default โ€” false at row creation; set to true by WorkspaceProviderService.createWorkspaceProvider() via WorkspaceProviderRepository.upsert(workspace, provider, true)

Example

{
  "data": {
    "type": "workspace_provider",
    "id": "a3f1c2d4-88e0-4b5a-9f3c-1d2e3f4a5b6c",
    "attributes": {
      "is_selected": true,
      "is_matched": true,
      "created_at": "2025-11-14T09:30:00.000Z",
      "updated_at": "2025-11-14T09:30:00.000Z",
      "deleted_at": null
    },
    "relationships": {
      "workspace": {
        "data": { "type": "workspace", "id": "d7e8f9a0-1234-4abc-8def-0123456789ab" }
      },
      "provider": {
        "data": { "type": "provider", "id": "b2c3d4e5-5678-4bcd-9ef0-1234567890bc" }
      }
    }
  }
}
Source: apps/api/src/database/entities/WorkspaceProvider.ts ยท domain: ingestion ยท tier: Platform