@thinkai/tai-api-contract 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 0.16.1
4
+ version: 1.0.5
5
5
  description: >
6
6
  Contract surface for the Performance Intelligence Platform backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
8
- Legacy tenant-scoped routes (`/tenants/{tenantId}/...`, `/me/tenants`) are deprecated in runtime and return `410 Gone`.
8
+ Legacy tenant-scoped routes (`/tenants/{tenantId}/...`, `/me/tenants`) were removed from runtime.
9
9
  Admin routes use `/admin/...` and require role `admin`.
10
10
  Legacy HTTP routes that exist on the server but are not listed here (for example
11
- `PUT /tenants/{tenantId}/dashboard-settings`) remain supported for existing PIP clients;
11
+ `PUT /workspaces/{workspaceId}/dashboard-settings`) remain supported for existing PIP clients;
12
12
  prefer OpenAPI-documented equivalents where available. Removal will be coordinated with ThinkAI releases.
13
13
  security:
14
14
  - bearerAuth: []
15
15
  tags:
16
- - name: Tenant
16
+ - name: Workspace
17
17
  description: Workspace bootstrap (§13)
18
18
  - name: CompanyProfile
19
19
  description: Company profile (§1)
@@ -38,32 +38,11 @@ tags:
38
38
  - name: Me
39
39
  description: Authenticated user profile (§11)
40
40
  - name: Preferences
41
- description: Per-user per-tenant preferences (§12)
41
+ description: Per-user per-workspace preferences (§12)
42
42
  - name: OrgChartImport
43
43
  description: Org chart import via storage path (§14)
44
44
 
45
45
  paths:
46
- /tenants:
47
- post:
48
- tags: [Tenant]
49
- summary: Create tenant
50
- operationId: createTenant
51
- requestBody:
52
- required: true
53
- content:
54
- application/json:
55
- schema:
56
- $ref: "#/components/schemas/CreateTenantBodyDto"
57
- responses:
58
- "201":
59
- description: Tenant created or acknowledged (idempotent; same body if already existed)
60
- content:
61
- application/json:
62
- schema:
63
- $ref: "#/components/schemas/CreateTenantResponseDto"
64
- "401":
65
- $ref: "#/components/responses/Unauthorized"
66
-
67
46
  /me:
68
47
  get:
69
48
  tags: [Me]
@@ -111,7 +90,7 @@ paths:
111
90
 
112
91
  /workspaces:
113
92
  post:
114
- tags: [Tenant]
93
+ tags: [Workspace]
115
94
  summary: Create workspace
116
95
  operationId: createWorkspace
117
96
  requestBody:
@@ -130,56 +109,16 @@ paths:
130
109
  "401":
131
110
  $ref: "#/components/responses/Unauthorized"
132
111
 
133
- /workspaces/{workspaceId}/organization:
134
- get:
135
- tags: [CompanyProfile]
136
- summary: Get workspace organization profile
137
- operationId: getWorkspaceOrganization
138
- parameters:
139
- - name: workspaceId
140
- in: path
141
- required: true
142
- schema: { type: string }
143
- responses:
144
- "200":
145
- description: Organization profile or null if unset
146
- content:
147
- application/json:
148
- schema:
149
- $ref: "#/components/schemas/OrganizationDto"
150
- "401":
151
- $ref: "#/components/responses/Unauthorized"
152
- put:
153
- tags: [CompanyProfile]
154
- summary: Upsert workspace organization profile
155
- operationId: putWorkspaceOrganization
156
- parameters:
157
- - name: workspaceId
158
- in: path
159
- required: true
160
- schema: { type: string }
161
- requestBody:
162
- required: true
163
- content:
164
- application/json:
165
- schema:
166
- $ref: "#/components/schemas/OrganizationDto"
167
- responses:
168
- "204":
169
- description: Updated
170
- "401":
171
- $ref: "#/components/responses/Unauthorized"
172
-
173
- /tenants/{tenantId}/members:
112
+ /workspaces/{workspaceId}/members:
174
113
  get:
175
- tags: [Tenant]
176
- summary: List tenant team members
114
+ tags: [Workspace]
115
+ summary: List workspace team members
177
116
  operationId: listTenantMembers
178
117
  parameters:
179
- - $ref: "#/components/parameters/TenantId"
118
+ - $ref: "#/components/parameters/WorkspaceId"
180
119
  responses:
181
120
  "200":
