@wazootech/client 0.0.0-stage → 0.7.2-rc.0

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.
@@ -0,0 +1,4311 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "Wazoo Platform API",
5
+ "version": "0.1.0",
6
+ "description": "Management-plane API for Wazoo users, Worlds, platform tokens, usage, limits, and beta billing."
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://api.wazoo.dev",
11
+ "description": "Wazoo Platform API"
12
+ }
13
+ ],
14
+ "security": [
15
+ {
16
+ "bearerPlatformToken": []
17
+ }
18
+ ],
19
+ "components": {
20
+ "securitySchemes": {
21
+ "bearerPlatformToken": {
22
+ "type": "http",
23
+ "scheme": "bearer",
24
+ "bearerFormat": "wzp",
25
+ "description": "Wazoo platform API token."
26
+ }
27
+ },
28
+ "schemas": {
29
+ "LoginResponse": {
30
+ "type": "object",
31
+ "properties": {
32
+ "ok": {
33
+ "type": "boolean",
34
+ "enum": [
35
+ true
36
+ ]
37
+ }
38
+ },
39
+ "required": [
40
+ "ok"
41
+ ],
42
+ "description": "Always `{ ok: true }` for accepted, rate-limited, unconfigured, or empty requests, so the endpoint is not an oracle for allowlist membership."
43
+ },
44
+ "LoginRequest": {
45
+ "type": "object",
46
+ "properties": {
47
+ "email": {
48
+ "type": "string",
49
+ "description": "Email address to send the magic-link code to. Matched case-insensitively."
50
+ }
51
+ },
52
+ "required": [
53
+ "email"
54
+ ]
55
+ },
56
+ "VerifyResponse": {
57
+ "type": "object",
58
+ "properties": {
59
+ "token": {
60
+ "type": "string",
61
+ "description": "Platform session token (wzp_)."
62
+ }
63
+ },
64
+ "required": [
65
+ "token"
66
+ ]
67
+ },
68
+ "ErrorResponse": {
69
+ "type": "object",
70
+ "properties": {
71
+ "error": {
72
+ "type": "object",
73
+ "properties": {
74
+ "code": {
75
+ "type": "string"
76
+ },
77
+ "message": {
78
+ "type": "string"
79
+ }
80
+ },
81
+ "required": [
82
+ "code",
83
+ "message"
84
+ ]
85
+ }
86
+ },
87
+ "required": [
88
+ "error"
89
+ ]
90
+ },
91
+ "VerifyRequest": {
92
+ "type": "object",
93
+ "properties": {
94
+ "email": {
95
+ "type": "string"
96
+ },
97
+ "code": {
98
+ "type": "string",
99
+ "description": "WorkOS magic-auth code."
100
+ },
101
+ "ageConfirmed": {
102
+ "type": "boolean",
103
+ "description": "Required `true` when the email does not yet have an account (13+ age gate)."
104
+ }
105
+ },
106
+ "required": [
107
+ "email",
108
+ "code"
109
+ ]
110
+ },
111
+ "WorkosSessionResponse": {
112
+ "type": "object",
113
+ "properties": {
114
+ "token": {
115
+ "type": "string"
116
+ },
117
+ "expiresAt": {
118
+ "type": "string",
119
+ "format": "date-time"
120
+ }
121
+ },
122
+ "required": [
123
+ "token",
124
+ "expiresAt"
125
+ ]
126
+ },
127
+ "WorkosSessionRequest": {
128
+ "type": "object",
129
+ "properties": {
130
+ "email": {
131
+ "type": "string"
132
+ },
133
+ "displayName": {
134
+ "type": "string"
135
+ },
136
+ "ageConfirmed": {
137
+ "type": "boolean",
138
+ "description": "Required `true` when the email does not yet have an account (13+ age gate)."
139
+ }
140
+ },
141
+ "required": [
142
+ "email"
143
+ ]
144
+ },
145
+ "User": {
146
+ "type": "object",
147
+ "properties": {
148
+ "uid": {
149
+ "type": "string"
150
+ },
151
+ "email": {
152
+ "type": "string",
153
+ "format": "email"
154
+ },
155
+ "displayName": {
156
+ "type": "string",
157
+ "nullable": true
158
+ },
159
+ "state": {
160
+ "type": "string",
161
+ "enum": [
162
+ "ACTIVE"
163
+ ]
164
+ },
165
+ "createTime": {
166
+ "type": "string",
167
+ "format": "date-time"
168
+ }
169
+ },
170
+ "required": [
171
+ "uid",
172
+ "email",
173
+ "displayName",
174
+ "state",
175
+ "createTime"
176
+ ]
177
+ },
178
+ "EmbeddingProviderList": {
179
+ "type": "object",
180
+ "properties": {
181
+ "providers": {
182
+ "type": "array",
183
+ "items": {
184
+ "$ref": "#/components/schemas/EmbeddingCredential"
185
+ }
186
+ }
187
+ },
188
+ "required": [
189
+ "providers"
190
+ ]
191
+ },
192
+ "EmbeddingCredential": {
193
+ "type": "object",
194
+ "properties": {
195
+ "provider": {
196
+ "type": "string",
197
+ "enum": [
198
+ "openai",
199
+ "openrouter"
200
+ ]
201
+ },
202
+ "status": {
203
+ "type": "string",
204
+ "enum": [
205
+ "active",
206
+ "invalid",
207
+ "revoked"
208
+ ]
209
+ },
210
+ "fingerprint": {
211
+ "type": "string"
212
+ },
213
+ "last4": {
214
+ "type": "string"
215
+ },
216
+ "createTime": {
217
+ "type": "string"
218
+ },
219
+ "rotateTime": {
220
+ "type": "string"
221
+ },
222
+ "revokeTime": {
223
+ "type": "string"
224
+ }
225
+ },
226
+ "required": [
227
+ "provider",
228
+ "status",
229
+ "fingerprint",
230
+ "last4",
231
+ "createTime"
232
+ ]
233
+ },
234
+ "World": {
235
+ "type": "object",
236
+ "properties": {
237
+ "id": {
238
+ "type": "string",
239
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
240
+ "description": "World ID minted by worlds-api in w_<ULID> form."
241
+ },
242
+ "displayName": {
243
+ "type": "string"
244
+ },
245
+ "region": {
246
+ "type": "string"
247
+ },
248
+ "state": {
249
+ "type": "string",
250
+ "enum": [
251
+ "ACTIVE",
252
+ "SUSPENDED",
253
+ "DELETED"
254
+ ]
255
+ },
256
+ "restorable": {
257
+ "type": "boolean"
258
+ },
259
+ "backend": {
260
+ "type": "string",
261
+ "enum": [
262
+ "worlds-api"
263
+ ]
264
+ },
265
+ "createTime": {
266
+ "type": "string",
267
+ "format": "date-time"
268
+ },
269
+ "updateTime": {
270
+ "type": "string",
271
+ "format": "date-time"
272
+ },
273
+ "deleteTime": {
274
+ "type": "string",
275
+ "format": "date-time"
276
+ },
277
+ "expireTime": {
278
+ "type": "string",
279
+ "format": "date-time"
280
+ }
281
+ },
282
+ "required": [
283
+ "id",
284
+ "displayName",
285
+ "region",
286
+ "state",
287
+ "restorable",
288
+ "backend"
289
+ ]
290
+ },
291
+ "CreateWorldRequest": {
292
+ "type": "object",
293
+ "properties": {
294
+ "ownerEmail": {
295
+ "type": "string",
296
+ "format": "email"
297
+ },
298
+ "email": {
299
+ "type": "string",
300
+ "format": "email"
301
+ },
302
+ "displayName": {
303
+ "type": "string",
304
+ "minLength": 1
305
+ },
306
+ "region": {
307
+ "type": "string",
308
+ "default": "auto"
309
+ }
310
+ },
311
+ "required": [
312
+ "displayName"
313
+ ],
314
+ "additionalProperties": false,
315
+ "description": "Flat create body, e.g. {\"displayName\":\"hello\"}. The control plane and the worlds-api data plane use the same shape; unknown keys are rejected."
316
+ },
317
+ "UpdateWorldRequest": {
318
+ "type": "object",
319
+ "properties": {
320
+ "updateMask": {
321
+ "type": "string"
322
+ },
323
+ "world": {
324
+ "type": "object",
325
+ "properties": {
326
+ "displayName": {
327
+ "type": "string"
328
+ },
329
+ "region": {
330
+ "type": "string"
331
+ },
332
+ "state": {
333
+ "type": "string",
334
+ "enum": [
335
+ "ACTIVE",
336
+ "SUSPENDED"
337
+ ]
338
+ }
339
+ }
340
+ }
341
+ },
342
+ "required": [
343
+ "updateMask",
344
+ "world"
345
+ ]
346
+ },
347
+ "WorldToken": {
348
+ "type": "object",
349
+ "properties": {
350
+ "uid": {
351
+ "type": "string"
352
+ },
353
+ "name": {
354
+ "type": "string"
355
+ },
356
+ "namespace": {
357
+ "type": "string"
358
+ },
359
+ "worldId": {
360
+ "type": "string"
361
+ },
362
+ "scopes": {
363
+ "type": "array",
364
+ "items": {
365
+ "type": "string"
366
+ }
367
+ },
368
+ "createTime": {
369
+ "type": "string",
370
+ "format": "date-time"
371
+ }
372
+ },
373
+ "required": [
374
+ "uid",
375
+ "name"
376
+ ]
377
+ },
378
+ "WorldTokenCreated": {
379
+ "type": "object",
380
+ "properties": {
381
+ "uid": {
382
+ "type": "string"
383
+ },
384
+ "name": {
385
+ "type": "string"
386
+ },
387
+ "namespace": {
388
+ "type": "string"
389
+ },
390
+ "worldId": {
391
+ "type": "string"
392
+ },
393
+ "scopes": {
394
+ "type": "array",
395
+ "items": {
396
+ "type": "string"
397
+ }
398
+ },
399
+ "createTime": {
400
+ "type": "string",
401
+ "format": "date-time"
402
+ },
403
+ "token": {
404
+ "type": "string",
405
+ "description": "One-time wzw_ secret returned only when the token is created; it cannot be retrieved again."
406
+ }
407
+ },
408
+ "required": [
409
+ "uid",
410
+ "name",
411
+ "token"
412
+ ]
413
+ },
414
+ "WorldTokenCreateRequest": {
415
+ "type": "object",
416
+ "properties": {
417
+ "name": {
418
+ "type": "string"
419
+ }
420
+ }
421
+ },
422
+ "PlatformToken": {
423
+ "type": "object",
424
+ "properties": {
425
+ "uid": {
426
+ "type": "string"
427
+ },
428
+ "name": {
429
+ "type": "string"
430
+ },
431
+ "scope": {
432
+ "type": "string"
433
+ },
434
+ "last_used_at": {
435
+ "type": "string",
436
+ "nullable": true,
437
+ "format": "date-time"
438
+ },
439
+ "expires_at": {
440
+ "type": "string",
441
+ "nullable": true,
442
+ "format": "date-time"
443
+ },
444
+ "createTime": {
445
+ "type": "string",
446
+ "format": "date-time"
447
+ }
448
+ },
449
+ "required": [
450
+ "uid",
451
+ "name"
452
+ ]
453
+ },
454
+ "PlatformTokenCreateResponse": {
455
+ "type": "object",
456
+ "properties": {
457
+ "uid": {
458
+ "type": "string"
459
+ },
460
+ "name": {
461
+ "type": "string"
462
+ },
463
+ "token": {
464
+ "type": "string"
465
+ }
466
+ },
467
+ "required": [
468
+ "uid",
469
+ "name",
470
+ "token"
471
+ ]
472
+ },
473
+ "PlatformTokenCreateRequest": {
474
+ "type": "object",
475
+ "properties": {
476
+ "user": {
477
+ "type": "string"
478
+ },
479
+ "email": {
480
+ "type": "string",
481
+ "format": "email"
482
+ },
483
+ "name": {
484
+ "type": "string"
485
+ },
486
+ "tokenName": {
487
+ "type": "string"
488
+ },
489
+ "scope": {
490
+ "type": "string"
491
+ },
492
+ "expiresAt": {
493
+ "type": "string",
494
+ "format": "date-time"
495
+ }
496
+ }
497
+ },
498
+ "UsageEvent": {
499
+ "type": "object",
500
+ "properties": {
501
+ "name": {
502
+ "type": "string"
503
+ },
504
+ "metric": {
505
+ "type": "string"
506
+ },
507
+ "quantity": {
508
+ "type": "integer"
509
+ },
510
+ "unit": {
511
+ "type": "string"
512
+ },
513
+ "providerCostMicrocents": {
514
+ "type": "integer",
515
+ "nullable": true
516
+ },
517
+ "wazooMarkupMicrocents": {
518
+ "type": "integer"
519
+ },
520
+ "estimatedCostMicrocents": {
521
+ "type": "integer",
522
+ "nullable": true
523
+ },
524
+ "billingSource": {
525
+ "type": "string"
526
+ },
527
+ "createTime": {
528
+ "type": "string",
529
+ "format": "date-time"
530
+ }
531
+ },
532
+ "required": [
533
+ "name",
534
+ "metric",
535
+ "quantity",
536
+ "unit",
537
+ "billingSource",
538
+ "createTime"
539
+ ]
540
+ },
541
+ "QuotaSummary": {
542
+ "type": "object",
543
+ "properties": {
544
+ "state": {
545
+ "type": "string",
546
+ "enum": [
547
+ "OK",
548
+ "WARN",
549
+ "THROTTLED"
550
+ ]
551
+ },
552
+ "usagePercent": {
553
+ "type": "number"
554
+ },
555
+ "limits": {
556
+ "type": "array",
557
+ "items": {
558
+ "$ref": "#/components/schemas/LimitSummary"
559
+ }
560
+ }
561
+ },
562
+ "required": [
563
+ "state",
564
+ "usagePercent",
565
+ "limits"
566
+ ]
567
+ },
568
+ "LimitSummary": {
569
+ "type": "object",
570
+ "properties": {
571
+ "metric": {
572
+ "type": "string"
573
+ },
574
+ "quantity": {
575
+ "type": "number"
576
+ },
577
+ "limitQuantity": {
578
+ "type": "number"
579
+ },
580
+ "usagePercent": {
581
+ "type": "number"
582
+ }
583
+ },
584
+ "required": [
585
+ "metric",
586
+ "quantity",
587
+ "limitQuantity",
588
+ "usagePercent"
589
+ ]
590
+ },
591
+ "UsageRecordRequest": {
592
+ "type": "object",
593
+ "properties": {
594
+ "user": {
595
+ "type": "string"
596
+ },
597
+ "email": {
598
+ "type": "string",
599
+ "format": "email"
600
+ },
601
+ "metric": {
602
+ "type": "string",
603
+ "minLength": 1
604
+ },
605
+ "quantity": {
606
+ "type": "integer",
607
+ "minimum": 0,
608
+ "exclusiveMinimum": true
609
+ },
610
+ "unit": {
611
+ "type": "string",
612
+ "default": "count"
613
+ },
614
+ "providerCostMicrocents": {
615
+ "type": "integer"
616
+ },
617
+ "wazooMarkupMicrocents": {
618
+ "type": "integer",
619
+ "default": 0
620
+ },
621
+ "estimatedCostMicrocents": {
622
+ "type": "integer"
623
+ },
624
+ "billingSource": {
625
+ "type": "string",
626
+ "default": "BETA_FREE"
627
+ },
628
+ "createTime": {
629
+ "type": "string",
630
+ "format": "date-time"
631
+ }
632
+ },
633
+ "required": [
634
+ "metric",
635
+ "quantity"
636
+ ]
637
+ },
638
+ "Billing": {
639
+ "type": "object",
640
+ "properties": {
641
+ "world": {
642
+ "type": "string"
643
+ },
644
+ "state": {
645
+ "type": "string"
646
+ },
647
+ "provider": {
648
+ "type": "string"
649
+ },
650
+ "customerConfigured": {
651
+ "type": "boolean"
652
+ },
653
+ "subscriptionConfigured": {
654
+ "type": "boolean"
655
+ },
656
+ "paymentRequired": {
657
+ "type": "boolean"
658
+ }
659
+ },
660
+ "required": [
661
+ "world",
662
+ "state",
663
+ "provider",
664
+ "customerConfigured",
665
+ "subscriptionConfigured",
666
+ "paymentRequired"
667
+ ]
668
+ },
669
+ "UserPlan": {
670
+ "type": "object",
671
+ "properties": {
672
+ "plan": {
673
+ "type": "string",
674
+ "enum": [
675
+ "free",
676
+ "pro"
677
+ ],
678
+ "description": "The user's plan. It sets their daily database write budget."
679
+ },
680
+ "dailyRowWrites": {
681
+ "type": "integer",
682
+ "nullable": true,
683
+ "minimum": 0,
684
+ "exclusiveMinimum": true,
685
+ "description": "Database rows the user's worlds may write per UTC day, shared across all of them. A stored quad costs about 9 rows, and about 94 per asserted quad with inference on. Null if the data plane could not be reached."
686
+ },
687
+ "rowsWrittenToday": {
688
+ "type": "integer",
689
+ "nullable": true,
690
+ "minimum": 0,
691
+ "description": "Rows written so far today (UTC), or null if the data plane could not be reached."
692
+ },
693
+ "usagePercent": {
694
+ "type": "integer",
695
+ "nullable": true,
696
+ "minimum": 0
697
+ },
698
+ "day": {
699
+ "type": "string",
700
+ "nullable": true,
701
+ "description": "The UTC day."
702
+ },
703
+ "billing": {
704
+ "type": "object",
705
+ "properties": {
706
+ "checkoutAvailable": {
707
+ "type": "boolean",
708
+ "description": "True when this user can start a Pro checkout: billing is configured and they are on the free plan."
709
+ },
710
+ "portalAvailable": {
711
+ "type": "boolean",
712
+ "description": "True when the user has a billing account to manage in the Stripe portal."
713
+ }
714
+ },
715
+ "required": [
716
+ "checkoutAvailable",
717
+ "portalAvailable"
718
+ ],
719
+ "description": "What the console may offer."
720
+ }
721
+ },
722
+ "required": [
723
+ "plan",
724
+ "dailyRowWrites",
725
+ "rowsWrittenToday",
726
+ "usagePercent",
727
+ "day",
728
+ "billing"
729
+ ]
730
+ },
731
+ "BillingSessionUrl": {
732
+ "type": "object",
733
+ "properties": {
734
+ "url": {
735
+ "type": "string",
736
+ "format": "uri",
737
+ "description": "The Stripe-hosted page to send the user to. It is single-use and expires."
738
+ }
739
+ },
740
+ "required": [
741
+ "url"
742
+ ]
743
+ }
744
+ },
745
+ "parameters": {}
746
+ },
747
+ "paths": {
748
+ "/health": {
749
+ "get": {
750
+ "security": [],
751
+ "tags": [
752
+ "Health"
753
+ ],
754
+ "operationId": "getHealth",
755
+ "summary": "Get health",
756
+ "x-mint": {
757
+ "metadata": {
758
+ "title": "Get health"
759
+ }
760
+ },
761
+ "responses": {
762
+ "200": {
763
+ "description": "Service is healthy",
764
+ "content": {
765
+ "application/json": {
766
+ "schema": {
767
+ "type": "object",
768
+ "properties": {
769
+ "status": {
770
+ "type": "string"
771
+ },
772
+ "gitSha": {
773
+ "type": "string",
774
+ "nullable": true
775
+ }
776
+ },
777
+ "required": [
778
+ "status",
779
+ "gitSha"
780
+ ]
781
+ }
782
+ }
783
+ }
784
+ }
785
+ }
786
+ }
787
+ },
788
+ "/ready": {
789
+ "get": {
790
+ "security": [],
791
+ "tags": [
792
+ "Health"
793
+ ],
794
+ "operationId": "getReadiness",
795
+ "summary": "Get readiness",
796
+ "description": "Returns ready only when the management database uses the canonical world-identity schema.",
797
+ "x-mint": {
798
+ "metadata": {
799
+ "title": "Get readiness"
800
+ }
801
+ },
802
+ "responses": {
803
+ "200": {
804
+ "description": "World identity schema is ready",
805
+ "content": {
806
+ "application/json": {
807
+ "schema": {
808
+ "type": "object",
809
+ "properties": {
810
+ "status": {
811
+ "type": "string",
812
+ "enum": [
813
+ "ready"
814
+ ]
815
+ }
816
+ },
817
+ "required": [
818
+ "status"
819
+ ]
820
+ }
821
+ }
822
+ }
823
+ },
824
+ "503": {
825
+ "description": "World identity schema is unavailable or incompatible",
826
+ "content": {
827
+ "application/json": {
828
+ "schema": {
829
+ "type": "object",
830
+ "properties": {
831
+ "status": {
832
+ "type": "string",
833
+ "enum": [
834
+ "not_ready"
835
+ ]
836
+ },
837
+ "error": {
838
+ "type": "string"
839
+ }
840
+ },
841
+ "required": [
842
+ "status",
843
+ "error"
844
+ ]
845
+ }
846
+ }
847
+ }
848
+ }
849
+ }
850
+ }
851
+ },
852
+ "/v1/auth/login": {
853
+ "post": {
854
+ "tags": [
855
+ "Auth"
856
+ ],
857
+ "operationId": "login",
858
+ "summary": "Start magic-link login",
859
+ "description": "Sends a one-time code to an allowlisted email. Unauthenticated; limited to 5 requests per minute per IP. Every outcome (missing email, rate-limited, not allowlisted, unconfigured) returns 200 `{ ok: true }` so the endpoint does not reveal which emails are on the beta list; no code is sent to an email that is not allowlisted.",
860
+ "x-mint": {
861
+ "metadata": {
862
+ "title": "Start magic-link login"
863
+ }
864
+ },
865
+ "security": [],
866
+ "requestBody": {
867
+ "content": {
868
+ "application/json": {
869
+ "schema": {
870
+ "$ref": "#/components/schemas/LoginRequest"
871
+ }
872
+ }
873
+ }
874
+ },
875
+ "responses": {
876
+ "200": {
877
+ "description": "Request accepted",
878
+ "content": {
879
+ "application/json": {
880
+ "schema": {
881
+ "$ref": "#/components/schemas/LoginResponse"
882
+ }
883
+ }
884
+ }
885
+ }
886
+ }
887
+ }
888
+ },
889
+ "/v1/auth/verify": {
890
+ "post": {
891
+ "tags": [
892
+ "Auth"
893
+ ],
894
+ "operationId": "verifyLogin",
895
+ "summary": "Redeem login code for a session token",
896
+ "description": "Redeems the WorkOS magic-auth code and mints a `wzp_` session token. Unauthenticated; limited to 10 requests per minute per IP.",
897
+ "x-mint": {
898
+ "metadata": {
899
+ "title": "Redeem login code"
900
+ }
901
+ },
902
+ "security": [],
903
+ "requestBody": {
904
+ "content": {
905
+ "application/json": {
906
+ "schema": {
907
+ "$ref": "#/components/schemas/VerifyRequest"
908
+ }
909
+ }
910
+ }
911
+ },
912
+ "responses": {
913
+ "201": {
914
+ "description": "Session token",
915
+ "content": {
916
+ "application/json": {
917
+ "schema": {
918
+ "$ref": "#/components/schemas/VerifyResponse"
919
+ }
920
+ }
921
+ }
922
+ },
923
+ "400": {
924
+ "description": "INVALID_ARGUMENT, INVALID_CODE, EXPIRED, or AGE_GATE_REQUIRED",
925
+ "content": {
926
+ "application/json": {
927
+ "schema": {
928
+ "$ref": "#/components/schemas/ErrorResponse"
929
+ }
930
+ }
931
+ }
932
+ },
933
+ "401": {
934
+ "description": "Authentication failed",
935
+ "content": {
936
+ "application/json": {
937
+ "schema": {
938
+ "$ref": "#/components/schemas/ErrorResponse"
939
+ }
940
+ }
941
+ }
942
+ },
943
+ "429": {
944
+ "description": "Too many attempts",
945
+ "content": {
946
+ "application/json": {
947
+ "schema": {
948
+ "$ref": "#/components/schemas/ErrorResponse"
949
+ }
950
+ }
951
+ }
952
+ },
953
+ "500": {
954
+ "description": "Auth is not configured",
955
+ "content": {
956
+ "application/json": {
957
+ "schema": {
958
+ "$ref": "#/components/schemas/ErrorResponse"
959
+ }
960
+ }
961
+ }
962
+ }
963
+ }
964
+ }
965
+ },
966
+ "/v1/auth/workos": {
967
+ "post": {
968
+ "tags": [
969
+ "Auth"
970
+ ],
971
+ "operationId": "mintWorkosSession",
972
+ "summary": "Mint a console session token (admin)",
973
+ "description": "Admin-only. Mints a 30-day console session token for an arbitrary email, creating the user when needed. Requires the `admin` scope.",
974
+ "x-mint": {
975
+ "metadata": {
976
+ "title": "Mint console session token"
977
+ }
978
+ },
979
+ "security": [
980
+ {
981
+ "bearerPlatformToken": []
982
+ }
983
+ ],
984
+ "requestBody": {
985
+ "content": {
986
+ "application/json": {
987
+ "schema": {
988
+ "$ref": "#/components/schemas/WorkosSessionRequest"
989
+ }
990
+ }
991
+ }
992
+ },
993
+ "responses": {
994
+ "201": {
995
+ "description": "Console session token",
996
+ "content": {
997
+ "application/json": {
998
+ "schema": {
999
+ "$ref": "#/components/schemas/WorkosSessionResponse"
1000
+ }
1001
+ }
1002
+ }
1003
+ },
1004
+ "400": {
1005
+ "description": "INVALID_ARGUMENT or AGE_GATE_REQUIRED",
1006
+ "content": {
1007
+ "application/json": {
1008
+ "schema": {
1009
+ "$ref": "#/components/schemas/ErrorResponse"
1010
+ }
1011
+ }
1012
+ }
1013
+ },
1014
+ "401": {
1015
+ "description": "Missing or invalid platform token",
1016
+ "content": {
1017
+ "application/json": {
1018
+ "schema": {
1019
+ "$ref": "#/components/schemas/ErrorResponse"
1020
+ }
1021
+ }
1022
+ }
1023
+ },
1024
+ "403": {
1025
+ "description": "Admin scope required",
1026
+ "content": {
1027
+ "application/json": {
1028
+ "schema": {
1029
+ "$ref": "#/components/schemas/ErrorResponse"
1030
+ }
1031
+ }
1032
+ }
1033
+ }
1034
+ }
1035
+ }
1036
+ },
1037
+ "/v1/auth/workos-session": {
1038
+ "post": {
1039
+ "tags": [
1040
+ "Auth"
1041
+ ],
1042
+ "operationId": "createWorkosSession",
1043
+ "summary": "Mint a console session token (deprecated path)",
1044
+ "description": "Deprecated: use `POST /v1/auth/workos`. This path replies with a 308 redirect to it, which keeps the method and body. Admin-only; requires the `admin` scope.",
1045
+ "x-mint": {
1046
+ "metadata": {
1047
+ "title": "Mint console session token (deprecated)"
1048
+ }
1049
+ },
1050
+ "security": [
1051
+ {
1052
+ "bearerPlatformToken": []
1053
+ }
1054
+ ],
1055
+ "deprecated": true,
1056
+ "requestBody": {
1057
+ "content": {
1058
+ "application/json": {
1059
+ "schema": {
1060
+ "$ref": "#/components/schemas/WorkosSessionRequest"
1061
+ }
1062
+ }
1063
+ }
1064
+ },
1065
+ "responses": {
1066
+ "201": {
1067
+ "description": "Console session token",
1068
+ "content": {
1069
+ "application/json": {
1070
+ "schema": {
1071
+ "$ref": "#/components/schemas/WorkosSessionResponse"
1072
+ }
1073
+ }
1074
+ }
1075
+ },
1076
+ "308": {
1077
+ "description": "Permanent redirect to `/v1/auth/workos`",
1078
+ "headers": {
1079
+ "Location": {
1080
+ "schema": {
1081
+ "type": "string"
1082
+ },
1083
+ "required": true
1084
+ }
1085
+ }
1086
+ },
1087
+ "400": {
1088
+ "description": "INVALID_ARGUMENT or AGE_GATE_REQUIRED",
1089
+ "content": {
1090
+ "application/json": {
1091
+ "schema": {
1092
+ "$ref": "#/components/schemas/ErrorResponse"
1093
+ }
1094
+ }
1095
+ }
1096
+ },
1097
+ "401": {
1098
+ "description": "Missing or invalid platform token",
1099
+ "content": {
1100
+ "application/json": {
1101
+ "schema": {
1102
+ "$ref": "#/components/schemas/ErrorResponse"
1103
+ }
1104
+ }
1105
+ }
1106
+ },
1107
+ "403": {
1108
+ "description": "Admin scope required",
1109
+ "content": {
1110
+ "application/json": {
1111
+ "schema": {
1112
+ "$ref": "#/components/schemas/ErrorResponse"
1113
+ }
1114
+ }
1115
+ }
1116
+ }
1117
+ }
1118
+ }
1119
+ },
1120
+ "/v1/users/me": {
1121
+ "get": {
1122
+ "tags": [
1123
+ "Users"
1124
+ ],
1125
+ "operationId": "getUserMe",
1126
+ "summary": "Get authenticated user",
1127
+ "x-mint": {
1128
+ "metadata": {
1129
+ "title": "Get authenticated user"
1130
+ }
1131
+ },
1132
+ "security": [
1133
+ {
1134
+ "bearerPlatformToken": []
1135
+ }
1136
+ ],
1137
+ "responses": {
1138
+ "200": {
1139
+ "description": "Authenticated user",
1140
+ "content": {
1141
+ "application/json": {
1142
+ "schema": {
1143
+ "type": "object",
1144
+ "properties": {
1145
+ "user": {
1146
+ "$ref": "#/components/schemas/User"
1147
+ }
1148
+ },
1149
+ "required": [
1150
+ "user"
1151
+ ]
1152
+ }
1153
+ }
1154
+ }
1155
+ },
1156
+ "404": {
1157
+ "description": "User not found",
1158
+ "content": {
1159
+ "application/json": {
1160
+ "schema": {
1161
+ "type": "object",
1162
+ "properties": {
1163
+ "error": {
1164
+ "type": "object",
1165
+ "properties": {
1166
+ "code": {
1167
+ "type": "string"
1168
+ },
1169
+ "message": {
1170
+ "type": "string"
1171
+ }
1172
+ },
1173
+ "required": [
1174
+ "code",
1175
+ "message"
1176
+ ]
1177
+ }
1178
+ },
1179
+ "required": [
1180
+ "error"
1181
+ ]
1182
+ }
1183
+ }
1184
+ }
1185
+ }
1186
+ }
1187
+ },
1188
+ "delete": {
1189
+ "tags": [
1190
+ "Users"
1191
+ ],
1192
+ "operationId": "deleteUserMe",
1193
+ "summary": "Delete the authenticated user's account (two-step confirmation)",
1194
+ "x-mint": {
1195
+ "metadata": {
1196
+ "title": "Delete account"
1197
+ }
1198
+ },
1199
+ "security": [
1200
+ {
1201
+ "bearerPlatformToken": []
1202
+ }
1203
+ ],
1204
+ "requestBody": {
1205
+ "required": true,
1206
+ "content": {
1207
+ "application/json": {
1208
+ "schema": {
1209
+ "type": "object",
1210
+ "properties": {
1211
+ "confirmationToken": {
1212
+ "type": "string"
1213
+ }
1214
+ },
1215
+ "required": [
1216
+ "confirmationToken"
1217
+ ]
1218
+ }
1219
+ }
1220
+ }
1221
+ },
1222
+ "responses": {
1223
+ "204": {
1224
+ "description": "Account deleted"
1225
+ },
1226
+ "400": {
1227
+ "description": "Invalid or expired confirmation token",
1228
+ "content": {
1229
+ "application/json": {
1230
+ "schema": {
1231
+ "type": "object",
1232
+ "properties": {
1233
+ "error": {
1234
+ "type": "object",
1235
+ "properties": {
1236
+ "code": {
1237
+ "type": "string"
1238
+ },
1239
+ "message": {
1240
+ "type": "string"
1241
+ }
1242
+ },
1243
+ "required": [
1244
+ "code",
1245
+ "message"
1246
+ ]
1247
+ }
1248
+ },
1249
+ "required": [
1250
+ "error"
1251
+ ]
1252
+ }
1253
+ }
1254
+ }
1255
+ },
1256
+ "401": {
1257
+ "description": "Not authenticated as a user",
1258
+ "content": {
1259
+ "application/json": {
1260
+ "schema": {
1261
+ "type": "object",
1262
+ "properties": {
1263
+ "error": {
1264
+ "type": "object",
1265
+ "properties": {
1266
+ "code": {
1267
+ "type": "string"
1268
+ },
1269
+ "message": {
1270
+ "type": "string"
1271
+ }
1272
+ },
1273
+ "required": [
1274
+ "code",
1275
+ "message"
1276
+ ]
1277
+ }
1278
+ },
1279
+ "required": [
1280
+ "error"
1281
+ ]
1282
+ }
1283
+ }
1284
+ }
1285
+ }
1286
+ }
1287
+ }
1288
+ },
1289
+ "/v1/users/me/deletion": {
1290
+ "post": {
1291
+ "tags": [
1292
+ "Users"
1293
+ ],
1294
+ "operationId": "initiateAccountDeletion",
1295
+ "summary": "Initiate account deletion (returns a short-lived confirmation token)",
1296
+ "x-mint": {
1297
+ "metadata": {
1298
+ "title": "Initiate account deletion"
1299
+ }
1300
+ },
1301
+ "security": [
1302
+ {
1303
+ "bearerPlatformToken": []
1304
+ }
1305
+ ],
1306
+ "responses": {
1307
+ "201": {
1308
+ "description": "Deletion initiated",
1309
+ "content": {
1310
+ "application/json": {
1311
+ "schema": {
1312
+ "type": "object",
1313
+ "properties": {
1314
+ "deletion": {
1315
+ "type": "object",
1316
+ "properties": {
1317
+ "uid": {
1318
+ "type": "string"
1319
+ },
1320
+ "expiresAt": {
1321
+ "type": "string"
1322
+ }
1323
+ },
1324
+ "required": [
1325
+ "uid",
1326
+ "expiresAt"
1327
+ ]
1328
+ },
1329
+ "confirmationToken": {
1330
+ "type": "string"
1331
+ },
1332
+ "message": {
1333
+ "type": "string"
1334
+ }
1335
+ },
1336
+ "required": [
1337
+ "deletion",
1338
+ "confirmationToken",
1339
+ "message"
1340
+ ]
1341
+ }
1342
+ }
1343
+ }
1344
+ },
1345
+ "401": {
1346
+ "description": "Not authenticated as a user",
1347
+ "content": {
1348
+ "application/json": {
1349
+ "schema": {
1350
+ "type": "object",
1351
+ "properties": {
1352
+ "error": {
1353
+ "type": "object",
1354
+ "properties": {
1355
+ "code": {
1356
+ "type": "string"
1357
+ },
1358
+ "message": {
1359
+ "type": "string"
1360
+ }
1361
+ },
1362
+ "required": [
1363
+ "code",
1364
+ "message"
1365
+ ]
1366
+ }
1367
+ },
1368
+ "required": [
1369
+ "error"
1370
+ ]
1371
+ }
1372
+ }
1373
+ }
1374
+ }
1375
+ }
1376
+ }
1377
+ },
1378
+ "/v1/users/me/export": {
1379
+ "get": {
1380
+ "tags": [
1381
+ "Users"
1382
+ ],
1383
+ "operationId": "exportUserMe",
1384
+ "summary": "Export the data Wazoo holds on the authenticated user",
1385
+ "x-mint": {
1386
+ "metadata": {
1387
+ "title": "Export user data"
1388
+ }
1389
+ },
1390
+ "security": [
1391
+ {
1392
+ "bearerPlatformToken": []
1393
+ }
1394
+ ],
1395
+ "responses": {
1396
+ "200": {
1397
+ "description": "User data export",
1398
+ "content": {
1399
+ "application/json": {
1400
+ "schema": {
1401
+ "type": "object",
1402
+ "properties": {
1403
+ "user": {
1404
+ "$ref": "#/components/schemas/User"
1405
+ },
1406
+ "worlds": {
1407
+ "type": "array",
1408
+ "items": {
1409
+ "type": "object",
1410
+ "properties": {
1411
+ "id": {
1412
+ "type": "string"
1413
+ },
1414
+ "displayName": {
1415
+ "type": "string"
1416
+ },
1417
+ "state": {
1418
+ "type": "string"
1419
+ },
1420
+ "createTime": {
1421
+ "type": "string"
1422
+ },
1423
+ "deleteTime": {
1424
+ "type": "string",
1425
+ "nullable": true
1426
+ }
1427
+ },
1428
+ "required": [
1429
+ "id",
1430
+ "displayName",
1431
+ "state"
1432
+ ]
1433
+ }
1434
+ },
1435
+ "apiTokens": {
1436
+ "type": "array",
1437
+ "items": {
1438
+ "type": "object",
1439
+ "properties": {
1440
+ "uid": {
1441
+ "type": "string"
1442
+ },
1443
+ "name": {
1444
+ "type": "string"
1445
+ },
1446
+ "scope": {
1447
+ "type": "string"
1448
+ },
1449
+ "createTime": {
1450
+ "type": "string"
1451
+ }
1452
+ },
1453
+ "required": [
1454
+ "uid",
1455
+ "name",
1456
+ "scope"
1457
+ ]
1458
+ }
1459
+ },
1460
+ "usageEvents": {
1461
+ "type": "array",
1462
+ "items": {
1463
+ "type": "object",
1464
+ "properties": {
1465
+ "metric": {
1466
+ "type": "string"
1467
+ },
1468
+ "quantity": {
1469
+ "type": "number"
1470
+ },
1471
+ "unit": {
1472
+ "type": "string"
1473
+ },
1474
+ "createTime": {
1475
+ "type": "string"
1476
+ }
1477
+ },
1478
+ "required": [
1479
+ "metric",
1480
+ "quantity",
1481
+ "unit",
1482
+ "createTime"
1483
+ ]
1484
+ }
1485
+ }
1486
+ },
1487
+ "required": [
1488
+ "user",
1489
+ "worlds",
1490
+ "apiTokens",
1491
+ "usageEvents"
1492
+ ]
1493
+ }
1494
+ }
1495
+ }
1496
+ },
1497
+ "401": {
1498
+ "description": "Not authenticated as a user",
1499
+ "content": {
1500
+ "application/json": {
1501
+ "schema": {
1502
+ "type": "object",
1503
+ "properties": {
1504
+ "error": {
1505
+ "type": "object",
1506
+ "properties": {
1507
+ "code": {
1508
+ "type": "string"
1509
+ },
1510
+ "message": {
1511
+ "type": "string"
1512
+ }
1513
+ },
1514
+ "required": [
1515
+ "code",
1516
+ "message"
1517
+ ]
1518
+ }
1519
+ },
1520
+ "required": [
1521
+ "error"
1522
+ ]
1523
+ }
1524
+ }
1525
+ }
1526
+ }
1527
+ }
1528
+ }
1529
+ },
1530
+ "/v1/users/me/embedding-providers": {
1531
+ "get": {
1532
+ "tags": [
1533
+ "Embeddings"
1534
+ ],
1535
+ "operationId": "listEmbeddingProviders",
1536
+ "summary": "List embedding provider credentials",
1537
+ "description": "Lists the caller's bring-your-own-key embedding credentials, revoked ones included so their status stays readable. Metadata only: a key is never returned.",
1538
+ "x-mint": {
1539
+ "metadata": {
1540
+ "title": "List embedding provider credentials"
1541
+ }
1542
+ },
1543
+ "security": [
1544
+ {
1545
+ "bearerPlatformToken": []
1546
+ }
1547
+ ],
1548
+ "responses": {
1549
+ "200": {
1550
+ "description": "Credential metadata, one entry per provider",
1551
+ "content": {
1552
+ "application/json": {
1553
+ "schema": {
1554
+ "$ref": "#/components/schemas/EmbeddingProviderList"
1555
+ }
1556
+ }
1557
+ }
1558
+ },
1559
+ "401": {
1560
+ "description": "Not authenticated as a user",
1561
+ "content": {
1562
+ "application/json": {
1563
+ "schema": {
1564
+ "type": "object",
1565
+ "properties": {
1566
+ "error": {
1567
+ "type": "object",
1568
+ "properties": {
1569
+ "code": {
1570
+ "type": "string"
1571
+ },
1572
+ "message": {
1573
+ "type": "string"
1574
+ }
1575
+ },
1576
+ "required": [
1577
+ "code",
1578
+ "message"
1579
+ ]
1580
+ }
1581
+ },
1582
+ "required": [
1583
+ "error"
1584
+ ]
1585
+ }
1586
+ }
1587
+ }
1588
+ },
1589
+ "403": {
1590
+ "description": "Missing scope",
1591
+ "content": {
1592
+ "application/json": {
1593
+ "schema": {
1594
+ "type": "object",
1595
+ "properties": {
1596
+ "error": {
1597
+ "type": "object",
1598
+ "properties": {
1599
+ "code": {
1600
+ "type": "string"
1601
+ },
1602
+ "message": {
1603
+ "type": "string"
1604
+ }
1605
+ },
1606
+ "required": [
1607
+ "code",
1608
+ "message"
1609
+ ]
1610
+ }
1611
+ },
1612
+ "required": [
1613
+ "error"
1614
+ ]
1615
+ }
1616
+ }
1617
+ }
1618
+ }
1619
+ }
1620
+ }
1621
+ },
1622
+ "/v1/users/me/embedding-providers/{provider}": {
1623
+ "put": {
1624
+ "tags": [
1625
+ "Embeddings"
1626
+ ],
1627
+ "operationId": "setEmbeddingProviderCredential",
1628
+ "summary": "Set an embedding provider credential",
1629
+ "description": "Stores or rotates the caller's API key for one embedding provider. The key is encrypted at rest, write-only, and never returned or logged. Choose a model, reindex, and search with a world token on the data plane afterwards. Returns 503 EMBEDDINGS_NOT_CONFIGURED when the deployment has embeddings disabled.",
1630
+ "x-mint": {
1631
+ "metadata": {
1632
+ "title": "Set an embedding provider credential"
1633
+ }
1634
+ },
1635
+ "security": [
1636
+ {
1637
+ "bearerPlatformToken": []
1638
+ }
1639
+ ],
1640
+ "parameters": [
1641
+ {
1642
+ "schema": {
1643
+ "type": "string",
1644
+ "enum": [
1645
+ "openai",
1646
+ "openrouter"
1647
+ ],
1648
+ "description": "Embedding provider this credential addresses. A user holds at most one credential per provider."
1649
+ },
1650
+ "required": true,
1651
+ "description": "Embedding provider this credential addresses. A user holds at most one credential per provider.",
1652
+ "name": "provider",
1653
+ "in": "path"
1654
+ }
1655
+ ],
1656
+ "requestBody": {
1657
+ "required": true,
1658
+ "content": {
1659
+ "application/json": {
1660
+ "schema": {
1661
+ "type": "object",
1662
+ "properties": {
1663
+ "apiKey": {
1664
+ "type": "string",
1665
+ "description": "The provider API key: 16 to 512 printable characters with no whitespace."
1666
+ }
1667
+ },
1668
+ "required": [
1669
+ "apiKey"
1670
+ ]
1671
+ }
1672
+ }
1673
+ }
1674
+ },
1675
+ "responses": {
1676
+ "200": {
1677
+ "description": "Credential stored; metadata only",
1678
+ "content": {
1679
+ "application/json": {
1680
+ "schema": {
1681
+ "$ref": "#/components/schemas/EmbeddingCredential"
1682
+ }
1683
+ }
1684
+ }
1685
+ },
1686
+ "400": {
1687
+ "description": "Bad request",
1688
+ "content": {
1689
+ "application/json": {
1690
+ "schema": {
1691
+ "type": "object",
1692
+ "properties": {
1693
+ "error": {
1694
+ "type": "object",
1695
+ "properties": {
1696
+ "code": {
1697
+ "type": "string"
1698
+ },
1699
+ "message": {
1700
+ "type": "string"
1701
+ }
1702
+ },
1703
+ "required": [
1704
+ "code",
1705
+ "message"
1706
+ ]
1707
+ }
1708
+ },
1709
+ "required": [
1710
+ "error"
1711
+ ]
1712
+ }
1713
+ }
1714
+ }
1715
+ },
1716
+ "401": {
1717
+ "description": "Not authenticated as a user",
1718
+ "content": {
1719
+ "application/json": {
1720
+ "schema": {
1721
+ "type": "object",
1722
+ "properties": {
1723
+ "error": {
1724
+ "type": "object",
1725
+ "properties": {
1726
+ "code": {
1727
+ "type": "string"
1728
+ },
1729
+ "message": {
1730
+ "type": "string"
1731
+ }
1732
+ },
1733
+ "required": [
1734
+ "code",
1735
+ "message"
1736
+ ]
1737
+ }
1738
+ },
1739
+ "required": [
1740
+ "error"
1741
+ ]
1742
+ }
1743
+ }
1744
+ }
1745
+ },
1746
+ "403": {
1747
+ "description": "Missing scope",
1748
+ "content": {
1749
+ "application/json": {
1750
+ "schema": {
1751
+ "type": "object",
1752
+ "properties": {
1753
+ "error": {
1754
+ "type": "object",
1755
+ "properties": {
1756
+ "code": {
1757
+ "type": "string"
1758
+ },
1759
+ "message": {
1760
+ "type": "string"
1761
+ }
1762
+ },
1763
+ "required": [
1764
+ "code",
1765
+ "message"
1766
+ ]
1767
+ }
1768
+ },
1769
+ "required": [
1770
+ "error"
1771
+ ]
1772
+ }
1773
+ }
1774
+ }
1775
+ },
1776
+ "503": {
1777
+ "description": "Embeddings are not configured on this deployment",
1778
+ "content": {
1779
+ "application/json": {
1780
+ "schema": {
1781
+ "type": "object",
1782
+ "properties": {
1783
+ "error": {
1784
+ "type": "object",
1785
+ "properties": {
1786
+ "code": {
1787
+ "type": "string"
1788
+ },
1789
+ "message": {
1790
+ "type": "string"
1791
+ }
1792
+ },
1793
+ "required": [
1794
+ "code",
1795
+ "message"
1796
+ ]
1797
+ }
1798
+ },
1799
+ "required": [
1800
+ "error"
1801
+ ]
1802
+ }
1803
+ }
1804
+ }
1805
+ }
1806
+ }
1807
+ },
1808
+ "get": {
1809
+ "tags": [
1810
+ "Embeddings"
1811
+ ],
1812
+ "operationId": "getEmbeddingProviderCredential",
1813
+ "summary": "Get an embedding provider credential's status",
1814
+ "description": "Returns the metadata of the caller's credential for one provider. The key itself is never returned.",
1815
+ "x-mint": {
1816
+ "metadata": {
1817
+ "title": "Get an embedding provider credential"
1818
+ }
1819
+ },
1820
+ "security": [
1821
+ {
1822
+ "bearerPlatformToken": []
1823
+ }
1824
+ ],
1825
+ "parameters": [
1826
+ {
1827
+ "schema": {
1828
+ "type": "string",
1829
+ "enum": [
1830
+ "openai",
1831
+ "openrouter"
1832
+ ],
1833
+ "description": "Embedding provider this credential addresses. A user holds at most one credential per provider."
1834
+ },
1835
+ "required": true,
1836
+ "description": "Embedding provider this credential addresses. A user holds at most one credential per provider.",
1837
+ "name": "provider",
1838
+ "in": "path"
1839
+ }
1840
+ ],
1841
+ "responses": {
1842
+ "200": {
1843
+ "description": "Credential metadata",
1844
+ "content": {
1845
+ "application/json": {
1846
+ "schema": {
1847
+ "$ref": "#/components/schemas/EmbeddingCredential"
1848
+ }
1849
+ }
1850
+ }
1851
+ },
1852
+ "401": {
1853
+ "description": "Not authenticated as a user",
1854
+ "content": {
1855
+ "application/json": {
1856
+ "schema": {
1857
+ "type": "object",
1858
+ "properties": {
1859
+ "error": {
1860
+ "type": "object",
1861
+ "properties": {
1862
+ "code": {
1863
+ "type": "string"
1864
+ },
1865
+ "message": {
1866
+ "type": "string"
1867
+ }
1868
+ },
1869
+ "required": [
1870
+ "code",
1871
+ "message"
1872
+ ]
1873
+ }
1874
+ },
1875
+ "required": [
1876
+ "error"
1877
+ ]
1878
+ }
1879
+ }
1880
+ }
1881
+ },
1882
+ "403": {
1883
+ "description": "Missing scope",
1884
+ "content": {
1885
+ "application/json": {
1886
+ "schema": {
1887
+ "type": "object",
1888
+ "properties": {
1889
+ "error": {
1890
+ "type": "object",
1891
+ "properties": {
1892
+ "code": {
1893
+ "type": "string"
1894
+ },
1895
+ "message": {
1896
+ "type": "string"
1897
+ }
1898
+ },
1899
+ "required": [
1900
+ "code",
1901
+ "message"
1902
+ ]
1903
+ }
1904
+ },
1905
+ "required": [
1906
+ "error"
1907
+ ]
1908
+ }
1909
+ }
1910
+ }
1911
+ },
1912
+ "404": {
1913
+ "description": "No credential",
1914
+ "content": {
1915
+ "application/json": {
1916
+ "schema": {
1917
+ "type": "object",
1918
+ "properties": {
1919
+ "error": {
1920
+ "type": "object",
1921
+ "properties": {
1922
+ "code": {
1923
+ "type": "string"
1924
+ },
1925
+ "message": {
1926
+ "type": "string"
1927
+ }
1928
+ },
1929
+ "required": [
1930
+ "code",
1931
+ "message"
1932
+ ]
1933
+ }
1934
+ },
1935
+ "required": [
1936
+ "error"
1937
+ ]
1938
+ }
1939
+ }
1940
+ }
1941
+ }
1942
+ }
1943
+ },
1944
+ "delete": {
1945
+ "tags": [
1946
+ "Embeddings"
1947
+ ],
1948
+ "operationId": "deleteEmbeddingProviderCredential",
1949
+ "summary": "Revoke an embedding provider credential",
1950
+ "description": "Revokes the caller's credential for one provider. The stored key is erased and every world on that provider's models falls back to keyword search until a new key is stored and the world is reindexed. Worlds on another provider's models are not affected.",
1951
+ "x-mint": {
1952
+ "metadata": {
1953
+ "title": "Revoke an embedding provider credential"
1954
+ }
1955
+ },
1956
+ "security": [
1957
+ {
1958
+ "bearerPlatformToken": []
1959
+ }
1960
+ ],
1961
+ "parameters": [
1962
+ {
1963
+ "schema": {
1964
+ "type": "string",
1965
+ "enum": [
1966
+ "openai",
1967
+ "openrouter"
1968
+ ],
1969
+ "description": "Embedding provider this credential addresses. A user holds at most one credential per provider."
1970
+ },
1971
+ "required": true,
1972
+ "description": "Embedding provider this credential addresses. A user holds at most one credential per provider.",
1973
+ "name": "provider",
1974
+ "in": "path"
1975
+ }
1976
+ ],
1977
+ "responses": {
1978
+ "204": {
1979
+ "description": "Revoked"
1980
+ },
1981
+ "401": {
1982
+ "description": "Not authenticated as a user",
1983
+ "content": {
1984
+ "application/json": {
1985
+ "schema": {
1986
+ "type": "object",
1987
+ "properties": {
1988
+ "error": {
1989
+ "type": "object",
1990
+ "properties": {
1991
+ "code": {
1992
+ "type": "string"
1993
+ },
1994
+ "message": {
1995
+ "type": "string"
1996
+ }
1997
+ },
1998
+ "required": [
1999
+ "code",
2000
+ "message"
2001
+ ]
2002
+ }
2003
+ },
2004
+ "required": [
2005
+ "error"
2006
+ ]
2007
+ }
2008
+ }
2009
+ }
2010
+ },
2011
+ "403": {
2012
+ "description": "Missing scope",
2013
+ "content": {
2014
+ "application/json": {
2015
+ "schema": {
2016
+ "type": "object",
2017
+ "properties": {
2018
+ "error": {
2019
+ "type": "object",
2020
+ "properties": {
2021
+ "code": {
2022
+ "type": "string"
2023
+ },
2024
+ "message": {
2025
+ "type": "string"
2026
+ }
2027
+ },
2028
+ "required": [
2029
+ "code",
2030
+ "message"
2031
+ ]
2032
+ }
2033
+ },
2034
+ "required": [
2035
+ "error"
2036
+ ]
2037
+ }
2038
+ }
2039
+ }
2040
+ },
2041
+ "404": {
2042
+ "description": "No credential",
2043
+ "content": {
2044
+ "application/json": {
2045
+ "schema": {
2046
+ "type": "object",
2047
+ "properties": {
2048
+ "error": {
2049
+ "type": "object",
2050
+ "properties": {
2051
+ "code": {
2052
+ "type": "string"
2053
+ },
2054
+ "message": {
2055
+ "type": "string"
2056
+ }
2057
+ },
2058
+ "required": [
2059
+ "code",
2060
+ "message"
2061
+ ]
2062
+ }
2063
+ },
2064
+ "required": [
2065
+ "error"
2066
+ ]
2067
+ }
2068
+ }
2069
+ }
2070
+ }
2071
+ }
2072
+ }
2073
+ },
2074
+ "/v1/worlds": {
2075
+ "get": {
2076
+ "tags": [
2077
+ "Worlds"
2078
+ ],
2079
+ "operationId": "listWorlds",
2080
+ "summary": "List worlds",
2081
+ "x-mint": {
2082
+ "metadata": {
2083
+ "title": "List worlds"
2084
+ }
2085
+ },
2086
+ "security": [
2087
+ {
2088
+ "bearerPlatformToken": []
2089
+ }
2090
+ ],
2091
+ "parameters": [
2092
+ {
2093
+ "schema": {
2094
+ "type": "string",
2095
+ "format": "email"
2096
+ },
2097
+ "required": false,
2098
+ "name": "email",
2099
+ "in": "query",
2100
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2101
+ }
2102
+ ],
2103
+ "responses": {
2104
+ "200": {
2105
+ "description": "World list",
2106
+ "content": {
2107
+ "application/json": {
2108
+ "schema": {
2109
+ "type": "object",
2110
+ "properties": {
2111
+ "worlds": {
2112
+ "type": "array",
2113
+ "items": {
2114
+ "$ref": "#/components/schemas/World"
2115
+ }
2116
+ }
2117
+ },
2118
+ "required": [
2119
+ "worlds"
2120
+ ]
2121
+ }
2122
+ }
2123
+ }
2124
+ }
2125
+ }
2126
+ },
2127
+ "post": {
2128
+ "tags": [
2129
+ "Worlds"
2130
+ ],
2131
+ "operationId": "createWorld",
2132
+ "summary": "Create world",
2133
+ "x-mint": {
2134
+ "metadata": {
2135
+ "title": "Create world"
2136
+ }
2137
+ },
2138
+ "security": [
2139
+ {
2140
+ "bearerPlatformToken": []
2141
+ }
2142
+ ],
2143
+ "requestBody": {
2144
+ "required": true,
2145
+ "content": {
2146
+ "application/json": {
2147
+ "schema": {
2148
+ "$ref": "#/components/schemas/CreateWorldRequest"
2149
+ }
2150
+ }
2151
+ }
2152
+ },
2153
+ "responses": {
2154
+ "201": {
2155
+ "description": "Created World",
2156
+ "content": {
2157
+ "application/json": {
2158
+ "schema": {
2159
+ "type": "object",
2160
+ "properties": {
2161
+ "world": {
2162
+ "$ref": "#/components/schemas/World"
2163
+ }
2164
+ },
2165
+ "required": [
2166
+ "world"
2167
+ ]
2168
+ }
2169
+ }
2170
+ }
2171
+ },
2172
+ "400": {
2173
+ "description": "Bad request",
2174
+ "content": {
2175
+ "application/json": {
2176
+ "schema": {
2177
+ "type": "object",
2178
+ "properties": {
2179
+ "error": {
2180
+ "type": "object",
2181
+ "properties": {
2182
+ "code": {
2183
+ "type": "string"
2184
+ },
2185
+ "message": {
2186
+ "type": "string"
2187
+ }
2188
+ },
2189
+ "required": [
2190
+ "code",
2191
+ "message"
2192
+ ]
2193
+ }
2194
+ },
2195
+ "required": [
2196
+ "error"
2197
+ ]
2198
+ }
2199
+ }
2200
+ }
2201
+ },
2202
+ "409": {
2203
+ "description": "World ID already exists",
2204
+ "content": {
2205
+ "application/json": {
2206
+ "schema": {
2207
+ "$ref": "#/components/schemas/ErrorResponse"
2208
+ }
2209
+ }
2210
+ }
2211
+ },
2212
+ "429": {
2213
+ "description": "Quota exceeded",
2214
+ "content": {
2215
+ "application/json": {
2216
+ "schema": {
2217
+ "type": "object",
2218
+ "properties": {
2219
+ "error": {
2220
+ "type": "object",
2221
+ "properties": {
2222
+ "code": {
2223
+ "type": "string"
2224
+ },
2225
+ "message": {
2226
+ "type": "string"
2227
+ }
2228
+ },
2229
+ "required": [
2230
+ "code",
2231
+ "message"
2232
+ ]
2233
+ },
2234
+ "quota": {
2235
+ "type": "object",
2236
+ "properties": {
2237
+ "state": {
2238
+ "type": "string"
2239
+ },
2240
+ "reason": {
2241
+ "type": "string"
2242
+ },
2243
+ "usagePercent": {
2244
+ "type": "number"
2245
+ }
2246
+ },
2247
+ "required": [
2248
+ "state"
2249
+ ]
2250
+ }
2251
+ },
2252
+ "required": [
2253
+ "error",
2254
+ "quota"
2255
+ ]
2256
+ }
2257
+ }
2258
+ }
2259
+ },
2260
+ "502": {
2261
+ "description": "World provisioning failed",
2262
+ "content": {
2263
+ "application/json": {
2264
+ "schema": {
2265
+ "$ref": "#/components/schemas/ErrorResponse"
2266
+ }
2267
+ }
2268
+ }
2269
+ }
2270
+ }
2271
+ }
2272
+ },
2273
+ "/v1/worlds/{worldId}": {
2274
+ "get": {
2275
+ "tags": [
2276
+ "Worlds"
2277
+ ],
2278
+ "operationId": "getWorld",
2279
+ "summary": "Get world",
2280
+ "x-mint": {
2281
+ "metadata": {
2282
+ "title": "Get world"
2283
+ }
2284
+ },
2285
+ "security": [
2286
+ {
2287
+ "bearerPlatformToken": []
2288
+ }
2289
+ ],
2290
+ "parameters": [
2291
+ {
2292
+ "schema": {
2293
+ "type": "string",
2294
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
2295
+ "description": "World ID minted by worlds-api in w_<ULID> form."
2296
+ },
2297
+ "required": true,
2298
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
2299
+ "name": "worldId",
2300
+ "in": "path"
2301
+ },
2302
+ {
2303
+ "schema": {
2304
+ "type": "string",
2305
+ "format": "email"
2306
+ },
2307
+ "required": false,
2308
+ "name": "email",
2309
+ "in": "query",
2310
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2311
+ }
2312
+ ],
2313
+ "responses": {
2314
+ "200": {
2315
+ "description": "World",
2316
+ "content": {
2317
+ "application/json": {
2318
+ "schema": {
2319
+ "type": "object",
2320
+ "properties": {
2321
+ "world": {
2322
+ "$ref": "#/components/schemas/World"
2323
+ }
2324
+ },
2325
+ "required": [
2326
+ "world"
2327
+ ]
2328
+ }
2329
+ }
2330
+ }
2331
+ },
2332
+ "404": {
2333
+ "description": "Not found",
2334
+ "content": {
2335
+ "application/json": {
2336
+ "schema": {
2337
+ "type": "object",
2338
+ "properties": {
2339
+ "error": {
2340
+ "type": "object",
2341
+ "properties": {
2342
+ "code": {
2343
+ "type": "string"
2344
+ },
2345
+ "message": {
2346
+ "type": "string"
2347
+ }
2348
+ },
2349
+ "required": [
2350
+ "code",
2351
+ "message"
2352
+ ]
2353
+ }
2354
+ },
2355
+ "required": [
2356
+ "error"
2357
+ ]
2358
+ }
2359
+ }
2360
+ }
2361
+ }
2362
+ }
2363
+ },
2364
+ "patch": {
2365
+ "tags": [
2366
+ "Worlds"
2367
+ ],
2368
+ "operationId": "updateWorld",
2369
+ "summary": "Update world",
2370
+ "x-mint": {
2371
+ "metadata": {
2372
+ "title": "Update world"
2373
+ }
2374
+ },
2375
+ "security": [
2376
+ {
2377
+ "bearerPlatformToken": []
2378
+ }
2379
+ ],
2380
+ "parameters": [
2381
+ {
2382
+ "schema": {
2383
+ "type": "string",
2384
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
2385
+ "description": "World ID minted by worlds-api in w_<ULID> form."
2386
+ },
2387
+ "required": true,
2388
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
2389
+ "name": "worldId",
2390
+ "in": "path"
2391
+ },
2392
+ {
2393
+ "schema": {
2394
+ "type": "string",
2395
+ "format": "email"
2396
+ },
2397
+ "required": false,
2398
+ "name": "email",
2399
+ "in": "query",
2400
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2401
+ }
2402
+ ],
2403
+ "requestBody": {
2404
+ "required": true,
2405
+ "content": {
2406
+ "application/json": {
2407
+ "schema": {
2408
+ "$ref": "#/components/schemas/UpdateWorldRequest"
2409
+ }
2410
+ }
2411
+ }
2412
+ },
2413
+ "responses": {
2414
+ "200": {
2415
+ "description": "Updated World",
2416
+ "content": {
2417
+ "application/json": {
2418
+ "schema": {
2419
+ "type": "object",
2420
+ "properties": {
2421
+ "world": {
2422
+ "$ref": "#/components/schemas/World"
2423
+ }
2424
+ },
2425
+ "required": [
2426
+ "world"
2427
+ ]
2428
+ }
2429
+ }
2430
+ }
2431
+ },
2432
+ "400": {
2433
+ "description": "Bad request",
2434
+ "content": {
2435
+ "application/json": {
2436
+ "schema": {
2437
+ "type": "object",
2438
+ "properties": {
2439
+ "error": {
2440
+ "type": "object",
2441
+ "properties": {
2442
+ "code": {
2443
+ "type": "string"
2444
+ },
2445
+ "message": {
2446
+ "type": "string"
2447
+ }
2448
+ },
2449
+ "required": [
2450
+ "code",
2451
+ "message"
2452
+ ]
2453
+ }
2454
+ },
2455
+ "required": [
2456
+ "error"
2457
+ ]
2458
+ }
2459
+ }
2460
+ }
2461
+ }
2462
+ }
2463
+ },
2464
+ "delete": {
2465
+ "tags": [
2466
+ "Worlds"
2467
+ ],
2468
+ "operationId": "deleteWorld",
2469
+ "summary": "Delete world",
2470
+ "x-mint": {
2471
+ "metadata": {
2472
+ "title": "Delete world"
2473
+ }
2474
+ },
2475
+ "security": [
2476
+ {
2477
+ "bearerPlatformToken": []
2478
+ }
2479
+ ],
2480
+ "parameters": [
2481
+ {
2482
+ "schema": {
2483
+ "type": "string",
2484
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
2485
+ "description": "World ID minted by worlds-api in w_<ULID> form."
2486
+ },
2487
+ "required": true,
2488
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
2489
+ "name": "worldId",
2490
+ "in": "path"
2491
+ },
2492
+ {
2493
+ "schema": {
2494
+ "type": "string",
2495
+ "format": "email"
2496
+ },
2497
+ "required": false,
2498
+ "name": "email",
2499
+ "in": "query",
2500
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2501
+ }
2502
+ ],
2503
+ "responses": {
2504
+ "200": {
2505
+ "description": "Deleted World",
2506
+ "content": {
2507
+ "application/json": {
2508
+ "schema": {
2509
+ "type": "object",
2510
+ "properties": {
2511
+ "world": {
2512
+ "$ref": "#/components/schemas/World"
2513
+ }
2514
+ },
2515
+ "required": [
2516
+ "world"
2517
+ ]
2518
+ }
2519
+ }
2520
+ }
2521
+ },
2522
+ "404": {
2523
+ "description": "Not found",
2524
+ "content": {
2525
+ "application/json": {
2526
+ "schema": {
2527
+ "type": "object",
2528
+ "properties": {
2529
+ "error": {
2530
+ "type": "object",
2531
+ "properties": {
2532
+ "code": {
2533
+ "type": "string"
2534
+ },
2535
+ "message": {
2536
+ "type": "string"
2537
+ }
2538
+ },
2539
+ "required": [
2540
+ "code",
2541
+ "message"
2542
+ ]
2543
+ }
2544
+ },
2545
+ "required": [
2546
+ "error"
2547
+ ]
2548
+ }
2549
+ }
2550
+ }
2551
+ }
2552
+ }
2553
+ }
2554
+ },
2555
+ "/v1/worlds/{worldId}/undelete": {
2556
+ "post": {
2557
+ "tags": [
2558
+ "Worlds"
2559
+ ],
2560
+ "operationId": "undeleteWorld",
2561
+ "summary": "Undelete world",
2562
+ "x-mint": {
2563
+ "metadata": {
2564
+ "title": "Undelete world"
2565
+ }
2566
+ },
2567
+ "security": [
2568
+ {
2569
+ "bearerPlatformToken": []
2570
+ }
2571
+ ],
2572
+ "parameters": [
2573
+ {
2574
+ "schema": {
2575
+ "type": "string",
2576
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
2577
+ "description": "World ID minted by worlds-api in w_<ULID> form."
2578
+ },
2579
+ "required": true,
2580
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
2581
+ "name": "worldId",
2582
+ "in": "path"
2583
+ },
2584
+ {
2585
+ "schema": {
2586
+ "type": "string",
2587
+ "format": "email"
2588
+ },
2589
+ "required": false,
2590
+ "name": "email",
2591
+ "in": "query",
2592
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2593
+ }
2594
+ ],
2595
+ "responses": {
2596
+ "200": {
2597
+ "description": "Restored World",
2598
+ "content": {
2599
+ "application/json": {
2600
+ "schema": {
2601
+ "type": "object",
2602
+ "properties": {
2603
+ "world": {
2604
+ "$ref": "#/components/schemas/World"
2605
+ }
2606
+ },
2607
+ "required": [
2608
+ "world"
2609
+ ]
2610
+ }
2611
+ }
2612
+ }
2613
+ },
2614
+ "400": {
2615
+ "description": "Bad request",
2616
+ "content": {
2617
+ "application/json": {
2618
+ "schema": {
2619
+ "type": "object",
2620
+ "properties": {
2621
+ "error": {
2622
+ "type": "object",
2623
+ "properties": {
2624
+ "code": {
2625
+ "type": "string"
2626
+ },
2627
+ "message": {
2628
+ "type": "string"
2629
+ }
2630
+ },
2631
+ "required": [
2632
+ "code",
2633
+ "message"
2634
+ ]
2635
+ }
2636
+ },
2637
+ "required": [
2638
+ "error"
2639
+ ]
2640
+ }
2641
+ }
2642
+ }
2643
+ }
2644
+ }
2645
+ }
2646
+ },
2647
+ "/v1/worlds/{worldId}/auth/tokens": {
2648
+ "get": {
2649
+ "tags": [
2650
+ "WorldTokens"
2651
+ ],
2652
+ "operationId": "listWorldTokens",
2653
+ "summary": "List world tokens",
2654
+ "x-mint": {
2655
+ "metadata": {
2656
+ "title": "List world tokens"
2657
+ }
2658
+ },
2659
+ "security": [
2660
+ {
2661
+ "bearerPlatformToken": []
2662
+ }
2663
+ ],
2664
+ "parameters": [
2665
+ {
2666
+ "schema": {
2667
+ "type": "string",
2668
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
2669
+ "description": "World ID minted by worlds-api in w_<ULID> form."
2670
+ },
2671
+ "required": true,
2672
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
2673
+ "name": "worldId",
2674
+ "in": "path"
2675
+ },
2676
+ {
2677
+ "schema": {
2678
+ "type": "string",
2679
+ "format": "email"
2680
+ },
2681
+ "required": false,
2682
+ "name": "email",
2683
+ "in": "query",
2684
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2685
+ }
2686
+ ],
2687
+ "responses": {
2688
+ "200": {
2689
+ "description": "World tokens",
2690
+ "content": {
2691
+ "application/json": {
2692
+ "schema": {
2693
+ "type": "object",
2694
+ "properties": {
2695
+ "tokens": {
2696
+ "type": "array",
2697
+ "items": {
2698
+ "$ref": "#/components/schemas/WorldToken"
2699
+ }
2700
+ }
2701
+ },
2702
+ "required": [
2703
+ "tokens"
2704
+ ]
2705
+ }
2706
+ }
2707
+ }
2708
+ }
2709
+ }
2710
+ },
2711
+ "post": {
2712
+ "tags": [
2713
+ "WorldTokens"
2714
+ ],
2715
+ "operationId": "createWorldToken",
2716
+ "summary": "Create world token",
2717
+ "x-mint": {
2718
+ "metadata": {
2719
+ "title": "Create world token"
2720
+ }
2721
+ },
2722
+ "security": [
2723
+ {
2724
+ "bearerPlatformToken": []
2725
+ }
2726
+ ],
2727
+ "parameters": [
2728
+ {
2729
+ "schema": {
2730
+ "type": "string",
2731
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
2732
+ "description": "World ID minted by worlds-api in w_<ULID> form."
2733
+ },
2734
+ "required": true,
2735
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
2736
+ "name": "worldId",
2737
+ "in": "path"
2738
+ },
2739
+ {
2740
+ "schema": {
2741
+ "type": "string",
2742
+ "format": "email"
2743
+ },
2744
+ "required": false,
2745
+ "name": "email",
2746
+ "in": "query",
2747
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2748
+ }
2749
+ ],
2750
+ "requestBody": {
2751
+ "content": {
2752
+ "application/json": {
2753
+ "schema": {
2754
+ "$ref": "#/components/schemas/WorldTokenCreateRequest"
2755
+ }
2756
+ }
2757
+ }
2758
+ },
2759
+ "responses": {
2760
+ "201": {
2761
+ "description": "Created World token",
2762
+ "content": {
2763
+ "application/json": {
2764
+ "schema": {
2765
+ "type": "object",
2766
+ "properties": {
2767
+ "token": {
2768
+ "$ref": "#/components/schemas/WorldTokenCreated"
2769
+ }
2770
+ },
2771
+ "required": [
2772
+ "token"
2773
+ ]
2774
+ }
2775
+ }
2776
+ }
2777
+ }
2778
+ }
2779
+ }
2780
+ },
2781
+ "/v1/worlds/{worldId}/auth/tokens/{tokenUid}": {
2782
+ "delete": {
2783
+ "tags": [
2784
+ "WorldTokens"
2785
+ ],
2786
+ "operationId": "deleteWorldToken",
2787
+ "summary": "Revoke world token",
2788
+ "x-mint": {
2789
+ "metadata": {
2790
+ "title": "Revoke world token"
2791
+ }
2792
+ },
2793
+ "security": [
2794
+ {
2795
+ "bearerPlatformToken": []
2796
+ }
2797
+ ],
2798
+ "parameters": [
2799
+ {
2800
+ "schema": {
2801
+ "type": "string",
2802
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
2803
+ "description": "World ID minted by worlds-api in w_<ULID> form."
2804
+ },
2805
+ "required": true,
2806
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
2807
+ "name": "worldId",
2808
+ "in": "path"
2809
+ },
2810
+ {
2811
+ "schema": {
2812
+ "type": "string"
2813
+ },
2814
+ "required": true,
2815
+ "name": "tokenUid",
2816
+ "in": "path"
2817
+ },
2818
+ {
2819
+ "schema": {
2820
+ "type": "string",
2821
+ "format": "email"
2822
+ },
2823
+ "required": false,
2824
+ "name": "email",
2825
+ "in": "query",
2826
+ "description": "User email to operate on when using an admin token. User tokens ignore this parameter."
2827
+ }
2828
+ ],
2829
+ "responses": {
2830
+ "204": {
2831
+ "description": "Revoked"
2832
+ }
2833
+ }
2834
+ }
2835
+ },
2836
+ "/v1/auth/api-tokens": {
2837
+ "get": {
2838
+ "tags": [
2839
+ "PlatformTokens"
2840
+ ],
2841
+ "operationId": "listPlatformTokens",
2842
+ "summary": "List platform tokens",
2843
+ "x-mint": {
2844
+ "metadata": {
2845
+ "title": "List platform tokens"
2846
+ }
2847
+ },
2848
+ "security": [
2849
+ {
2850
+ "bearerPlatformToken": []
2851
+ }
2852
+ ],
2853
+ "responses": {
2854
+ "200": {
2855
+ "description": "Platform tokens",
2856
+ "content": {
2857
+ "application/json": {
2858
+ "schema": {
2859
+ "type": "object",
2860
+ "properties": {
2861
+ "tokens": {
2862
+ "type": "array",
2863
+ "items": {
2864
+ "$ref": "#/components/schemas/PlatformToken"
2865
+ }
2866
+ }
2867
+ },
2868
+ "required": [
2869
+ "tokens"
2870
+ ]
2871
+ }
2872
+ }
2873
+ }
2874
+ }
2875
+ }
2876
+ },
2877
+ "post": {
2878
+ "tags": [
2879
+ "PlatformTokens"
2880
+ ],
2881
+ "operationId": "createPlatformToken",
2882
+ "summary": "Create platform token",
2883
+ "x-mint": {
2884
+ "metadata": {
2885
+ "title": "Create platform token"
2886
+ }
2887
+ },
2888
+ "security": [
2889
+ {
2890
+ "bearerPlatformToken": []
2891
+ }
2892
+ ],
2893
+ "requestBody": {
2894
+ "required": true,
2895
+ "content": {
2896
+ "application/json": {
2897
+ "schema": {
2898
+ "$ref": "#/components/schemas/PlatformTokenCreateRequest"
2899
+ }
2900
+ }
2901
+ }
2902
+ },
2903
+ "responses": {
2904
+ "201": {
2905
+ "description": "Created platform token",
2906
+ "content": {
2907
+ "application/json": {
2908
+ "schema": {
2909
+ "$ref": "#/components/schemas/PlatformTokenCreateResponse"
2910
+ }
2911
+ }
2912
+ }
2913
+ },
2914
+ "403": {
2915
+ "description": "Permission denied",
2916
+ "content": {
2917
+ "application/json": {
2918
+ "schema": {
2919
+ "type": "object",
2920
+ "properties": {
2921
+ "error": {
2922
+ "type": "object",
2923
+ "properties": {
2924
+ "code": {
2925
+ "type": "string"
2926
+ },
2927
+ "message": {
2928
+ "type": "string"
2929
+ }
2930
+ },
2931
+ "required": [
2932
+ "code",
2933
+ "message"
2934
+ ]
2935
+ }
2936
+ },
2937
+ "required": [
2938
+ "error"
2939
+ ]
2940
+ }
2941
+ }
2942
+ }
2943
+ }
2944
+ }
2945
+ }
2946
+ },
2947
+ "/v1/auth/api-tokens/{tokenName}": {
2948
+ "post": {
2949
+ "tags": [
2950
+ "PlatformTokens"
2951
+ ],
2952
+ "operationId": "createNamedPlatformToken",
2953
+ "summary": "Create named platform token",
2954
+ "x-mint": {
2955
+ "metadata": {
2956
+ "title": "Create named platform token"
2957
+ }
2958
+ },
2959
+ "security": [
2960
+ {
2961
+ "bearerPlatformToken": []
2962
+ }
2963
+ ],
2964
+ "parameters": [
2965
+ {
2966
+ "schema": {
2967
+ "type": "string"
2968
+ },
2969
+ "required": true,
2970
+ "name": "tokenName",
2971
+ "in": "path"
2972
+ }
2973
+ ],
2974
+ "requestBody": {
2975
+ "content": {
2976
+ "application/json": {
2977
+ "schema": {
2978
+ "$ref": "#/components/schemas/PlatformTokenCreateRequest"
2979
+ }
2980
+ }
2981
+ }
2982
+ },
2983
+ "responses": {
2984
+ "201": {
2985
+ "description": "Created platform token",
2986
+ "content": {
2987
+ "application/json": {
2988
+ "schema": {
2989
+ "$ref": "#/components/schemas/PlatformTokenCreateResponse"
2990
+ }
2991
+ }
2992
+ }
2993
+ }
2994
+ }
2995
+ },
2996
+ "delete": {
2997
+ "tags": [
2998
+ "PlatformTokens"
2999
+ ],
3000
+ "operationId": "deletePlatformToken",
3001
+ "summary": "Revoke platform token",
3002
+ "x-mint": {
3003
+ "metadata": {
3004
+ "title": "Revoke platform token"
3005
+ }
3006
+ },
3007
+ "security": [
3008
+ {
3009
+ "bearerPlatformToken": []
3010
+ }
3011
+ ],
3012
+ "parameters": [
3013
+ {
3014
+ "schema": {
3015
+ "type": "string"
3016
+ },
3017
+ "required": true,
3018
+ "name": "tokenName",
3019
+ "in": "path"
3020
+ }
3021
+ ],
3022
+ "responses": {
3023
+ "200": {
3024
+ "description": "Deleted platform token",
3025
+ "content": {
3026
+ "application/json": {
3027
+ "schema": {
3028
+ "type": "object",
3029
+ "properties": {
3030
+ "token": {
3031
+ "type": "string"
3032
+ }
3033
+ },
3034
+ "required": [
3035
+ "token"
3036
+ ]
3037
+ }
3038
+ }
3039
+ }
3040
+ }
3041
+ }
3042
+ }
3043
+ },
3044
+ "/v1/auth/api-tokens/validate": {
3045
+ "get": {
3046
+ "tags": [
3047
+ "PlatformTokens"
3048
+ ],
3049
+ "operationId": "validatePlatformToken",
3050
+ "summary": "Validate platform token",
3051
+ "x-mint": {
3052
+ "metadata": {
3053
+ "title": "Validate platform token"
3054
+ }
3055
+ },
3056
+ "security": [
3057
+ {
3058
+ "bearerPlatformToken": []
3059
+ }
3060
+ ],
3061
+ "responses": {
3062
+ "200": {
3063
+ "description": "Token validity",
3064
+ "content": {
3065
+ "application/json": {
3066
+ "schema": {
3067
+ "type": "object",
3068
+ "properties": {
3069
+ "exp": {
3070
+ "type": "integer"
3071
+ }
3072
+ },
3073
+ "required": [
3074
+ "exp"
3075
+ ]
3076
+ }
3077
+ }
3078
+ }
3079
+ }
3080
+ }
3081
+ }
3082
+ },
3083
+ "/v1/worlds/{worldId}/usage": {
3084
+ "get": {
3085
+ "tags": [
3086
+ "Usage"
3087
+ ],
3088
+ "operationId": "getWorldUsage",
3089
+ "summary": "Get world usage",
3090
+ "x-mint": {
3091
+ "metadata": {
3092
+ "title": "Get world usage"
3093
+ }
3094
+ },
3095
+ "security": [
3096
+ {
3097
+ "bearerPlatformToken": []
3098
+ }
3099
+ ],
3100
+ "parameters": [
3101
+ {
3102
+ "schema": {
3103
+ "type": "string",
3104
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
3105
+ "description": "World ID minted by worlds-api in w_<ULID> form."
3106
+ },
3107
+ "required": true,
3108
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
3109
+ "name": "worldId",
3110
+ "in": "path"
3111
+ },
3112
+ {
3113
+ "schema": {
3114
+ "type": "string",
3115
+ "format": "email"
3116
+ },
3117
+ "required": false,
3118
+ "name": "email",
3119
+ "in": "query"
3120
+ },
3121
+ {
3122
+ "schema": {
3123
+ "type": "string"
3124
+ },
3125
+ "required": false,
3126
+ "name": "from",
3127
+ "in": "query"
3128
+ },
3129
+ {
3130
+ "schema": {
3131
+ "type": "string"
3132
+ },
3133
+ "required": false,
3134
+ "name": "to",
3135
+ "in": "query"
3136
+ }
3137
+ ],
3138
+ "responses": {
3139
+ "200": {
3140
+ "description": "Usage summary",
3141
+ "content": {
3142
+ "application/json": {
3143
+ "schema": {
3144
+ "type": "object",
3145
+ "properties": {
3146
+ "usage": {
3147
+ "type": "object",
3148
+ "properties": {
3149
+ "world": {
3150
+ "type": "string"
3151
+ },
3152
+ "total": {
3153
+ "type": "array",
3154
+ "items": {
3155
+ "type": "object",
3156
+ "properties": {
3157
+ "metric": {
3158
+ "type": "string"
3159
+ },
3160
+ "quantity": {
3161
+ "type": "number"
3162
+ }
3163
+ },
3164
+ "required": [
3165
+ "metric",
3166
+ "quantity"
3167
+ ]
3168
+ }
3169
+ },
3170
+ "events": {
3171
+ "type": "array",
3172
+ "items": {
3173
+ "$ref": "#/components/schemas/UsageEvent"
3174
+ }
3175
+ }
3176
+ },
3177
+ "required": [
3178
+ "world",
3179
+ "total",
3180
+ "events"
3181
+ ]
3182
+ },
3183
+ "quota": {
3184
+ "$ref": "#/components/schemas/QuotaSummary"
3185
+ }
3186
+ },
3187
+ "required": [
3188
+ "usage",
3189
+ "quota"
3190
+ ]
3191
+ }
3192
+ }
3193
+ }
3194
+ }
3195
+ }
3196
+ },
3197
+ "post": {
3198
+ "tags": [
3199
+ "Usage"
3200
+ ],
3201
+ "operationId": "recordWorldUsage",
3202
+ "summary": "Record world usage",
3203
+ "x-mint": {
3204
+ "metadata": {
3205
+ "title": "Record world usage"
3206
+ }
3207
+ },
3208
+ "security": [
3209
+ {
3210
+ "bearerPlatformToken": []
3211
+ }
3212
+ ],
3213
+ "parameters": [
3214
+ {
3215
+ "schema": {
3216
+ "type": "string",
3217
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
3218
+ "description": "World ID minted by worlds-api in w_<ULID> form."
3219
+ },
3220
+ "required": true,
3221
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
3222
+ "name": "worldId",
3223
+ "in": "path"
3224
+ }
3225
+ ],
3226
+ "requestBody": {
3227
+ "required": true,
3228
+ "content": {
3229
+ "application/json": {
3230
+ "schema": {
3231
+ "$ref": "#/components/schemas/UsageRecordRequest"
3232
+ }
3233
+ }
3234
+ }
3235
+ },
3236
+ "responses": {
3237
+ "201": {
3238
+ "description": "Usage accepted",
3239
+ "content": {
3240
+ "application/json": {
3241
+ "schema": {
3242
+ "type": "object",
3243
+ "properties": {
3244
+ "accepted": {
3245
+ "type": "boolean"
3246
+ }
3247
+ },
3248
+ "required": [
3249
+ "accepted"
3250
+ ]
3251
+ }
3252
+ }
3253
+ }
3254
+ },
3255
+ "429": {
3256
+ "description": "Limit exceeded",
3257
+ "content": {
3258
+ "application/json": {
3259
+ "schema": {
3260
+ "type": "object",
3261
+ "properties": {
3262
+ "error": {
3263
+ "type": "object",
3264
+ "properties": {
3265
+ "code": {
3266
+ "type": "string"
3267
+ },
3268
+ "message": {
3269
+ "type": "string"
3270
+ }
3271
+ },
3272
+ "required": [
3273
+ "code",
3274
+ "message"
3275
+ ]
3276
+ },
3277
+ "quota": {
3278
+ "type": "object",
3279
+ "properties": {
3280
+ "state": {
3281
+ "type": "string"
3282
+ },
3283
+ "reason": {
3284
+ "type": "string"
3285
+ }
3286
+ },
3287
+ "required": [
3288
+ "state"
3289
+ ]
3290
+ }
3291
+ },
3292
+ "required": [
3293
+ "error",
3294
+ "quota"
3295
+ ]
3296
+ }
3297
+ }
3298
+ }
3299
+ }
3300
+ }
3301
+ }
3302
+ },
3303
+ "/v1/worlds/{worldId}/limits": {
3304
+ "get": {
3305
+ "tags": [
3306
+ "Usage"
3307
+ ],
3308
+ "operationId": "getWorldLimits",
3309
+ "summary": "Get world limits",
3310
+ "x-mint": {
3311
+ "metadata": {
3312
+ "title": "Get world limits"
3313
+ }
3314
+ },
3315
+ "security": [
3316
+ {
3317
+ "bearerPlatformToken": []
3318
+ }
3319
+ ],
3320
+ "parameters": [
3321
+ {
3322
+ "schema": {
3323
+ "type": "string",
3324
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
3325
+ "description": "World ID minted by worlds-api in w_<ULID> form."
3326
+ },
3327
+ "required": true,
3328
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
3329
+ "name": "worldId",
3330
+ "in": "path"
3331
+ },
3332
+ {
3333
+ "schema": {
3334
+ "type": "string"
3335
+ },
3336
+ "required": false,
3337
+ "name": "email",
3338
+ "in": "query"
3339
+ }
3340
+ ],
3341
+ "responses": {
3342
+ "200": {
3343
+ "description": "World limits",
3344
+ "content": {
3345
+ "application/json": {
3346
+ "schema": {
3347
+ "type": "object",
3348
+ "properties": {
3349
+ "limits": {
3350
+ "type": "array",
3351
+ "items": {
3352
+ "type": "object",
3353
+ "properties": {
3354
+ "metric": {
3355
+ "type": "string"
3356
+ },
3357
+ "limitQuantity": {
3358
+ "type": "number"
3359
+ }
3360
+ },
3361
+ "required": [
3362
+ "metric",
3363
+ "limitQuantity"
3364
+ ]
3365
+ }
3366
+ }
3367
+ },
3368
+ "required": [
3369
+ "limits"
3370
+ ]
3371
+ }
3372
+ }
3373
+ }
3374
+ }
3375
+ }
3376
+ }
3377
+ },
3378
+ "/v1/worlds/{worldId}/billing": {
3379
+ "get": {
3380
+ "tags": [
3381
+ "Billing"
3382
+ ],
3383
+ "operationId": "getWorldBilling",
3384
+ "summary": "Get world billing",
3385
+ "x-mint": {
3386
+ "metadata": {
3387
+ "title": "Get world billing"
3388
+ }
3389
+ },
3390
+ "security": [
3391
+ {
3392
+ "bearerPlatformToken": []
3393
+ }
3394
+ ],
3395
+ "parameters": [
3396
+ {
3397
+ "schema": {
3398
+ "type": "string",
3399
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
3400
+ "description": "World ID minted by worlds-api in w_<ULID> form."
3401
+ },
3402
+ "required": true,
3403
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
3404
+ "name": "worldId",
3405
+ "in": "path"
3406
+ },
3407
+ {
3408
+ "schema": {
3409
+ "type": "string"
3410
+ },
3411
+ "required": false,
3412
+ "name": "email",
3413
+ "in": "query"
3414
+ }
3415
+ ],
3416
+ "responses": {
3417
+ "200": {
3418
+ "description": "World billing state",
3419
+ "content": {
3420
+ "application/json": {
3421
+ "schema": {
3422
+ "type": "object",
3423
+ "properties": {
3424
+ "billing": {
3425
+ "$ref": "#/components/schemas/Billing"
3426
+ },
3427
+ "quota": {
3428
+ "$ref": "#/components/schemas/QuotaSummary"
3429
+ }
3430
+ },
3431
+ "required": [
3432
+ "billing",
3433
+ "quota"
3434
+ ]
3435
+ }
3436
+ }
3437
+ }
3438
+ }
3439
+ }
3440
+ }
3441
+ },
3442
+ "/v1/worlds/{worldId}/billing/invoices": {
3443
+ "get": {
3444
+ "tags": [
3445
+ "Billing"
3446
+ ],
3447
+ "operationId": "listWorldInvoices",
3448
+ "summary": "List world invoices",
3449
+ "x-mint": {
3450
+ "metadata": {
3451
+ "title": "List world invoices"
3452
+ }
3453
+ },
3454
+ "security": [
3455
+ {
3456
+ "bearerPlatformToken": []
3457
+ }
3458
+ ],
3459
+ "parameters": [
3460
+ {
3461
+ "schema": {
3462
+ "type": "string",
3463
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
3464
+ "description": "World ID minted by worlds-api in w_<ULID> form."
3465
+ },
3466
+ "required": true,
3467
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
3468
+ "name": "worldId",
3469
+ "in": "path"
3470
+ },
3471
+ {
3472
+ "schema": {
3473
+ "type": "string"
3474
+ },
3475
+ "required": false,
3476
+ "name": "email",
3477
+ "in": "query"
3478
+ }
3479
+ ],
3480
+ "responses": {
3481
+ "200": {
3482
+ "description": "World invoices",
3483
+ "content": {
3484
+ "application/json": {
3485
+ "schema": {
3486
+ "type": "object",
3487
+ "properties": {
3488
+ "invoices": {
3489
+ "type": "array",
3490
+ "items": {
3491
+ "nullable": true
3492
+ }
3493
+ }
3494
+ },
3495
+ "required": [
3496
+ "invoices"
3497
+ ]
3498
+ }
3499
+ }
3500
+ }
3501
+ }
3502
+ }
3503
+ }
3504
+ },
3505
+ "/v1/worlds/{worldId}/billing/cancel": {
3506
+ "post": {
3507
+ "tags": [
3508
+ "Billing"
3509
+ ],
3510
+ "operationId": "cancelWorldSubscription",
3511
+ "summary": "Cancel world subscription",
3512
+ "x-mint": {
3513
+ "metadata": {
3514
+ "title": "Cancel world subscription"
3515
+ }
3516
+ },
3517
+ "security": [
3518
+ {
3519
+ "bearerPlatformToken": []
3520
+ }
3521
+ ],
3522
+ "parameters": [
3523
+ {
3524
+ "schema": {
3525
+ "type": "string",
3526
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
3527
+ "description": "World ID minted by worlds-api in w_<ULID> form."
3528
+ },
3529
+ "required": true,
3530
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
3531
+ "name": "worldId",
3532
+ "in": "path"
3533
+ },
3534
+ {
3535
+ "schema": {
3536
+ "type": "string"
3537
+ },
3538
+ "required": false,
3539
+ "name": "email",
3540
+ "in": "query"
3541
+ }
3542
+ ],
3543
+ "responses": {
3544
+ "200": {
3545
+ "description": "Cancelled subscription",
3546
+ "content": {
3547
+ "application/json": {
3548
+ "schema": {
3549
+ "type": "object",
3550
+ "properties": {
3551
+ "billing": {
3552
+ "type": "object",
3553
+ "properties": {
3554
+ "world": {
3555
+ "type": "string"
3556
+ },
3557
+ "state": {
3558
+ "type": "string"
3559
+ },
3560
+ "provider": {
3561
+ "type": "string"
3562
+ },
3563
+ "customerConfigured": {
3564
+ "type": "boolean"
3565
+ },
3566
+ "subscriptionConfigured": {
3567
+ "type": "boolean"
3568
+ },
3569
+ "paymentRequired": {
3570
+ "type": "boolean"
3571
+ }
3572
+ },
3573
+ "required": [
3574
+ "world",
3575
+ "state",
3576
+ "provider",
3577
+ "customerConfigured",
3578
+ "subscriptionConfigured",
3579
+ "paymentRequired"
3580
+ ]
3581
+ }
3582
+ },
3583
+ "required": [
3584
+ "billing"
3585
+ ]
3586
+ }
3587
+ }
3588
+ }
3589
+ },
3590
+ "400": {
3591
+ "description": "No subscription to cancel",
3592
+ "content": {
3593
+ "application/json": {
3594
+ "schema": {
3595
+ "type": "object",
3596
+ "properties": {
3597
+ "error": {
3598
+ "type": "object",
3599
+ "properties": {
3600
+ "code": {
3601
+ "type": "string"
3602
+ },
3603
+ "message": {
3604
+ "type": "string"
3605
+ }
3606
+ },
3607
+ "required": [
3608
+ "code",
3609
+ "message"
3610
+ ]
3611
+ }
3612
+ },
3613
+ "required": [
3614
+ "error"
3615
+ ]
3616
+ }
3617
+ }
3618
+ }
3619
+ }
3620
+ }
3621
+ }
3622
+ },
3623
+ "/v1/worlds/{worldId}/billing/openPortal": {
3624
+ "post": {
3625
+ "tags": [
3626
+ "Billing"
3627
+ ],
3628
+ "operationId": "openWorldBillingPortal",
3629
+ "summary": "Open billing portal",
3630
+ "x-mint": {
3631
+ "metadata": {
3632
+ "title": "Open billing portal"
3633
+ }
3634
+ },
3635
+ "security": [
3636
+ {
3637
+ "bearerPlatformToken": []
3638
+ }
3639
+ ],
3640
+ "parameters": [
3641
+ {
3642
+ "schema": {
3643
+ "type": "string",
3644
+ "pattern": "^w_[0-7][0-9a-hjkmnp-tv-z]{25}$",
3645
+ "description": "World ID minted by worlds-api in w_<ULID> form."
3646
+ },
3647
+ "required": true,
3648
+ "description": "World ID minted by worlds-api in w_<ULID> form.",
3649
+ "name": "worldId",
3650
+ "in": "path"
3651
+ },
3652
+ {
3653
+ "schema": {
3654
+ "type": "string"
3655
+ },
3656
+ "required": false,
3657
+ "name": "email",
3658
+ "in": "query"
3659
+ }
3660
+ ],
3661
+ "responses": {
3662
+ "400": {
3663
+ "description": "Not available",
3664
+ "content": {
3665
+ "application/json": {
3666
+ "schema": {
3667
+ "type": "object",
3668
+ "properties": {
3669
+ "error": {
3670
+ "type": "object",
3671
+ "properties": {
3672
+ "code": {
3673
+ "type": "string"
3674
+ },
3675
+ "message": {
3676
+ "type": "string"
3677
+ }
3678
+ },
3679
+ "required": [
3680
+ "code",
3681
+ "message"
3682
+ ]
3683
+ }
3684
+ },
3685
+ "required": [
3686
+ "error"
3687
+ ]
3688
+ }
3689
+ }
3690
+ }
3691
+ }
3692
+ }
3693
+ }
3694
+ },
3695
+ "/v1/admin/audit-events": {
3696
+ "get": {
3697
+ "tags": [
3698
+ "Admin"
3699
+ ],
3700
+ "operationId": "listAdminAuditEvents",
3701
+ "summary": "List admin audit events",
3702
+ "x-mint": {
3703
+ "metadata": {
3704
+ "title": "List admin audit events"
3705
+ }
3706
+ },
3707
+ "security": [
3708
+ {
3709
+ "bearerPlatformToken": []
3710
+ }
3711
+ ],
3712
+ "parameters": [
3713
+ {
3714
+ "schema": {
3715
+ "type": "integer",
3716
+ "minimum": 1,
3717
+ "maximum": 100,
3718
+ "default": 50
3719
+ },
3720
+ "required": false,
3721
+ "name": "limit",
3722
+ "in": "query"
3723
+ },
3724
+ {
3725
+ "schema": {
3726
+ "type": "integer",
3727
+ "nullable": true,
3728
+ "minimum": 0,
3729
+ "default": 0
3730
+ },
3731
+ "required": false,
3732
+ "name": "offset",
3733
+ "in": "query"
3734
+ }
3735
+ ],
3736
+ "responses": {
3737
+ "200": {
3738
+ "description": "List of admin audit events",
3739
+ "content": {
3740
+ "application/json": {
3741
+ "schema": {
3742
+ "type": "object",
3743
+ "properties": {
3744
+ "auditEvents": {
3745
+ "type": "array",
3746
+ "items": {
3747
+ "type": "object",
3748
+ "properties": {
3749
+ "uid": {
3750
+ "type": "string"
3751
+ },
3752
+ "actorTokenUid": {
3753
+ "type": "string",
3754
+ "nullable": true
3755
+ },
3756
+ "action": {
3757
+ "type": "string"
3758
+ },
3759
+ "targetResourceName": {
3760
+ "type": "string"
3761
+ },
3762
+ "outcome": {
3763
+ "type": "string"
3764
+ },
3765
+ "errorCode": {
3766
+ "type": "string",
3767
+ "nullable": true
3768
+ },
3769
+ "createTime": {
3770
+ "type": "string"
3771
+ }
3772
+ },
3773
+ "required": [
3774
+ "uid",
3775
+ "action",
3776
+ "targetResourceName",
3777
+ "outcome",
3778
+ "createTime"
3779
+ ]
3780
+ }
3781
+ },
3782
+ "total": {
3783
+ "type": "number"
3784
+ }
3785
+ },
3786
+ "required": [
3787
+ "auditEvents"
3788
+ ]
3789
+ }
3790
+ }
3791
+ }
3792
+ },
3793
+ "401": {
3794
+ "description": "Not authenticated",
3795
+ "content": {
3796
+ "application/json": {
3797
+ "schema": {
3798
+ "type": "object",
3799
+ "properties": {
3800
+ "error": {
3801
+ "type": "object",
3802
+ "properties": {
3803
+ "code": {
3804
+ "type": "string"
3805
+ },
3806
+ "message": {
3807
+ "type": "string"
3808
+ }
3809
+ },
3810
+ "required": [
3811
+ "code",
3812
+ "message"
3813
+ ]
3814
+ }
3815
+ },
3816
+ "required": [
3817
+ "error"
3818
+ ]
3819
+ }
3820
+ }
3821
+ }
3822
+ },
3823
+ "403": {
3824
+ "description": "Insufficient scope",
3825
+ "content": {
3826
+ "application/json": {
3827
+ "schema": {
3828
+ "type": "object",
3829
+ "properties": {
3830
+ "error": {
3831
+ "type": "object",
3832
+ "properties": {
3833
+ "code": {
3834
+ "type": "string"
3835
+ },
3836
+ "message": {
3837
+ "type": "string"
3838
+ }
3839
+ },
3840
+ "required": [
3841
+ "code",
3842
+ "message"
3843
+ ]
3844
+ }
3845
+ },
3846
+ "required": [
3847
+ "error"
3848
+ ]
3849
+ }
3850
+ }
3851
+ }
3852
+ }
3853
+ }
3854
+ }
3855
+ },
3856
+ "/v1/users/me/plan": {
3857
+ "get": {
3858
+ "tags": [
3859
+ "Users"
3860
+ ],
3861
+ "operationId": "getUserPlan",
3862
+ "summary": "Get the authenticated user's plan and today's write usage",
3863
+ "x-mint": {
3864
+ "metadata": {
3865
+ "title": "Get plan and write usage"
3866
+ }
3867
+ },
3868
+ "security": [
3869
+ {
3870
+ "bearerPlatformToken": []
3871
+ }
3872
+ ],
3873
+ "responses": {
3874
+ "200": {
3875
+ "description": "The plan and usage against its daily write budget",
3876
+ "content": {
3877
+ "application/json": {
3878
+ "schema": {
3879
+ "$ref": "#/components/schemas/UserPlan"
3880
+ }
3881
+ }
3882
+ }
3883
+ },
3884
+ "404": {
3885
+ "description": "User not found",
3886
+ "content": {
3887
+ "application/json": {
3888
+ "schema": {
3889
+ "type": "object",
3890
+ "properties": {
3891
+ "error": {
3892
+ "type": "object",
3893
+ "properties": {
3894
+ "code": {
3895
+ "type": "string"
3896
+ },
3897
+ "message": {
3898
+ "type": "string"
3899
+ }
3900
+ },
3901
+ "required": [
3902
+ "code",
3903
+ "message"
3904
+ ]
3905
+ }
3906
+ },
3907
+ "required": [
3908
+ "error"
3909
+ ]
3910
+ }
3911
+ }
3912
+ }
3913
+ }
3914
+ }
3915
+ }
3916
+ },
3917
+ "/v1/admin/users/{userUid}/plan": {
3918
+ "put": {
3919
+ "tags": [
3920
+ "Admin"
3921
+ ],
3922
+ "operationId": "setUserPlan",
3923
+ "summary": "Set a user's plan",
3924
+ "description": "Admin-only. Stores the plan and applies its daily write budget in the data plane. Idempotent: if the data plane cannot be reached the plan is still saved, the call returns 502 BUDGET_SYNC_FAILED, and repeating it retries the sync.",
3925
+ "x-mint": {
3926
+ "metadata": {
3927
+ "title": "Set a user's plan"
3928
+ }
3929
+ },
3930
+ "security": [
3931
+ {
3932
+ "bearerPlatformToken": []
3933
+ }
3934
+ ],
3935
+ "parameters": [
3936
+ {
3937
+ "schema": {
3938
+ "type": "string",
3939
+ "minLength": 1
3940
+ },
3941
+ "required": true,
3942
+ "name": "userUid",
3943
+ "in": "path"
3944
+ }
3945
+ ],
3946
+ "requestBody": {
3947
+ "required": true,
3948
+ "content": {
3949
+ "application/json": {
3950
+ "schema": {
3951
+ "type": "object",
3952
+ "properties": {
3953
+ "plan": {
3954
+ "type": "string",
3955
+ "enum": [
3956
+ "free",
3957
+ "pro"
3958
+ ],
3959
+ "description": "The user's plan. It sets their daily database write budget."
3960
+ }
3961
+ },
3962
+ "required": [
3963
+ "plan"
3964
+ ]
3965
+ }
3966
+ }
3967
+ }
3968
+ },
3969
+ "responses": {
3970
+ "200": {
3971
+ "description": "The plan now in effect",
3972
+ "content": {
3973
+ "application/json": {
3974
+ "schema": {
3975
+ "type": "object",
3976
+ "properties": {
3977
+ "userUid": {
3978
+ "type": "string"
3979
+ },
3980
+ "plan": {
3981
+ "type": "string",
3982
+ "enum": [
3983
+ "free",
3984
+ "pro"
3985
+ ],
3986
+ "description": "The user's plan. It sets their daily database write budget."
3987
+ },
3988
+ "dailyRowWrites": {
3989
+ "type": "integer",
3990
+ "minimum": 0,
3991
+ "exclusiveMinimum": true
3992
+ }
3993
+ },
3994
+ "required": [
3995
+ "userUid",
3996
+ "plan",
3997
+ "dailyRowWrites"
3998
+ ]
3999
+ }
4000
+ }
4001
+ }
4002
+ },
4003
+ "404": {
4004
+ "description": "User not found",
4005
+ "content": {
4006
+ "application/json": {
4007
+ "schema": {
4008
+ "type": "object",
4009
+ "properties": {
4010
+ "error": {
4011
+ "type": "object",
4012
+ "properties": {
4013
+ "code": {
4014
+ "type": "string"
4015
+ },
4016
+ "message": {
4017
+ "type": "string"
4018
+ }
4019
+ },
4020
+ "required": [
4021
+ "code",
4022
+ "message"
4023
+ ]
4024
+ }
4025
+ },
4026
+ "required": [
4027
+ "error"
4028
+ ]
4029
+ }
4030
+ }
4031
+ }
4032
+ },
4033
+ "502": {
4034
+ "description": "The plan was saved but the data plane did not accept its budget (BUDGET_SYNC_FAILED). Repeat the call.",
4035
+ "content": {
4036
+ "application/json": {
4037
+ "schema": {
4038
+ "type": "object",
4039
+ "properties": {
4040
+ "error": {
4041
+ "type": "object",
4042
+ "properties": {
4043
+ "code": {
4044
+ "type": "string"
4045
+ },
4046
+ "message": {
4047
+ "type": "string"
4048
+ }
4049
+ },
4050
+ "required": [
4051
+ "code",
4052
+ "message"
4053
+ ]
4054
+ }
4055
+ },
4056
+ "required": [
4057
+ "error"
4058
+ ]
4059
+ }
4060
+ }
4061
+ }
4062
+ }
4063
+ }
4064
+ }
4065
+ },
4066
+ "/v1/users/me/billing/checkout": {
4067
+ "post": {
4068
+ "tags": [
4069
+ "Billing"
4070
+ ],
4071
+ "operationId": "createCheckoutSession",
4072
+ "summary": "Start a Pro subscription checkout",
4073
+ "description": "Creates a Stripe Checkout session for the Pro plan and returns the hosted page's URL. The plan changes when Stripe confirms the payment (a webhook), not when this call returns, so the console shows the new plan shortly after the user comes back.",
4074
+ "x-mint": {
4075
+ "metadata": {
4076
+ "title": "Start a Pro checkout"
4077
+ }
4078
+ },
4079
+ "security": [
4080
+ {
4081
+ "bearerPlatformToken": []
4082
+ }
4083
+ ],
4084
+ "responses": {
4085
+ "200": {
4086
+ "description": "Checkout session created",
4087
+ "content": {
4088
+ "application/json": {
4089
+ "schema": {
4090
+ "$ref": "#/components/schemas/BillingSessionUrl"
4091
+ }
4092
+ }
4093
+ }
4094
+ },
4095
+ "409": {
4096
+ "description": "The user already has a subscription (ALREADY_SUBSCRIBED).",
4097
+ "content": {
4098
+ "application/json": {
4099
+ "schema": {
4100
+ "type": "object",
4101
+ "properties": {
4102
+ "error": {
4103
+ "type": "object",
4104
+ "properties": {
4105
+ "code": {
4106
+ "type": "string"
4107
+ },
4108
+ "message": {
4109
+ "type": "string"
4110
+ }
4111
+ },
4112
+ "required": [
4113
+ "code",
4114
+ "message"
4115
+ ]
4116
+ }
4117
+ },
4118
+ "required": [
4119
+ "error"
4120
+ ]
4121
+ }
4122
+ }
4123
+ }
4124
+ },
4125
+ "502": {
4126
+ "description": "Stripe refused the request (STRIPE_ERROR).",
4127
+ "content": {
4128
+ "application/json": {
4129
+ "schema": {
4130
+ "type": "object",
4131
+ "properties": {
4132
+ "error": {
4133
+ "type": "object",
4134
+ "properties": {
4135
+ "code": {
4136
+ "type": "string"
4137
+ },
4138
+ "message": {
4139
+ "type": "string"
4140
+ }
4141
+ },
4142
+ "required": [
4143
+ "code",
4144
+ "message"
4145
+ ]
4146
+ }
4147
+ },
4148
+ "required": [
4149
+ "error"
4150
+ ]
4151
+ }
4152
+ }
4153
+ }
4154
+ },
4155
+ "503": {
4156
+ "description": "Billing is not configured (BILLING_NOT_CONFIGURED).",
4157
+ "content": {
4158
+ "application/json": {
4159
+ "schema": {
4160
+ "type": "object",
4161
+ "properties": {
4162
+ "error": {
4163
+ "type": "object",
4164
+ "properties": {
4165
+ "code": {
4166
+ "type": "string"
4167
+ },
4168
+ "message": {
4169
+ "type": "string"
4170
+ }
4171
+ },
4172
+ "required": [
4173
+ "code",
4174
+ "message"
4175
+ ]
4176
+ }
4177
+ },
4178
+ "required": [
4179
+ "error"
4180
+ ]
4181
+ }
4182
+ }
4183
+ }
4184
+ }
4185
+ }
4186
+ }
4187
+ },
4188
+ "/v1/users/me/billing/portal": {
4189
+ "post": {
4190
+ "tags": [
4191
+ "Billing"
4192
+ ],
4193
+ "operationId": "createBillingPortalSession",
4194
+ "summary": "Open the Stripe billing portal",
4195
+ "description": "Creates a Stripe billing portal session where the user can update their card, see invoices or cancel, and returns its URL.",
4196
+ "x-mint": {
4197
+ "metadata": {
4198
+ "title": "Open the billing portal"
4199
+ }
4200
+ },
4201
+ "security": [
4202
+ {
4203
+ "bearerPlatformToken": []
4204
+ }
4205
+ ],
4206
+ "responses": {
4207
+ "200": {
4208
+ "description": "Portal session created",
4209
+ "content": {
4210
+ "application/json": {
4211
+ "schema": {
4212
+ "$ref": "#/components/schemas/BillingSessionUrl"
4213
+ }
4214
+ }
4215
+ }
4216
+ },
4217
+ "409": {
4218
+ "description": "The user has no billing account yet (NO_BILLING_ACCOUNT).",
4219
+ "content": {
4220
+ "application/json": {
4221
+ "schema": {
4222
+ "type": "object",
4223
+ "properties": {
4224
+ "error": {
4225
+ "type": "object",
4226
+ "properties": {
4227
+ "code": {
4228
+ "type": "string"
4229
+ },
4230
+ "message": {
4231
+ "type": "string"
4232
+ }
4233
+ },
4234
+ "required": [
4235
+ "code",
4236
+ "message"
4237
+ ]
4238
+ }
4239
+ },
4240
+ "required": [
4241
+ "error"
4242
+ ]
4243
+ }
4244
+ }
4245
+ }
4246
+ },
4247
+ "502": {
4248
+ "description": "Stripe refused the request (STRIPE_ERROR).",
4249
+ "content": {
4250
+ "application/json": {
4251
+ "schema": {
4252
+ "type": "object",
4253
+ "properties": {
4254
+ "error": {
4255
+ "type": "object",
4256
+ "properties": {
4257
+ "code": {
4258
+ "type": "string"
4259
+ },
4260
+ "message": {
4261
+ "type": "string"
4262
+ }
4263
+ },
4264
+ "required": [
4265
+ "code",
4266
+ "message"
4267
+ ]
4268
+ }
4269
+ },
4270
+ "required": [
4271
+ "error"
4272
+ ]
4273
+ }
4274
+ }
4275
+ }
4276
+ },
4277
+ "503": {
4278
+ "description": "Billing is not configured (BILLING_NOT_CONFIGURED).",
4279
+ "content": {
4280
+ "application/json": {
4281
+ "schema": {
4282
+ "type": "object",
4283
+ "properties": {
4284
+ "error": {
4285
+ "type": "object",
4286
+ "properties": {
4287
+ "code": {
4288
+ "type": "string"
4289
+ },
4290
+ "message": {
4291
+ "type": "string"
4292
+ }
4293
+ },
4294
+ "required": [
4295
+ "code",
4296
+ "message"
4297
+ ]
4298
+ }
4299
+ },
4300
+ "required": [
4301
+ "error"
4302
+ ]
4303
+ }
4304
+ }
4305
+ }
4306
+ }
4307
+ }
4308
+ }
4309
+ }
4310
+ }
4311
+ }