@1claw/openapi-spec 0.53.0 → 0.53.2

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.
Files changed (3) hide show
  1. package/openapi.json +1799 -579
  2. package/openapi.yaml +837 -6
  3. package/package.json +1 -1
package/openapi.yaml CHANGED
@@ -2,7 +2,7 @@ openapi: 3.1.0
2
2
 
3
3
  info:
4
4
  title: 1Claw API
5
- version: 0.53.0
5
+ version: 0.53.2
6
6
  description: |
7
7
  Secure secret management for AI agents. Provides vaults, secrets,
8
8
  policy-based access control, agent identity, Intents API,
@@ -112,6 +112,12 @@ tags:
112
112
  description: Unified balance aggregator
113
113
  - name: Environment Variables
114
114
  description: Per-vault and org-shared environment variable management
115
+ - name: Wallet Access
116
+ description: Role-based wallet access policies for agents and users
117
+ - name: Credential Recovery
118
+ description: MFA/passkey/password recovery escape hatch with admin approval
119
+ - name: Shamir KEK
120
+ description: Shamir secret-sharing for org-level Key Encryption Keys
115
121
 
116
122
  # =============================================================================
117
123
  # PATHS
@@ -10245,6 +10251,416 @@ paths:
10245
10251
  "403":
10246
10252
  $ref: "#/components/responses/Forbidden"
10247
10253
 