182
- description: Team members for tenant
121
+ description: Team members for workspace
183
122
  content:
184
123
  application/json:
185
124
  schema:
@@ -189,13 +128,13 @@ paths:
189
128
  "403":
190
129
  $ref: "#/components/responses/Forbidden"
191
130
 
192
- /tenants/{tenantId}/members/invite:
131
+ /workspaces/{workspaceId}/members/invite:
193
132
  post:
194
- tags: [Tenant]
195
- summary: Invite member to tenant
133
+ tags: [Workspace]
134
+ summary: Invite member to workspace
196
135
  operationId: inviteTenantMember
197
136
  parameters:
198
- - $ref: "#/components/parameters/TenantId"
137
+ - $ref: "#/components/parameters/WorkspaceId"
199
138
  requestBody:
200
139
  required: true
201
140
  content:
@@ -214,13 +153,13 @@ paths:
214
153
  "403":
215
154
  $ref: "#/components/responses/Forbidden"
216
155
 
217
- /tenants/{tenantId}/members/{memberId}:
156
+ /workspaces/{workspaceId}/members/{memberId}:
218
157
  patch:
219
- tags: [Tenant]
220
- summary: Update tenant member role
158
+ tags: [Workspace]
159
+ summary: Update workspace member role
221
160
  operationId: updateTenantMemberRole
222
161
  parameters:
223
- - $ref: "#/components/parameters/TenantId"
162
+ - $ref: "#/components/parameters/WorkspaceId"
224
163
  - name: memberId
225
164
  in: path
226
165
  required: true
@@ -245,11 +184,11 @@ paths:
245
184
  "404":
246
185
  description: Member not found
247
186
  delete:
248
- tags: [Tenant]
249
- summary: Remove member from tenant
187
+ tags: [Workspace]
188
+ summary: Remove member from workspace
250
189
  operationId: removeTenantMember
251
190
  parameters:
252
- - $ref: "#/components/parameters/TenantId"
191
+ - $ref: "#/components/parameters/WorkspaceId"
253
192
  - name: memberId
254
193
  in: path
255
194
  required: true
@@ -264,13 +203,13 @@ paths:
264
203
  "404":
265
204
  description: Member not found
266
205
 
267
- /tenants/{tenantId}/org-chart:
206
+ /workspaces/{workspaceId}/org-chart:
268
207
  get:
269
- tags: [Tenant]
208
+ tags: [Workspace]
270
209
  summary: Get org chart tree
271
210
  operationId: getTenantOrgChart
272
211
  parameters:
273
- - $ref: "#/components/parameters/TenantId"
212
+ - $ref: "#/components/parameters/WorkspaceId"
274
213
  - name: withScores
275
214
  in: query
276
215
  schema: { type: boolean }
@@ -284,13 +223,13 @@ paths:
284
223
  "401":
285
224
  $ref: "#/components/responses/Unauthorized"
286
225
  "404":
287
- description: Tenant not found
226
+ description: Workspace not found
288
227
  post:
289
- tags: [Tenant]
228
+ tags: [Workspace]
290
229
  summary: Save org chart tree
291
230
  operationId: postTenantOrgChart
292
231
  parameters:
293
- - $ref: "#/components/parameters/TenantId"
232
+ - $ref: "#/components/parameters/WorkspaceId"
294
233
  requestBody:
295
234
  required: true
296
235
  content:
@@ -304,20 +243,20 @@ paths:
304
243
  application/json:
305
244
  schema:
306
245
  type: object
307
- required: [ok, tenantId]
246
+ required: [ok, workspaceId]
308
247
  properties:
309
248
  ok: { type: boolean }
310
- tenantId: { type: string }
249
+ workspaceId: { type: string }
311
250
  "401":
312
251
  $ref: "#/components/responses/Unauthorized"
313
252
 
314
- /tenants/{tenantId}/sources:
253
+ /workspaces/{workspaceId}/sources:
315
254
  put:
316
- tags: [Tenant]
317
- summary: Replace tenant data sources
255
+ tags: [Workspace]
256
+ summary: Replace workspace data sources
318
257
  operationId: putTenantSources
319
258
  parameters:
320
- - $ref: "#/components/parameters/TenantId"
259
+ - $ref: "#/components/parameters/WorkspaceId"
321
260
  requestBody:
322
261
  required: true
323
262
  content:
@@ -337,20 +276,20 @@ paths:
337
276
  application/json:
338
277
  schema:
339
278
  type: object
340
- required: [ok, tenantId]
279
+ required: [ok, workspaceId]
341
280
  properties:
342
281
  ok: { type: boolean }
343
- tenantId: { type: string }
282
+ workspaceId: { type: string }
344
283
  "401":
345
284
  $ref: "#/components/responses/Unauthorized"
346
285
 
347
- /tenants/{tenantId}/sources/test:
286
+ /workspaces/{workspaceId}/sources/test:
348
287
  post:
349
- tags: [Tenant]
288
+ tags: [Workspace]
350
289
  summary: Test one source connection (does not persist)
351
290
  operationId: postTenantSourceTest
352
291
  parameters:
353
- - $ref: "#/components/parameters/TenantId"
292
+ - $ref: "#/components/parameters/WorkspaceId"
354
293
  requestBody:
355
294
  required: true
356
295
  content:
@@ -369,13 +308,13 @@ paths:
369
308
  "401":
370
309
  $ref: "#/components/responses/Unauthorized"
371
310
 
372
- /tenants/{tenantId}/dashboard/productivity:
311
+ /workspaces/{workspaceId}/dashboard/productivity:
373
312
  get:
374
- tags: [Tenant]
313
+ tags: [Workspace]
375
314
  summary: CTO dashboard productivity snapshot
376
315
  operationId: getDashboardProductivity
377
316
  parameters:
378
- - $ref: "#/components/parameters/TenantId"
317
+ - $ref: "#/components/parameters/WorkspaceId"
379
318
  - name: scope
380
319
  in: query
381
320
  schema:
@@ -400,13 +339,13 @@ paths:
400
339
  "401":
401
340
  $ref: "#/components/responses/Unauthorized"
402
341
 
403
- /tenants/{tenantId}/dashboard/productivity/history:
342
+ /workspaces/{workspaceId}/dashboard/productivity/history:
404
343
  get:
405
- tags: [Tenant]
344
+ tags: [Workspace]
406
345
  summary: CTO dashboard productivity time series
407
346
  operationId: getDashboardProductivityHistory
408
347
  parameters:
409
- - $ref: "#/components/parameters/TenantId"
348
+ - $ref: "#/components/parameters/WorkspaceId"
410
349
  - name: bucket
411
350
  in: query
412
351
  schema: { type: string, enum: [day, week, month] }
@@ -596,36 +535,60 @@ paths:
596
535
  "403":
597
536
  $ref: "#/components/responses/Forbidden"
598
537
 
599
- /tenants/{tenantId}/company-profile:
538
+ /workspaces/{workspaceId}/company-profile:
600
539
  get:
601
540
  tags: [CompanyProfile]
602
541
  summary: Get company profile
603
542
  operationId: getCompanyProfile
604
543
  parameters:
605
- - $ref: "#/components/parameters/TenantId"
544
+ - $ref: "#/components/parameters/WorkspaceId"
606
545
  responses:
607
546
  "200":
608
- description: Profile or JSON null if unset
547
+ description: >
548
+ Company profile DTO, or JSON `null` when the workspace exists but no profile
549
+ has been saved yet. Clients should treat `null` as the empty initial state
550
+ (the wizard renders blank inputs); they MUST NOT treat the absence of a
551
+ saved profile as a 404.
609
552
  content:
610
553
  application/json:
611
554
  schema:
612
555
  $ref: "#/components/schemas/CompanyProfileDto"
613
556
  examples:
614
557
  sample:
558
+ summary: Saved profile
615
559
  value:
616
560
  companyName: Acme
617
561
  industry: software
618
562
  companySize: "51-200"
619
563
  engineeringHC: "42"
620
564
  headquarters: "Austin, TX"
565
+ "400":
566
+ description: Malformed workspaceId
567
+ content:
568
+ application/json:
569
+ schema:
570
+ $ref: "#/components/schemas/ErrorMessageDto"
621
571
  "401":
622
572
  $ref: "#/components/responses/Unauthorized"
573
+ "403":
574
+ $ref: "#/components/responses/Forbidden"
575
+ "404":
576
+ description: Workspace does not exist
577
+ content:
578
+ application/json:
579
+ schema:
580
+ $ref: "#/components/schemas/ErrorMessageDto"
623
581
  put:
624
582
  tags: [CompanyProfile]
625
583
  summary: Upsert company profile
