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