10254
+ # ---------------------------------------------------------------------------
10255
+ # Wallet Access Policies
10256
+ # ---------------------------------------------------------------------------
10257
+
10258
+ /v1/treasury/wallets/access-policies:
10259
+ post:
10260
+ tags: [Wallet Access]
10261
+ summary: Create a wallet access policy
10262
+ description: |
10263
+ Create a role-based wallet access policy granting an agent, user, role,
10264
+ or platform app specific permissions on treasury wallets within a scope
10265
+ (org-wide, platform app, or single wallet). Requires Pro+ tier.
10266
+ operationId: createWalletAccessPolicy
10267
+ security:
10268
+ - BearerAuth: []
10269
+ requestBody:
10270
+ required: true
10271
+ content:
10272
+ application/json:
10273
+ schema:
10274
+ $ref: "#/components/schemas/CreateWalletAccessPolicyRequest"
10275
+ responses:
10276
+ "201":
10277
+ description: Policy created
10278
+ content:
10279
+ application/json:
10280
+ schema:
10281
+ $ref: "#/components/schemas/WalletAccessPolicyResponse"
10282
+ "400":
10283
+ $ref: "#/components/responses/BadRequest"
10284
+ "401":
10285
+ $ref: "#/components/responses/Unauthorized"
10286
+ "403":
10287
+ $ref: "#/components/responses/Forbidden"
10288
+ get:
10289
+ tags: [Wallet Access]
10290
+ summary: List wallet access policies for the org
10291
+ operationId: listWalletAccessPolicies
10292
+ security:
10293
+ - BearerAuth: []
10294
+ parameters:
10295
+ - name: scope_type
10296
+ in: query
10297
+ schema:
10298
+ type: string
10299
+ enum: [wallet, platform_app, org]
10300
+ description: Filter by scope type
10301
+ - name: scope_id
10302
+ in: query
10303
+ schema:
10304
+ type: string
10305
+ format: uuid
10306
+ description: Filter by scope ID (wallet or platform app UUID)
10307
+ responses:
10308
+ "200":
10309
+ description: Policy list
10310
+ content:
10311
+ application/json:
10312
+ schema:
10313
+ $ref: "#/components/schemas/WalletAccessPolicyListResponse"
10314
+ "401":
10315
+ $ref: "#/components/responses/Unauthorized"
10316
+
10317
+ /v1/treasury/wallets/access-policies/{id}:
10318
+ delete:
10319
+ tags: [Wallet Access]
10320
+ summary: Delete a wallet access policy
10321
+ operationId: deleteWalletAccessPolicy
10322
+ security:
10323
+ - BearerAuth: []
10324
+ parameters:
10325
+ - name: id
10326
+ in: path
10327
+ required: true
10328
+ schema:
10329
+ type: string
10330
+ format: uuid
10331
+ responses:
10332
+ "204":
10333
+ description: Policy deleted
10334
+ "401":
10335
+ $ref: "#/components/responses/Unauthorized"
10336
+ "403":
10337
+ $ref: "#/components/responses/Forbidden"
10338
+ "404":
10339
+ $ref: "#/components/responses/NotFound"
10340
+
10341
+ # ---------------------------------------------------------------------------
10342
+ # Credential Recovery
10343
+ # ---------------------------------------------------------------------------
10344
+
10345
+ /v1/auth/credential-recovery/request:
10346
+ post:
10347
+ tags: [Credential Recovery]
10348
+ summary: Initiate credential recovery
10349
+ description: |
10350
+ Start a credential recovery request for MFA reset, passkey reset,
10351
+ or password reset. Requires admin approval per org policy.
10352
+ operationId: requestCredentialRecovery
10353
+ security:
10354
+ - BearerAuth: []
10355
+ requestBody:
10356
+ required: true
10357
+ content:
10358
+ application/json:
10359
+ schema:
10360
+ $ref: "#/components/schemas/CredentialRecoveryRequest"
10361
+ responses:
10362
+ "201":
10363
+ description: Recovery request created
10364
+ content:
10365
+ application/json:
10366
+ schema:
10367
+ $ref: "#/components/schemas/CredentialRecoveryResponse"
10368
+ "400":
10369
+ $ref: "#/components/responses/BadRequest"
10370
+ "401":
10371
+ $ref: "#/components/responses/Unauthorized"
10372
+
10373
+ /v1/auth/credential-recovery/requests:
10374
+ get:
10375
+ tags: [Credential Recovery]
10376
+ summary: List recovery requests for the org
10377
+ description: Admin/owner only. Returns pending, approved, and rejected recovery requests.
10378
+ operationId: listCredentialRecoveryRequests
10379
+ security:
10380
+ - BearerAuth: []
10381
+ parameters:
10382
+ - name: status
10383
+ in: query
10384
+ schema:
10385
+ type: string
10386
+ enum: [pending_approval, approved, rejected, expired]
10387
+ description: Filter by status
10388
+ responses:
10389
+ "200":
10390
+ description: Recovery request list
10391
+ content:
10392
+ application/json:
10393
+ schema:
10394
+ $ref: "#/components/schemas/CredentialRecoveryListResponse"
10395
+ "401":
10396
+ $ref: "#/components/responses/Unauthorized"
10397
+ "403":
10398
+ $ref: "#/components/responses/Forbidden"
10399
+
10400
+ /v1/auth/credential-recovery/requests/{id}/approve:
10401
+ post:
10402
+ tags: [Credential Recovery]
10403
+ summary: Approve a recovery request
10404
+ description: Admin/owner approves a pending recovery request. May return a one-time recovery code.
10405
+ operationId: approveCredentialRecovery
10406
+ security:
10407
+ - BearerAuth: []
10408
+ parameters:
10409
+ - name: id
10410
+ in: path
10411
+ required: true
10412
+ schema:
10413
+ type: string
10414
+ format: uuid
10415
+ responses:
10416
+ "200":
10417
+ description: Request approved
10418
+ content:
10419
+ application/json:
10420
+ schema:
10421
+ $ref: "#/components/schemas/CredentialRecoveryApproveResponse"
10422
+ "401":
10423
+ $ref: "#/components/responses/Unauthorized"
10424
+ "403":
10425
+ $ref: "#/components/responses/Forbidden"
10426
+ "404":
10427
+ $ref: "#/components/responses/NotFound"
10428
+
10429
+ /v1/auth/credential-recovery/requests/{id}/execute:
10430
+ post:
10431
+ tags: [Credential Recovery]
10432
+ summary: Execute an approved credential recovery request
10433
+ description: >-
10434
+ Execute an approved credential recovery request after the delay
10435
+ window has elapsed. Only org owners or admins can execute.
10436
+ operationId: executeCredentialRecovery
10437
+ security:
10438
+ - BearerAuth: []
10439
+ parameters:
10440
+ - name: id
10441
+ in: path
10442
+ required: true
10443
+ schema:
10444
+ type: string
10445
+ format: uuid
10446
+ responses:
10447
+ "200":
10448
+ description: Recovery executed
10449
+ content:
10450
+ application/json:
10451
+ schema:
10452
+ $ref: "#/components/schemas/CredentialRecoveryExecuteResponse"
10453
+ "401":
10454
+ $ref: "#/components/responses/Unauthorized"
10455
+ "403":
10456
+ $ref: "#/components/responses/Forbidden"
10457
+ "404":
10458
+ $ref: "#/components/responses/NotFound"
10459
+
10460
+ /v1/auth/credential-recovery/requests/{id}:
10461
+ delete:
10462
+ tags: [Credential Recovery]
10463
+ summary: Cancel or reject a recovery request
10464
+ operationId: cancelCredentialRecovery
10465
+ security:
10466
+ - BearerAuth: []
10467
+ parameters:
10468
+ - name: id
10469
+ in: path
10470
+ required: true
10471
+ schema:
10472
+ type: string
10473
+ format: uuid
10474
+ responses:
10475
+ "204":
10476
+ description: Request cancelled
10477
+ "401":
10478
+ $ref: "#/components/responses/Unauthorized"
10479
+ "403":
10480
+ $ref: "#/components/responses/Forbidden"
10481
+ "404":
10482
+ $ref: "#/components/responses/NotFound"
10483
+
10484
+ # ---------------------------------------------------------------------------
10485
+ # Org Credential Recovery Policy
10486
+ # ---------------------------------------------------------------------------
10487
+
10488
+ /v1/org/credential-recovery-policy:
10489
+ get:
10490
+ tags: [Credential Recovery]
10491
+ summary: Get org credential recovery policy
10492
+ operationId: getCredentialRecoveryPolicy
10493
+ security:
10494
+ - BearerAuth: []
10495
+ responses:
10496
+ "200":
10497
+ description: Recovery policy
10498
+ content:
10499
+ application/json:
10500
+ schema:
10501
+ $ref: "#/components/schemas/CredentialRecoveryPolicyResponse"
10502
+ "401":
10503
+ $ref: "#/components/responses/Unauthorized"
10504
+ patch:
10505
+ tags: [Credential Recovery]
10506
+ summary: Update org credential recovery policy
10507
+ operationId: updateCredentialRecoveryPolicy
10508
+ security:
10509
+ - BearerAuth: []
10510
+ requestBody:
10511
+ required: true
10512
+ content:
10513
+ application/json:
10514
+ schema:
10515
+ $ref: "#/components/schemas/CredentialRecoveryPolicyRequest"
10516
+ responses:
10517
+ "200":
10518
+ description: Policy updated
10519
+ content:
10520
+ application/json:
10521
+ schema:
10522
+ $ref: "#/components/schemas/CredentialRecoveryPolicyResponse"
10523
+ "400":
10524
+ $ref: "#/components/responses/BadRequest"
10525
+ "401":
10526
+ $ref: "#/components/responses/Unauthorized"
10527
+ "403":
10528
+ $ref: "#/components/responses/Forbidden"
10529
+
10530
+ # ---------------------------------------------------------------------------
10531
+ # Shamir KEK
10532
+ # ---------------------------------------------------------------------------
10533
+
10534
+ /v1/org/shamir-kek/setup:
10535
+ post:
10536
+ tags: [Shamir KEK]
10537
+ summary: Set up Shamir KEK for the org
10538
+ description: |
10539
+ Initialize a Shamir secret-sharing KEK for the org. Splits the master
10540
+ key into shares distributed to custodians. Shares are returned one-time
10541
+ only and must be stored securely by each custodian.
10542
+ operationId: setupShamirKek
10543
+ security:
10544
+ - BearerAuth: []
10545
+ requestBody:
10546
+ required: true
10547
+ content:
10548
+ application/json:
10549
+ schema:
10550
+ $ref: "#/components/schemas/ShamirKekSetupRequest"
10551
+ responses:
10552
+ "201":
10553
+ description: Shamir KEK configured (shares returned one-time)
10554
+ content:
10555
+ application/json:
10556
+ schema:
10557
+ $ref: "#/components/schemas/ShamirKekSetupResponse"
10558
+ "400":
10559
+ $ref: "#/components/responses/BadRequest"
10560
+ "401":
10561
+ $ref: "#/components/responses/Unauthorized"
10562
+ "403":
10563
+ $ref: "#/components/responses/Forbidden"
10564
+
10565
+ /v1/org/shamir-kek:
10566
+ get:
10567
+ tags: [Shamir KEK]
10568
+ summary: Get Shamir KEK status
10569
+ description: Returns the current Shamir KEK configuration status for the org.
10570
+ operationId: getShamirKekStatus
10571
+ security:
10572
+ - BearerAuth: []
10573
+ responses:
10574
+ "200":
10575
+ description: Shamir KEK status
10576
+ content:
10577
+ application/json:
10578
+ schema:
10579
+ $ref: "#/components/schemas/ShamirKekStatusResponse"
10580
+ "401":
10581
+ $ref: "#/components/responses/Unauthorized"
10582
+
10583
+ /v1/org/shamir-kek/reconstruct:
10584
+ post:
10585
+ tags: [Shamir KEK]
10586
+ summary: Reconstruct KEK from shares
10587
+ description: |
10588
+ Submit Shamir shares to reconstruct the org KEK. Requires at least
10589
+ `threshold` valid shares. Used during disaster recovery.
10590
+ operationId: reconstructShamirKek
10591
+ security:
10592
+ - BearerAuth: []
10593
+ requestBody:
10594
+ required: true
10595
+ content:
10596
+ application/json:
10597
+ schema:
10598
+ $ref: "#/components/schemas/ShamirKekReconstructRequest"
10599
+ responses:
10600
+ "200":
10601
+ description: Reconstruction result
10602
+ content:
10603
+ application/json:
10604
+ schema:
10605
+ $ref: "#/components/schemas/ShamirKekReconstructResponse"
10606
+ "400":
10607
+ $ref: "#/components/responses/BadRequest"
10608
+ "401":
10609
+ $ref: "#/components/responses/Unauthorized"
10610
+ "403":
10611
+ $ref: "#/components/responses/Forbidden"
10612
+
10613
+ /v1/org/shamir-kek/recovery-codes:
10614
+ get:
10615
+ tags: [Shamir KEK]
10616
+ summary: Get Shamir recovery codes (one-time)
10617
+ description: |
10618
+ Returns the one-time recovery codes for the Shamir KEK. These codes
10619
+ can be used as an emergency fallback if custodian shares are lost.
10620
+ Codes are only returned once — subsequent calls return 410.
10621
+ operationId: getShamirKekRecoveryCodes
10622
+ security:
10623
+ - BearerAuth: []
10624
+ responses:
10625
+ "200":
10626
+ description: Recovery codes (one-time)
10627
+ content:
10628
+ application/json:
10629
+ schema:
10630
+ $ref: "#/components/schemas/ShamirKekRecoveryCodesResponse"
10631
+ "401":
10632
+ $ref: "#/components/responses/Unauthorized"
10633
+ "403":
10634
+ $ref: "#/components/responses/Forbidden"
10635
+ "410":
10636
+ description: Codes already retrieved
10637
+
10638
+ /v1/org/shamir-kek/verify-recovery-code:
10639
+ post:
10640
+ tags: [Shamir KEK]
10641
+ summary: Verify a Shamir recovery code
10642
+ description: Check whether a recovery code is valid without consuming it.
10643
+ operationId: verifyShamirKekRecoveryCode
10644
+ security:
10645
+ - BearerAuth: []
10646
+ requestBody:
10647
+ required: true
10648
+ content:
10649
+ application/json:
10650
+ schema:
10651
+ $ref: "#/components/schemas/ShamirKekVerifyCodeRequest"
10652
+ responses:
10653
+ "200":
10654
+ description: Verification result
10655
+ content:
10656
+ application/json:
10657
+ schema:
10658
+ $ref: "#/components/schemas/ShamirKekVerifyCodeResponse"
10659
+ "400":
10660
+ $ref: "#/components/responses/BadRequest"
10661
+ "401":
10662
+ $ref: "#/components/responses/Unauthorized"
10663
+
10248
10664
  # =============================================================================