626
584
  operationId: putCompanyProfile
585
+ description: >
586
+ Idempotent upsert of the workspace's company profile. On success, also
587
+ synchronizes `tai_workspaces.name` to the new `companyName` so subsequent
588
+ calls to `GET /me/workspaces` reflect the updated display name. Repeated
589
+ PUTs replace the stored payload entirely.
627
590
  parameters:
628
- - $ref: "#/components/parameters/TenantId"
591
+ - $ref: "#/components/parameters/WorkspaceId"
629
592
  requestBody:
630
593
  required: true
631
594
  content:
@@ -635,16 +598,30 @@ paths:
635
598
  responses:
636
599
  "204":
637
600
  description: Saved
601
+ "400":
602
+ description: Body fails validation (missing/invalid required field, bad enum, conditional rule)
603
+ content:
604
+ application/json:
605
+ schema:
606
+ $ref: "#/components/schemas/ErrorMessageDto"
638
607
  "401":
639
608
  $ref: "#/components/responses/Unauthorized"
609
+ "403":
610
+ $ref: "#/components/responses/Forbidden"
611
+ "404":
612
+ description: Workspace does not exist
613
+ content:
614
+ application/json:
615
+ schema:
616
+ $ref: "#/components/schemas/ErrorMessageDto"
640
617
 
641
- /tenants/{tenantId}/ai-readiness:
618
+ /workspaces/{workspaceId}/ai-readiness:
642
619
  get:
643
620
  tags: [AIReadiness]
644
621
  summary: Get AI readiness
645
622
  operationId: getAiReadiness
646
623
  parameters:
647
- - $ref: "#/components/parameters/TenantId"
624
+ - $ref: "#/components/parameters/WorkspaceId"
648
625
  responses:
649
626
  "200":
650
627
  description: State or JSON null
@@ -659,7 +636,7 @@ paths:
659
636
  summary: Upsert AI readiness
660
637
  operationId: putAiReadiness
661
638
  parameters:
662
- - $ref: "#/components/parameters/TenantId"
639
+ - $ref: "#/components/parameters/WorkspaceId"
663
640
  requestBody:
664
641
  required: true
665
642
  content:
@@ -672,13 +649,13 @@ paths:
672
649
  "401":
673
650
  $ref: "#/components/responses/Unauthorized"
674
651
 
675
- /tenants/{tenantId}/ai-readiness/maturity:
652
+ /workspaces/{workspaceId}/ai-readiness/maturity:
676
653
  post:
677
654
  tags: [AIReadiness]
678
655
  summary: Compute maturity level
679
656
  operationId: postAiReadinessMaturity
680
657
  parameters:
681
- - $ref: "#/components/parameters/TenantId"
658
+ - $ref: "#/components/parameters/WorkspaceId"
682
659
  requestBody:
683
660
  required: true
684
661
  content:
@@ -695,13 +672,13 @@ paths:
695
672
  "401":
696
673
  $ref: "#/components/responses/Unauthorized"
697
674
 
698
- /tenants/{tenantId}/tech-stack:
675
+ /workspaces/{workspaceId}/tech-stack:
699
676
  get:
700
677
  tags: [TechStack]
701
678
  summary: Get tech stack
702
679
  operationId: getTechStack
703
680
  parameters:
704
- - $ref: "#/components/parameters/TenantId"
681
+ - $ref: "#/components/parameters/WorkspaceId"
705
682
  responses:
706
683
  "200":
707
684
  description: Stack or JSON null
@@ -716,7 +693,7 @@ paths:
716
693
  summary: Upsert tech stack
717
694
  operationId: putTechStack
718
695
  parameters:
719
- - $ref: "#/components/parameters/TenantId"
696
+ - $ref: "#/components/parameters/WorkspaceId"
720
697
  requestBody:
721
698
  required: true
722
699
  content:
@@ -729,13 +706,13 @@ paths:
729
706
  "401":
730
707
  $ref: "#/components/responses/Unauthorized"
731
708
 
732
- /tenants/{tenantId}/nda:
709
+ /workspaces/{workspaceId}/nda:
733
710
  get:
734
711
  tags: [NDA]
735
712
  summary: Get NDA completion state
736
713
  operationId: getNda
737
714
  parameters:
738
- - $ref: "#/components/parameters/TenantId"
715
+ - $ref: "#/components/parameters/WorkspaceId"
739
716
  responses:
740
717
  "200":
741
718
  description: Completion or JSON null
@@ -746,13 +723,13 @@ paths:
746
723
  "401":
747
724
  $ref: "#/components/responses/Unauthorized"
748
725
 
749
- /tenants/{tenantId}/nda/template:
726
+ /workspaces/{workspaceId}/nda/template:
750
727
  get:
751
728
  tags: [NDA]
752
729
  summary: NDA template for display
753
730
  operationId: getNdaTemplate
754
731
  parameters:
755
- - $ref: "#/components/parameters/TenantId"
732
+ - $ref: "#/components/parameters/WorkspaceId"
756
733
  responses:
757
734
  "200":
758
735
  description: Template
@@ -763,13 +740,13 @@ paths:
763
740
  "401":
764
741
  $ref: "#/components/responses/Unauthorized"
765
742
 
766
- /tenants/{tenantId}/nda/sign:
743
+ /workspaces/{workspaceId}/nda/sign:
767
744
  post:
768
745
  tags: [NDA]
769
746
  summary: Electronic NDA signature
770
747
  operationId: postNdaSign
771
748
  parameters:
772
- - $ref: "#/components/parameters/TenantId"
749
+ - $ref: "#/components/parameters/WorkspaceId"
773
750
  requestBody:
774
751
  required: true
775
752
  content:
@@ -786,7 +763,7 @@ paths:
786
763
  "401":
787
764
  $ref: "#/components/responses/Unauthorized"
788
765
 
789
- /tenants/{tenantId}/nda/external:
766
+ /workspaces/{workspaceId}/nda/external:
790
767
  post:
791
768
  tags: [NDA]
792
769
  summary: External NDA path (after Supabase upload)
@@ -795,7 +772,7 @@ paths:
795
772
  Multipart variant may be supported by the server as an alternative.
796
773
  operationId: postNdaExternal
797
774
  parameters:
798
- - $ref: "#/components/parameters/TenantId"
775
+ - $ref: "#/components/parameters/WorkspaceId"
799
776
  requestBody:
800
777
  required: true
801
778
  content:
@@ -812,13 +789,13 @@ paths:
812
789
  "401":
813
790
  $ref: "#/components/responses/Unauthorized"
814
791
 
815
- /tenants/{tenantId}/readiness/repos:
792
+ /workspaces/{workspaceId}/readiness/repos:
816
793
  get:
817
794
  tags: [RepositoryReadiness]
818
795
  summary: List repo readiness scores
819
796
  operationId: listReadinessRepos
820
797
  parameters:
821
- - $ref: "#/components/parameters/TenantId"
798
+ - $ref: "#/components/parameters/WorkspaceId"
822
799
  responses:
823
800
  "200":
824
801
  description: Repositories analyzed
@@ -831,13 +808,13 @@ paths:
831
808
  "401":
832
809
  $ref: "#/components/responses/Unauthorized"
833
810
 
834
- /tenants/{tenantId}/readiness/repos/{repoId}:
811
+ /workspaces/{workspaceId}/readiness/repos/{repoId}:
835
812
  get:
836
813
  tags: [RepositoryReadiness]
837
814
  summary: Single repo readiness
838
815
  operationId: getReadinessRepo
839
816
  parameters:
840
- - $ref: "#/components/parameters/TenantId"
817
+ - $ref: "#/components/parameters/WorkspaceId"
841
818
  - $ref: "#/components/parameters/RepoId"
842
819
  responses:
843
820
  "200":
@@ -849,13 +826,13 @@ paths:
849
826
  "401":
850
827
  $ref: "#/components/responses/Unauthorized"
851
828
 
852
- /tenants/{tenantId}/readiness/dimensions:
829
+ /workspaces/{workspaceId}/readiness/dimensions:
853
830
  get:
854
831
  tags: [RepositoryReadiness]
855
832
  summary: Readiness dimensions catalog
856
833
  operationId: listReadinessDimensions
857
834
  parameters:
858
- - $ref: "#/components/parameters/TenantId"
835
+ - $ref: "#/components/parameters/WorkspaceId"
859
836
  responses:
860
837
  "200":
861
838
  description: Dimensions
@@ -868,13 +845,13 @@ paths:
868
845
  "401":
869
846
  $ref: "#/components/responses/Unauthorized"
870
847
 
871
- /tenants/{tenantId}/readiness/fixes:
848
+ /workspaces/{workspaceId}/readiness/fixes:
872
849
  get:
873
850
  tags: [RepositoryReadiness]
874
851
  summary: List fix requests
875
852
  operationId: listReadinessFixes
876
853
  parameters:
877
- - $ref: "#/components/parameters/TenantId"
854
+ - $ref: "#/components/parameters/WorkspaceId"
878
855
  responses:
879
856
  "200":
880
857
  description: Fix queue
@@ -891,7 +868,7 @@ paths:
891
868
  summary: Enqueue fix for an issue
892
869
  operationId: postReadinessFix
893
870
  parameters:
894
- - $ref: "#/components/parameters/TenantId"
871
+ - $ref: "#/components/parameters/WorkspaceId"
895
872
  requestBody:
896
873
  required: true
897
874
  content:
@@ -908,13 +885,13 @@ paths:
908
885
  "401":
909
886
  $ref: "#/components/responses/Unauthorized"
910
887
 
911
- /tenants/{tenantId}/squad:
888
+ /workspaces/{workspaceId}/squad:
912
889
  get:
913
890
  tags: [SquadProjects]
914
891
  summary: Get squad configuration
915
892
  operationId: getSquad
916
893
  parameters:
917
- - $ref: "#/components/parameters/TenantId"
894
+ - $ref: "#/components/parameters/WorkspaceId"
918
895
  responses:
919
896
  "200":
920
897
  description: Squad
@@ -929,7 +906,7 @@ paths:
929
906
  summary: Upsert squad
930
907
  operationId: putSquad
931
908
  parameters:
932
- - $ref: "#/components/parameters/TenantId"
909
+ - $ref: "#/components/parameters/WorkspaceId"
933
910
  requestBody:
934
911
  required: true
935
912
  content:
@@ -942,13 +919,13 @@ paths:
942
919
  "401":
943
920
  $ref: "#/components/responses/Unauthorized"
944
921
 
945
- /tenants/{tenantId}/projects:
922
+ /workspaces/{workspaceId}/projects:
946
923
  get:
947
924
  tags: [SquadProjects]
948
925
  summary: List projects
949
926
  operationId: listProjects
950
927
  parameters:
951
- - $ref: "#/components/parameters/TenantId"
928
+ - $ref: "#/components/parameters/WorkspaceId"
952
929
  responses:
953
930
  "200":
954
931
  description: Projects
@@ -965,7 +942,7 @@ paths:
965
942
  summary: Create project
966
943
  operationId: createProject
967
944
  parameters:
968
- - $ref: "#/components/parameters/TenantId"
945
+ - $ref: "#/components/parameters/WorkspaceId"
969
946
  requestBody:
970
947
  required: true
971
948
  content:
@@ -982,13 +959,13 @@ paths:
982
959
  "401":
983
960
  $ref: "#/components/responses/Unauthorized"
984
961
 
985
- /tenants/{tenantId}/projects/{projectId}:
962
+ /workspaces/{workspaceId}/projects/{projectId}:
986
963
  patch:
987
964
  tags: [SquadProjects]
988
965
  summary: Update project
989
966
  operationId: patchProject
990
967
  parameters:
991
- - $ref: "#/components/parameters/TenantId"
968
+ - $ref: "#/components/parameters/WorkspaceId"
992
969
  - $ref: "#/components/parameters/ProjectId"
993
970
  requestBody:
994
971
  required: true
@@ -1006,13 +983,13 @@ paths:
1006
983
  "401":
1007
984
  $ref: "#/components/responses/Unauthorized"
1008
985
 
1009
- /tenants/{tenantId}/notifications:
986
+ /workspaces/{workspaceId}/notifications:
1010
987
  get:
1011
988
  tags: [Notifications]
1012
989
  summary: Paginated notifications
1013
990
  operationId: listNotifications
1014
991
  parameters:
1015
- - $ref: "#/components/parameters/TenantId"
992
+ - $ref: "#/components/parameters/WorkspaceId"
1016
993
  - name: limit
1017
994
  in: query
1018
995
  schema: { type: integer, minimum: 1 }
@@ -1029,13 +1006,13 @@ paths:
1029
1006
  "401":
1030
1007
  $ref: "#/components/responses/Unauthorized"
1031
1008
 
1032
- /tenants/{tenantId}/notifications/{id}/read:
1009
+ /workspaces/{workspaceId}/notifications/{id}/read:
1033
1010
  post:
1034
1011
  tags: [Notifications]