10249
10665
  # COMPONENTS
10250
10666
  # =============================================================================
@@ -12587,6 +13003,22 @@ components:
12587
13003
  Optional pending approval ID. When consensus policies match,
12588
13004
  clients resubmit with this field set to bypass the 202 gate
12589
13005
  after the approval has been executed.
13006
+ raw_transaction:
13007
+ type: string
13008
+ description: >
13009
+ Pre-built raw transaction as a base64-encoded byte string.
13010
+ When provided, the handler decodes and deep-inspects the
13011
+ transaction for policy evaluation before signing. Supported
13012
+ for non-EVM chains where the client constructs the
13013
+ transaction payload.
13014
+ tron_transaction:
13015
+ type: object
13016
+ additionalProperties: true
13017
+ description: >
13018
+ Pre-built Tron transaction JSON object. When provided,
13019
+ the handler signs the transaction as-is using the Tron
13020
+ protobuf format. Enables full Tron transaction type
13021
+ coverage beyond simple TRX/TRC-20 transfers.
12590
13022
 
12591
13023
  SignTransactionRequest:
12592
13024
  type: object
@@ -13058,9 +13490,25 @@ components:
13058
13490
  type: string
13059
13491
  format: uuid
13060
13492
  description: >
13061
- Optional pending approval ID. When consensus policies match,
13062
- clients resubmit with this field set to bypass the 202 gate
13063
- after the approval has been executed.
13493
+ Optional pending approval ID. When consensus policies match,
13494
+ clients resubmit with this field set to bypass the 202 gate
13495
+ after the approval has been executed.
13496
+ raw_transaction:
13497
+ type: string
13498
+ description: >
13499
+ Pre-built raw transaction as a base64-encoded byte string.
13500
+ When provided, the handler decodes and deep-inspects the
13501
+ transaction for policy evaluation before signing. Supported
13502
+ for non-EVM chains where the client constructs the
13503
+ transaction payload.
13504
+ tron_transaction:
13505
+ type: object
13506
+ additionalProperties: true
13507
+ description: >
13508
+ Pre-built Tron transaction JSON object. When provided,
13509
+ the handler signs the transaction as-is using the Tron
13510
+ protobuf format. Enables full Tron transaction type
13511
+ coverage beyond simple TRX/TRC-20 transfers.
13064
13512
 