1035
1012
  summary: Mark notification read
1036
1013
  operationId: postNotificationRead
1037
1014
  parameters:
1038
- - $ref: "#/components/parameters/TenantId"
1015
+ - $ref: "#/components/parameters/WorkspaceId"
1039
1016
  - $ref: "#/components/parameters/NotificationId"
1040
1017
  responses:
1041
1018
  "204":
@@ -1043,26 +1020,26 @@ paths:
1043
1020
  "401":
1044
1021
  $ref: "#/components/responses/Unauthorized"
1045
1022
 
1046
- /tenants/{tenantId}/notifications/read-all:
1023
+ /workspaces/{workspaceId}/notifications/read-all:
1047
1024
  post:
1048
1025
  tags: [Notifications]
1049
1026
  summary: Mark all notifications read
1050
1027
  operationId: postNotificationsReadAll
1051
1028
  parameters:
1052
- - $ref: "#/components/parameters/TenantId"
1029
+ - $ref: "#/components/parameters/WorkspaceId"
1053
1030
  responses:
1054
1031
  "204":
1055
1032
  description: Updated
1056
1033
  "401":
1057
1034
  $ref: "#/components/responses/Unauthorized"
1058
1035
 
1059
- /tenants/{tenantId}/ai-strategy/recommend:
1036
+ /workspaces/{workspaceId}/ai-strategy/recommend:
1060
1037
  post:
1061
1038
  tags: [AIStrategy]
1062
1039
  summary: Generate AI strategy recommendations
1063
1040
  operationId: postAiStrategyRecommend
1064
1041
  parameters:
1065
- - $ref: "#/components/parameters/TenantId"
1042
+ - $ref: "#/components/parameters/WorkspaceId"
1066
1043
  requestBody:
1067
1044
  required: true
1068
1045
  content:
@@ -1079,13 +1056,13 @@ paths:
1079
1056
  "401":
1080
1057
  $ref: "#/components/responses/Unauthorized"
1081
1058
 
1082
- /tenants/{tenantId}/journey/progress:
1059
+ /workspaces/{workspaceId}/journey/progress:
1083
1060
  get:
1084
1061
  tags: [Journey]
1085
1062
  summary: Journey step completion
1086
1063
  operationId: getJourneyProgress
1087
1064
  parameters:
1088
- - $ref: "#/components/parameters/TenantId"
1065
+ - $ref: "#/components/parameters/WorkspaceId"
1089
1066
  responses:
1090
1067
  "200":
1091
1068
  description: Progress
@@ -1100,7 +1077,7 @@ paths:
1100
1077
  summary: Replace completed steps
1101
1078
  operationId: putJourneyProgress
1102
1079
  parameters:
1103
- - $ref: "#/components/parameters/TenantId"
1080
+ - $ref: "#/components/parameters/WorkspaceId"
1104
1081
  requestBody:
1105
1082
  required: true
1106
1083
  content:
@@ -1113,13 +1090,11 @@ paths:
1113
1090
  "401":
1114
1091
  $ref: "#/components/responses/Unauthorized"
1115
1092
 
1116
- /tenants/{tenantId}/me/preferences:
1093
+ /me/preferences:
1117
1094
  get:
1118
1095
  tags: [Preferences]
1119
- summary: Get preferences for current user in tenant
1096
+ summary: Get preferences for current user
1120
1097
  operationId: getMyPreferences
1121
- parameters:
1122
- - $ref: "#/components/parameters/TenantId"
1123
1098
  responses:
1124
1099
  "200":
1125
1100
  description: Preferences
@@ -1133,8 +1108,6 @@ paths:
1133
1108
  tags: [Preferences]
1134
1109
  summary: Upsert preferences
1135
1110
  operationId: putMyPreferences
1136
- parameters:
1137
- - $ref: "#/components/parameters/TenantId"
1138
1111
  requestBody:
1139
1112
  required: true
1140
1113
  content:
@@ -1147,13 +1120,13 @@ paths:
1147
1120
  "401":
1148
1121
  $ref: "#/components/responses/Unauthorized"
1149
1122
 
1150
- /tenants/{tenantId}/org-chart/import:
1123
+ /workspaces/{workspaceId}/org-chart/import:
1151
1124
  post:
1152
1125
  tags: [OrgChartImport]
1153
1126
  summary: Import org chart from Supabase storage path
1154
1127
  operationId: postOrgChartImport