13065
13513
  SignIntentResponse:
13066
13514
  type: object
@@ -13824,17 +14272,31 @@ components:
13824
14272
 
13825
14273
  ShroudAttestationResponse:
13826
14274
  type: object
13827
- required: [attested, image_hash, identity_token, verification]
14275
+ required: [attested, attestation_level, image_hash, identity_token, verification]
13828
14276
  properties:
13829
14277
  attested:
13830
14278
  type: boolean
13831
- description: Whether TEE attestation was successfully fetched
14279
+ description: |
14280
+ Whether at least an identity token was obtained (true for identity,
14281
+ confidential, or sev_snp levels). Backward-compatible boolean; prefer
14282
+ attestation_level for granularity.
14283
+ attestation_level:
14284
+ type: string
14285
+ enum: [none, identity, confidential, sev_snp]
14286
+ description: |
14287
+ Granularity of TEE attestation achieved. `none` = dev/non-GCE;
14288
+ `identity` = GCE metadata JWT only; `confidential` = CC claims present;
14289
+ `sev_snp` = full SEV-SNP measurement verified against image digest.
13832
14290
  image_hash:
13833
14291
  type: string
13834
14292
  description: Confidential VM image hash (compare against published Docker digest)
13835
14293
  identity_token:
13836
14294
  type: string
13837
14295
  description: GCE metadata identity JWT (verify against Google public keys)
14296
+ confidential_claims:
14297
+ nullable: true
14298
+ description: Confidential Computing claims extracted from the identity JWT
14299
+ $ref: "#/components/schemas/ConfidentialClaims"
13838
14300
  verification:
13839
14301
  type: object
13840
14302
  properties:
@@ -13848,6 +14310,23 @@ components:
13848
14310
  expected_audience:
13849
14311
  type: string
13850
14312
 
14313
+ ConfidentialClaims:
14314
+ type: object
14315
+ nullable: true
14316
+ properties:
14317
+ secboot:
14318
+ type: boolean
14319
+ description: Whether secure boot was enabled
14320
+ hwmodel:
14321
+ type: string
14322
+ description: Hardware model string (e.g. GCP_AMD_SEV)
14323
+ instance_confidentiality:
14324
+ type: string
14325
+ description: Instance confidentiality level from google.compute_engine
14326
+ sw_name:
14327
+ type: string
14328
+ description: Software name claim (swname or sw_name)
14329
+
13851
14330
  AuditEvent:
13852
14331
  type: object
13853
14332
  properties:
@@ -18544,3 +19023,355 @@ components:
18544
19023
  type: string
18545
19024
  comment:
18546
19025
  type: string