1155
1128
  parameters:
1156
- - $ref: "#/components/parameters/TenantId"
1129
+ - $ref: "#/components/parameters/WorkspaceId"
1157
1130
  requestBody:
1158
1131
  required: true
1159
1132
  content:
@@ -1180,8 +1153,8 @@ components:
1180
1153
  description: Supabase access token (`Authorization` header).
1181
1154
 
1182
1155
  parameters:
1183
- TenantId:
1184
- name: tenantId
1156
+ WorkspaceId:
1157
+ name: workspaceId
1185
1158
  in: path
1186
1159
  required: true
1187
1160
  schema:
@@ -1241,16 +1214,16 @@ components:
1241
1214
 
1242
1215
  CreateTenantBodyDto:
1243
1216
  type: object
1244
- required: [tenantId]
1217
+ required: [workspaceId]
1245
1218
  properties:
1246
- tenantId:
1219
+ workspaceId:
1247
1220
  type: string
1248
1221
 
1249
1222
  CreateTenantResponseDto:
1250
1223
  type: object
1251
- required: [tenantId, ok]
1224
+ required: [workspaceId, ok]
1252
1225
  properties:
1253
- tenantId:
1226
+ workspaceId:
1254
1227
  type: string
1255
1228
  ok:
1256
1229
  type: boolean
@@ -1354,9 +1327,9 @@ components:
1354
1327
 
1355
1328
  DashboardProductivityDto:
1356
1329
  type: object
1357
- required: [tenantId, windowStart, windowEnd, scope, metrics]
1330
+ required: [workspaceId, windowStart, windowEnd, scope, metrics]
1358
1331
  properties:
1359
- tenantId:
1332
+ workspaceId:
1360
1333
  type: string
1361
1334
  windowStart:
1362
1335
  type: string
@@ -1452,27 +1425,6 @@ components:
1452
1425
  name:
1453
1426
  type: string
1454
1427
 
1455
- OrganizationDto:
1456
- type: object
1457
- required: [workspaceId, legalName]
1458
- properties:
1459
- workspaceId:
1460
- type: string
1461
- legalName:
1462
- type: string
1463
- industry:
1464
- type: string
1465
- companySize:
1466
- type: string
1467
- engineeringHeadcount:
1468
- type: integer
1469
- nullable: true
1470
- headquarters:
1471
- type: string
1472
- metadata:
1473
- type: object
1474
- additionalProperties: true
1475
-
1476
1428
  CompanyProfileDto:
1477
1429
  type: object
1478
1430
  required: [companyName, industry, companySize, engineeringHC, headquarters]
@@ -2244,30 +2196,42 @@ components:
2244
2196
  items:
2245
2197
  type: string
2246
2198
 
2199
+ ThemePreference:
2200
+ type: string
2201
+ enum: [light, dark, system]
2202
+
2203
+ NotificationPreferencesDto:
2204
+ type: object
2205
+ additionalProperties: false
2206
+ required: [status, comment, activity, system]
2207
+ properties:
2208
+ status:
2209
+ type: boolean
2210
+ description: Sync/health status notifications.
2211
+ comment:
2212
+ type: boolean
2213
+ description: Comments and mentions.
2214
+ activity:
2215
+ type: boolean
2216
+ description: General activity feed.
2217
+ system:
2218
+ type: boolean
2219
+ description: System / platform announcements.
2220
+
2247
2221
  PreferencesDto:
2248
2222
  type: object
2223
+ additionalProperties: false
2249
2224
  required: [theme, sidebarCollapsed, timezone, notifications]
2250
2225
  properties:
2251
2226
  theme:
2252
- type: string
2253
- enum: [light, dark, system]
2227
+ $ref: "#/components/schemas/ThemePreference"
2254
2228
  sidebarCollapsed:
2255
2229
  type: boolean
2256
2230
  timezone:
2257
2231
  type: string
2258
2232
  description: IANA timezone name
2259
2233
  notifications:
2260
- type: object
2261
- required: [status, comment, activity, system]
2262
- properties:
2263
- status:
2264
- type: boolean
2265
- comment:
2266
- type: boolean
2267
- activity:
2268
- type: boolean
2269
- system:
2270
- type: boolean
2234
+ $ref: "#/components/schemas/NotificationPreferencesDto"
2271
2235
 
2272
2236
  OrgChartImportBodyDto:
2273
2237
  type: object