19026
+
19027
+ # -----------------------------------------------------------------
19028
+ # Wallet Access Policy schemas
19029
+ # -----------------------------------------------------------------
19030
+
19031
+ CreateWalletAccessPolicyRequest:
19032
+ type: object
19033
+ required: [scope_type, principal_type, principal_id]
19034
+ properties:
19035
+ scope_type:
19036
+ type: string
19037
+ enum: [wallet, platform_app, org]
19038
+ description: Policy scope — org-wide, platform app, or single wallet
19039
+ scope_id:
19040
+ type: string
19041
+ format: uuid
19042
+ nullable: true
19043
+ description: Wallet or platform app UUID when scope_type is not org
19044
+ principal_type:
19045
+ type: string
19046
+ enum: [user, agent, role, platform_app]
19047
+ description: Who receives the grant
19048
+ principal_id:
19049
+ type: string
19050
+ description: User/agent UUID, role name, or platform app UUID
19051
+ can_sign:
19052
+ type: boolean
19053
+ default: false
19054
+ can_view_balance:
19055
+ type: boolean
19056
+ default: true
19057
+ can_export:
19058
+ type: boolean
19059
+ default: false
19060
+ can_send:
19061
+ type: boolean
19062
+ default: false
19063
+ can_swap:
19064
+ type: boolean
19065
+ default: false
19066
+ allowed_chains:
19067
+ type: array
19068
+ items:
19069
+ type: string
19070
+ description: Chains this policy applies to (empty = all)
19071
+ max_value_per_tx_eth:
19072
+ type: string
19073
+ description: Max value per transaction in ETH
19074
+ daily_limit_eth:
19075
+ type: string
19076
+ description: Daily spend limit in ETH
19077
+ conditions:
19078
+ type: object
19079
+ description: Additional JSON conditions (reserved for future enforcement)
19080
+ expires_at:
19081
+ type: string
19082
+ format: date-time
19083
+
19084
+ WalletAccessPolicyResponse:
19085
+ type: object
19086
+ properties:
19087
+ id:
19088
+ type: string
19089
+ format: uuid
19090
+ org_id:
19091
+ type: string
19092
+ format: uuid
19093
+ scope_type:
19094
+ type: string
19095
+ scope_id:
19096
+ type: string
19097
+ format: uuid
19098
+ nullable: true
19099
+ principal_type:
19100
+ type: string
19101
+ principal_id:
19102
+ type: string
19103
+ can_sign:
19104
+ type: boolean
19105
+ can_view_balance:
19106
+ type: boolean
19107
+ can_export:
19108
+ type: boolean
19109
+ can_send:
19110
+ type: boolean
19111
+ can_swap:
19112
+ type: boolean
19113
+ allowed_chains:
19114
+ type: array
19115
+ items:
19116
+ type: string
19117
+ max_value_per_tx_eth:
19118
+ type: string
19119
+ nullable: true
19120
+ daily_limit_eth:
19121
+ type: string
19122
+ nullable: true
19123
+ conditions:
19124
+ type: object
19125
+ is_active:
19126
+ type: boolean
19127
+ expires_at:
19128
+ type: string
19129
+ format: date-time
19130
+ nullable: true
19131
+ created_by:
19132
+ type: string
19133
+ format: uuid
19134
+ created_at:
19135
+ type: string
19136
+ format: date-time
19137
+ updated_at:
19138
+ type: string
19139
+ format: date-time
19140
+
19141
+ WalletAccessPolicyListResponse:
19142
+ type: object
19143
+ properties:
19144
+ policies:
19145
+ type: array
19146
+ items:
19147
+ $ref: "#/components/schemas/WalletAccessPolicyResponse"
19148
+
19149
+ # -----------------------------------------------------------------
19150
+ # Credential Recovery schemas
19151
+ # -----------------------------------------------------------------
19152
+
19153
+ CredentialRecoveryRequest:
19154
+ type: object
19155
+ required: [recovery_type]
19156
+ properties:
19157
+ recovery_type:
19158
+ type: string
19159
+ enum: [mfa_reset, passkey_reset, password_reset]
19160
+ reason:
19161
+ type: string
19162
+ description: Optional justification for the recovery request
19163
+
19164
+ CredentialRecoveryResponse:
19165
+ type: object
19166
+ properties:
19167
+ request_id:
19168
+ type: string
19169
+ format: uuid
19170
+ status:
19171
+ type: string
19172
+ enum: [pending_approval, approved, rejected, expired]
19173
+ recovery_type:
19174
+ type: string
19175
+ enum: [mfa_reset, passkey_reset, password_reset]
19176
+ created_at:
19177
+ type: string
19178
+ format: date-time
19179
+
19180
+ CredentialRecoveryListResponse:
19181
+ type: object
19182
+ properties:
19183
+ requests:
19184
+ type: array
19185
+ items:
19186
+ $ref: "#/components/schemas/CredentialRecoveryResponse"
19187
+
19188
+ CredentialRecoveryApproveResponse:
19189
+ type: object
19190
+ properties:
19191
+ request_id:
19192
+ type: string
19193
+ format: uuid
19194
+ status:
19195
+ type: string
19196
+ enum: [approved]
19197
+ recovery_code:
19198
+ type: string
19199
+ nullable: true
19200
+ description: One-time recovery code (only present for certain recovery types)
19201
+
19202
+ CredentialRecoveryExecuteResponse:
19203
+ type: object
19204
+ properties:
19205
+ request_id:
19206
+ type: string
19207
+ format: uuid
19208
+ status:
19209
+ type: string
19210
+ enum: [executed]
19211
+ recovery_type:
19212
+ type: string
19213
+ executed_at:
19214
+ type: string
19215
+ format: date-time
19216
+
19217
+ CredentialRecoveryPolicyResponse:
19218
+ type: object
19219
+ properties:
19220
+ enabled:
19221
+ type: boolean
19222
+ require_admin_approval:
19223
+ type: boolean
19224
+ delay_hours:
19225
+ type: integer
19226
+ description: Waiting period before recovery takes effect
19227
+ allowed_types:
19228
+ type: array
19229
+ items:
19230
+ type: string
19231
+ enum: [mfa_reset, passkey_reset, password_reset]
19232
+
19233
+ CredentialRecoveryPolicyRequest:
19234
+ type: object
19235
+ properties:
19236
+ enabled:
19237
+ type: boolean
19238
+ require_admin_approval:
19239
+ type: boolean
19240
+ delay_hours:
19241
+ type: integer
19242
+ allowed_types:
19243
+ type: array
19244
+ items:
19245
+ type: string
19246
+ enum: [mfa_reset, passkey_reset, password_reset]
19247
+
19248
+ # -----------------------------------------------------------------
19249
+ # Shamir KEK schemas
19250
+ # -----------------------------------------------------------------
19251
+
19252
+ ShamirKekSetupRequest:
19253
+ type: object
19254
+ required: [threshold, total_shares, custodian_emails]
19255
+ properties:
19256
+ threshold:
19257
+ type: integer
19258
+ enum: [2, 3]
19259
+ description: Minimum shares required to reconstruct the KEK
19260
+ total_shares:
19261
+ type: integer
19262
+ enum: [3, 5]
19263
+ description: Total number of shares to generate
19264
+ custodian_emails:
19265
+ type: array
19266
+ items:
19267
+ type: string
19268
+ format: email
19269
+ description: Email addresses of share custodians
19270
+
19271
+ ShamirKekSetupResponse:
19272
+ type: object
19273
+ properties:
19274
+ kek_id:
19275
+ type: string
19276
+ threshold:
19277
+ type: integer
19278
+ total_shares:
19279
+ type: integer
19280
+ shares:
19281
+ type: array
19282
+ description: One-time share distribution (never returned again)
19283
+ items:
19284
+ type: object
19285
+ properties:
19286
+ index:
19287
+ type: integer
19288
+ custodian_email:
19289
+ type: string
19290
+ format: email
19291
+ share_b64:
19292
+ type: string
19293
+ description: Base64-encoded share
19294
+ custody_mode:
19295
+ type: string
19296
+ created_at:
19297
+ type: string
19298
+ format: date-time
19299
+
19300
+ ShamirKekStatusResponse:
19301
+ type: object
19302
+ properties:
19303
+ configured:
19304
+ type: boolean
19305
+ kek_id:
19306
+ type: string
19307
+ nullable: true
19308
+ threshold:
19309
+ type: integer
19310
+ nullable: true
19311
+ total_shares:
19312
+ type: integer
19313
+ nullable: true
19314
+ custody_mode:
19315
+ type: string
19316
+ nullable: true
19317
+ custodians:
19318
+ type: array
19319
+ nullable: true
19320
+ items:
19321
+ type: object
19322
+ properties:
19323
+ email:
19324
+ type: string
19325
+ format: email
19326
+ share_provided:
19327
+ type: boolean
19328
+ created_at:
19329
+ type: string
19330
+ format: date-time
19331
+ nullable: true
19332
+
19333
+ ShamirKekReconstructRequest:
19334
+ type: object
19335
+ required: [shares]
19336
+ properties:
19337
+ shares:
19338
+ type: array
19339
+ items:
19340
+ type: object
19341
+ required: [index, share_b64]
19342
+ properties:
19343
+ index:
19344
+ type: integer
19345
+ share_b64:
19346
+ type: string
19347
+ description: Base64-encoded share
19348
+
19349
+ ShamirKekReconstructResponse:
19350
+ type: object
19351
+ properties:
19352
+ status:
19353
+ type: string
19354
+ enum: [accepted, reconstructed]
19355
+ message:
19356
+ type: string
19357
+
19358
+ ShamirKekRecoveryCodesResponse:
19359
+ type: object
19360
+ properties:
19361
+ codes:
19362
+ type: array
19363
+ items:
19364
+ type: string
19365
+
19366
+ ShamirKekVerifyCodeRequest:
19367
+ type: object
19368
+ required: [code]
19369
+ properties:
19370
+ code:
19371
+ type: string
19372
+
19373
+ ShamirKekVerifyCodeResponse:
19374
+ type: object
19375
+ properties:
19376
+ valid:
19377
+ type: boolean