@1claw/openapi-spec 0.23.2 → 0.25.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.
package/openapi.yaml CHANGED
@@ -2,7 +2,7 @@ openapi: 3.1.0
2
2
 
3
3
  info:
4
4
  title: 1Claw API
5
- version: 2.12.0
5
+ version: 2.14.0
6
6
  description: |
7
7
  Secure secret management for AI agents. Provides vaults, secrets,
8
8
  policy-based access control, agent identity, Intents API,
@@ -62,6 +62,8 @@ tags:
62
62
  description: Platform administration
63
63
  - name: Health
64
64
  description: Service health checks
65
+ - name: Approvals
66
+ description: Human-in-the-loop approval workflow for agent actions
65
67
  - name: Platform
66
68
  description: Platform API for developers building on 1Claw (plt_ keys, user provisioning, bootstrap templates)
67
69
 
@@ -446,6 +448,334 @@ paths:
446
448
  "400":
447
449
  $ref: "#/components/responses/BadRequest"
448
450
 
451
+ /v1/auth/set-password:
452
+ post:
453
+ tags: [Authentication]
454
+ summary: Set initial password for platform users
455
+ description: Only allowed when the user has no password set (platform_oidc users after claiming).
456
+ operationId: setPassword
457
+ requestBody:
458
+ required: true
459
+ content:
460
+ application/json:
461
+ schema:
462
+ type: object
463
+ required: [password, password_confirm]
464
+ properties:
465
+ password:
466
+ type: string
467
+ minLength: 12
468
+ password_confirm:
469
+ type: string
470
+ responses:
471
+ "200":
472
+ description: Password set successfully
473
+ content:
474
+ application/json:
475
+ schema:
476
+ type: object
477
+ properties:
478
+ message:
479
+ type: string
480
+ "400":
481
+ $ref: "#/components/responses/BadRequest"
482
+
483
+ /v1/auth/change-email:
484
+ post:
485
+ tags: [Authentication]
486
+ summary: Request email change
487
+ description: Sends a 6-digit verification code to the new email address. Code expires in 10 minutes.
488
+ operationId: changeEmail
489
+ requestBody:
490
+ required: true
491
+ content:
492
+ application/json:
493
+ schema:
494
+ type: object
495
+ required: [new_email]
496
+ properties:
497
+ new_email:
498
+ type: string
499
+ format: email
500
+ responses:
501
+ "200":
502
+ description: Verification code sent
503
+ content:
504
+ application/json:
505
+ schema:
506
+ type: object
507
+ properties:
508
+ message:
509
+ type: string
510
+ new_email:
511
+ type: string
512
+ expires_in_seconds:
513
+ type: integer
514
+ "400":
515
+ $ref: "#/components/responses/BadRequest"
516
+ "409":
517
+ description: Email already in use
518
+
519
+ /v1/auth/verify-email-change:
520
+ post:
521
+ tags: [Authentication]
522
+ summary: Verify email change with code
523
+ operationId: verifyEmailChange
524
+ requestBody:
525
+ required: true
526
+ content:
527
+ application/json:
528
+ schema:
529
+ type: object
530
+ required: [code]
531
+ properties:
532
+ code:
533
+ type: string
534
+ responses:
535
+ "200":
536
+ description: Email updated
537
+ content:
538
+ application/json:
539
+ schema:
540
+ type: object
541
+ properties:
542
+ message:
543
+ type: string
544
+ email:
545
+ type: string
546
+ "400":
547
+ $ref: "#/components/responses/BadRequest"
548
+
549
+ /v1/auth/passkeys/register/begin:
550
+ post:
551
+ tags: [Authentication]
552
+ summary: Begin passkey registration
553
+ description: Returns a WebAuthn challenge for creating a new passkey credential.
554
+ operationId: passkeyRegisterBegin
555
+ responses:
556
+ "200":
557
+ description: Registration options
558
+ content:
559
+ application/json:
560
+ schema:
561
+ type: object
562
+ properties:
563
+ challenge:
564
+ type: string
565
+ rp_id:
566
+ type: string
567
+ rp_name:
568
+ type: string
569
+ user_id:
570
+ type: string
571
+ user_name:
572
+ type: string
573
+ user_display_name:
574
+ type: string
575
+ attestation:
576
+ type: string
577
+ authenticator_selection:
578
+ type: object
579
+
580
+ /v1/auth/passkeys/register/complete:
581
+ post:
582
+ tags: [Authentication]
583
+ summary: Complete passkey registration
584
+ operationId: passkeyRegisterComplete
585
+ requestBody:
586
+ required: true
587
+ content:
588
+ application/json:
589
+ schema:
590
+ type: object
591
+ required: [credential_id, attestation_object, client_data_json]
592
+ properties:
593
+ credential_id:
594
+ type: string
595
+ attestation_object:
596
+ type: string
597
+ client_data_json:
598
+ type: string
599
+ transports:
600
+ type: array
601
+ items:
602
+ type: string
603
+ name:
604
+ type: string
605
+ responses:
606
+ "201":
607
+ description: Passkey registered
608
+ content:
609
+ application/json:
610
+ schema:
611
+ type: object
612
+ properties:
613
+ passkey_id:
614
+ type: string
615
+ format: uuid
616
+ credential_id:
617
+ type: string
618
+
619
+ /v1/auth/passkeys/assert/begin:
620
+ post:
621
+ tags: [Authentication]
622
+ summary: Begin passkey authentication
623
+ operationId: passkeyAssertBegin
624
+ security: []
625
+ requestBody:
626
+ required: true
627
+ content:
628
+ application/json:
629
+ schema:
630
+ type: object
631
+ properties:
632
+ email:
633
+ type: string
634
+ format: email
635
+ responses:
636
+ "200":
637
+ description: Assertion options
638
+ content:
639
+ application/json:
640
+ schema:
641
+ type: object
642
+ properties:
643
+ challenge:
644
+ type: string
645
+ rp_id:
646
+ type: string
647
+ timeout:
648
+ type: integer
649
+ user_verification:
650
+ type: string
651
+ allow_credentials:
652
+ type: array
653
+ items:
654
+ type: object
655
+
656
+ /v1/auth/passkeys/assert/complete:
657
+ post:
658
+ tags: [Authentication]
659
+ summary: Complete passkey authentication
660
+ operationId: passkeyAssertComplete
661
+ security: []
662
+ requestBody:
663
+ required: true
664
+ content:
665
+ application/json:
666
+ schema:
667
+ type: object
668
+ required: [credential_id, authenticator_data, client_data_json, signature]
669
+ properties:
670
+ credential_id:
671
+ type: string
672
+ authenticator_data:
673
+ type: string
674
+ client_data_json:
675
+ type: string
676
+ signature:
677
+ type: string
678
+ responses:
679
+ "200":
680
+ description: Authentication successful
681
+ content:
682
+ application/json:
683
+ schema:
684
+ type: object
685
+ properties:
686
+ token:
687
+ type: string
688
+ refresh_token:
689
+ type: string
690
+ user:
691
+ type: object
692
+
693
+ /v1/auth/passkeys:
694
+ get:
695
+ tags: [Authentication]
696
+ summary: List registered passkeys
697
+ operationId: listPasskeys
698
+ responses:
699
+ "200":
700
+ description: List of passkeys
701
+ content:
702
+ application/json:
703
+ schema:
704
+ type: object
705
+ properties:
706
+ passkeys:
707
+ type: array
708
+ items:
709
+ type: object
710
+ properties:
711
+ id:
712
+ type: string
713
+ format: uuid
714
+ credential_id:
715
+ type: string
716
+ name:
717
+ type: string
718
+ last_used_at:
719
+ type: string
720
+ created_at:
721
+ type: string
722
+
723
+ /v1/auth/passkeys/{passkey_id}:
724
+ delete:
725
+ tags: [Authentication]
726
+ summary: Delete a passkey
727
+ operationId: deletePasskey
728
+ parameters:
729
+ - name: passkey_id
730
+ in: path
731
+ required: true
732
+ schema:
733
+ type: string
734
+ format: uuid
735
+ responses:
736
+ "200":
737
+ description: Passkey deleted
738
+
739
+ /v1/approvals/request:
740
+ post:
741
+ tags: [Approvals]
742
+ summary: Request human approval (agent-only)
743
+ description: Agents can request policy changes or other sensitive actions that require human approval.
744
+ operationId: requestApproval
745
+ requestBody:
746
+ required: true
747
+ content:
748
+ application/json:
749
+ schema:
750
+ type: object
751
+ required: [action, target_type, target_id, summary]
752
+ properties:
753
+ action:
754
+ type: string
755
+ description: "Type of action (e.g. policy_change)"
756
+ target_type:
757
+ type: string
758
+ target_id:
759
+ type: string
760
+ summary:
761
+ type: object
762
+ description: "JSON payload describing the request"
763
+ reason:
764
+ type: string
765
+ risk_tier:
766
+ type: integer
767
+ minimum: 1
768
+ maximum: 5
769
+ responses:
770
+ "202":
771
+ description: Approval request created
772
+ content:
773
+ application/json:
774
+ schema:
775
+ $ref: "#/components/schemas/ApprovalResponse"
776
+ "403":
777
+ $ref: "#/components/responses/Forbidden"
778
+
449
779
  /v1/auth/me:
450
780
  get:
451
781
  tags: [Authentication]
@@ -871,6 +1201,157 @@ paths:
871
1201
  "403":
872
1202
  $ref: "#/components/responses/Forbidden"
873
1203
 
1204
+ /v1/auth/devices:
1205
+ post:
1206
+ tags: [Authentication]
1207
+ summary: Register a mobile device
1208
+ description: |
1209
+ Register a new mobile device for the authenticated user. Human-only.
1210
+ The device public key is used for step-up authentication challenges.
1211
+ operationId: registerDevice
1212
+ requestBody:
1213
+ required: true
1214
+ content:
1215
+ application/json:
1216
+ schema:
1217
+ $ref: "#/components/schemas/RegisterDeviceRequest"
1218
+ responses:
1219
+ "201":
1220
+ description: Device registered
1221
+ content:
1222
+ application/json:
1223
+ schema:
1224
+ $ref: "#/components/schemas/RegisterDeviceResponse"
1225
+ "400":
1226
+ $ref: "#/components/responses/BadRequest"
1227
+ "403":
1228
+ $ref: "#/components/responses/Forbidden"
1229
+ get:
1230
+ tags: [Authentication]
1231
+ summary: List devices for current user
1232
+ description: Returns all registered mobile devices for the authenticated user.
1233
+ operationId: listDevices
1234
+ responses:
1235
+ "200":
1236
+ description: Device list
1237
+ content:
1238
+ application/json:
1239
+ schema:
1240
+ $ref: "#/components/schemas/DeviceListResponse"
1241
+
1242
+ /v1/auth/devices/{device_id}:
1243
+ delete:
1244
+ tags: [Authentication]
1245
+ summary: Revoke a device
1246
+ description: Removes a registered device, invalidating its keys and push tokens.
1247
+ operationId: revokeDevice
1248
+ parameters:
1249
+ - name: device_id
1250
+ in: path
1251
+ required: true
1252
+ schema:
1253
+ type: string
1254
+ format: uuid
1255
+ responses:
1256
+ "204":
1257
+ description: Device revoked
1258
+ "404":
1259
+ $ref: "#/components/responses/NotFound"
1260
+
1261
+ /v1/auth/devices/{device_id}/challenge:
1262
+ post:
1263
+ tags: [Authentication]
1264
+ summary: Create step-up auth challenge
1265
+ description: |
1266
+ Creates a cryptographic challenge bound to a specific action (e.g. approving
1267
+ a high-risk transaction). The device signs the challenge nonce to prove
1268
+ possession of the private key.
1269
+ operationId: createDeviceChallenge
1270
+ parameters:
1271
+ - name: device_id
1272
+ in: path
1273
+ required: true
1274
+ schema:
1275
+ type: string
1276
+ format: uuid
1277
+ requestBody:
1278
+ required: true
1279
+ content:
1280
+ application/json:
1281
+ schema:
1282
+ $ref: "#/components/schemas/CreateDeviceChallengeRequest"
1283
+ responses:
1284
+ "200":
1285
+ description: Challenge created
1286
+ content:
1287
+ application/json:
1288
+ schema:
1289
+ $ref: "#/components/schemas/DeviceChallengeResponse"
1290
+ "404":
1291
+ $ref: "#/components/responses/NotFound"
1292
+
1293
+ /v1/auth/devices/{device_id}/attest:
1294
+ post:
1295
+ tags: [Authentication]
1296
+ summary: Attest device challenge
1297
+ description: |
1298
+ Submit a signed challenge nonce to complete step-up authentication.
1299
+ Returns a short-lived step-up token that can be used for the bound action.
1300
+ operationId: attestDeviceChallenge
1301
+ parameters:
1302
+ - name: device_id
1303
+ in: path
1304
+ required: true
1305
+ schema:
1306
+ type: string
1307
+ format: uuid
1308
+ requestBody:
1309
+ required: true
1310
+ content:
1311
+ application/json:
1312
+ schema:
1313
+ $ref: "#/components/schemas/AttestDeviceChallengeRequest"
1314
+ responses:
1315
+ "200":
1316
+ description: Attestation successful
1317
+ content:
1318
+ application/json:
1319
+ schema:
1320
+ $ref: "#/components/schemas/AttestDeviceChallengeResponse"
1321
+ "400":
1322
+ $ref: "#/components/responses/BadRequest"
1323
+ "404":
1324
+ $ref: "#/components/responses/NotFound"
1325
+
1326
+ /v1/auth/devices/{device_id}/push-token:
1327
+ post:
1328
+ tags: [Authentication]
1329
+ summary: Register push notification token
1330
+ description: |
1331
+ Associates a push notification token (APNs or FCM) with a registered device
1332
+ so the server can send approval requests and alerts.
1333
+ operationId: registerPushToken
1334
+ parameters:
1335
+ - name: device_id
1336
+ in: path
1337
+ required: true
1338
+ schema:
1339
+ type: string
1340
+ format: uuid
1341
+ requestBody:
1342
+ required: true
1343
+ content:
1344
+ application/json:
1345
+ schema:
1346
+ $ref: "#/components/schemas/RegisterPushTokenRequest"
1347
+ responses:
1348
+ "204":
1349
+ description: Push token registered
1350
+ "400":
1351
+ $ref: "#/components/responses/BadRequest"
1352
+ "404":
1353
+ $ref: "#/components/responses/NotFound"
1354
+
874
1355
  # ---------------------------------------------------------------------------
875
1356
  # Vaults
876
1357
  # ---------------------------------------------------------------------------
@@ -3780,6 +4261,108 @@ paths:
3780
4261
  "410":
3781
4262
  description: Claim token has expired
3782
4263
 
4264
+ # --- Approvals ---
4265
+
4266
+ /v1/approvals:
4267
+ get:
4268
+ tags: [Approvals]
4269
+ summary: List pending approvals
4270
+ description: |
4271
+ Returns approvals for the authenticated user's organization.
4272
+ Human-only. Supports filtering by status and pagination.
4273
+ operationId: listApprovals
4274
+ parameters:
4275
+ - name: status
4276
+ in: query
4277
+ required: false
4278
+ schema:
4279
+ type: string
4280
+ enum: [pending, approved, rejected, expired]
4281
+ description: Filter by approval status
4282
+ - name: limit
4283
+ in: query
4284
+ required: false
4285
+ schema:
4286
+ type: integer
4287
+ default: 50
4288
+ - name: offset
4289
+ in: query
4290
+ required: false
4291
+ schema:
4292
+ type: integer
4293
+ default: 0
4294
+ responses:
4295
+ "200":
4296
+ description: Approval list
4297
+ content:
4298
+ application/json:
4299
+ schema:
4300
+ type: object
4301
+ required: [approvals]
4302
+ properties:
4303
+ approvals:
4304
+ type: array
4305
+ items:
4306
+ $ref: "#/components/schemas/ApprovalResponse"
4307
+
4308
+ /v1/approvals/{approval_id}:
4309
+ get:
4310
+ tags: [Approvals]
4311
+ summary: Get approval details
4312
+ description: Returns details for a single approval by ID.
4313
+ operationId: getApproval
4314
+ parameters:
4315
+ - name: approval_id
4316
+ in: path
4317
+ required: true
4318
+ schema:
4319
+ type: string
4320
+ format: uuid
4321
+ responses:
4322
+ "200":
4323
+ description: Approval details
4324
+ content:
4325
+ application/json:
4326
+ schema:
4327
+ $ref: "#/components/schemas/ApprovalResponse"
4328
+ "404":
4329
+ $ref: "#/components/responses/NotFound"
4330
+
4331
+ /v1/approvals/{approval_id}/decide:
4332
+ post:
4333
+ tags: [Approvals]
4334
+ summary: Approve or reject
4335
+ description: |
4336
+ Submit a decision (approve or reject) for a pending approval.
4337
+ Human-only. The approval must be in `pending` status.
4338
+ operationId: decideApproval
4339
+ parameters:
4340
+ - name: approval_id
4341
+ in: path
4342
+ required: true
4343
+ schema:
4344
+ type: string
4345
+ format: uuid
4346
+ requestBody:
4347
+ required: true
4348
+ content:
4349
+ application/json:
4350
+ schema:
4351
+ $ref: "#/components/schemas/DecideApprovalRequest"
4352
+ responses:
4353
+ "200":
4354
+ description: Decision recorded
4355
+ content:
4356
+ application/json:
4357
+ schema:
4358
+ $ref: "#/components/schemas/ApprovalResponse"
4359
+ "400":
4360
+ $ref: "#/components/responses/BadRequest"
4361
+ "404":
4362
+ $ref: "#/components/responses/NotFound"
4363
+ "409":
4364
+ $ref: "#/components/responses/Conflict"
4365
+
3783
4366
  # =============================================================================
3784
4367
  # COMPONENTS
3785
4368
  # =============================================================================
@@ -7222,6 +7805,29 @@ components:
7222
7805
  items:
7223
7806
  type: string
7224
7807
  format: uuid
7808
+ signing_key_chains:
7809
+ type: array
7810
+ items:
7811
+ type: string
7812
+ description: Chains with provisioned signing keys
7813
+ agent_api_key:
7814
+ type: string
7815
+ nullable: true
7816
+ description: One-time agent API key (ocv_ prefix). Store securely — not retrievable later.
7817
+ signing_keys:
7818
+ type: array
7819
+ description: Provisioned signing key details (chain, address, public key)
7820
+ items:
7821
+ type: object
7822
+ properties:
7823
+ chain:
7824
+ type: string
7825
+ curve:
7826
+ type: string
7827
+ public_key:
7828
+ type: string
7829
+ address:
7830
+ type: string
7225
7831
 
7226
7832
  ConnectedAppResponse:
7227
7833
  type: object
@@ -7306,3 +7912,185 @@ components:
7306
7912
  nullable: true
7307
7913
  dashboard_url:
7308
7914
  type: string
7915
+
7916
+ # --- Mobile Companion App schemas ---
7917
+
7918
+ RegisterDeviceRequest:
7919
+ type: object
7920
+ required: [name, platform, public_key_pem]
7921
+ properties:
7922
+ name:
7923
+ type: string
7924
+ description: Human-readable device name (e.g. "Kevin's iPhone")
7925
+ example: My iPhone
7926
+ platform:
7927
+ type: string
7928
+ enum: [ios, android]
7929
+ public_key_pem:
7930
+ type: string
7931
+ description: PEM-encoded public key for step-up challenge signing
7932
+ attestation_blob:
7933
+ type: string
7934
+ description: Optional platform attestation (Apple DeviceCheck / Android SafetyNet)
7935
+
7936
+ RegisterDeviceResponse:
7937
+ type: object
7938
+ required: [device_id, attestation_verified]
7939
+ properties:
7940
+ device_id:
7941
+ type: string
7942
+ format: uuid
7943
+ attestation_verified:
7944
+ type: boolean
7945
+
7946
+ DeviceListResponse:
7947
+ type: object
7948
+ required: [devices]
7949
+ properties:
7950
+ devices:
7951
+ type: array
7952
+ items:
7953
+ $ref: "#/components/schemas/DeviceResponse"
7954
+
7955
+ DeviceResponse:
7956
+ type: object
7957
+ required: [id, name, platform, attestation_verified, created_at]
7958
+ properties:
7959
+ id:
7960
+ type: string
7961
+ format: uuid
7962
+ name:
7963
+ type: string
7964
+ platform:
7965
+ type: string
7966
+ attestation_verified:
7967
+ type: boolean
7968
+ last_used_at:
7969
+ type: string
7970
+ format: date-time
7971
+ nullable: true
7972
+ created_at:
7973
+ type: string
7974
+ format: date-time
7975
+
7976
+ CreateDeviceChallengeRequest:
7977
+ type: object
7978
+ required: [action, target_id]
7979
+ properties:
7980
+ action:
7981
+ type: string
7982
+ description: The action this challenge authorizes (e.g. "approve_transaction")
7983
+ target_id:
7984
+ type: string
7985
+ description: ID of the resource the action targets
7986
+
7987
+ DeviceChallengeResponse:
7988
+ type: object
7989
+ required: [challenge_nonce, expires_at, action_bound_hash]
7990
+ properties:
7991
+ challenge_nonce:
7992
+ type: string
7993
+ expires_at:
7994
+ type: string
7995
+ format: date-time
7996
+ action_bound_hash:
7997
+ type: string
7998
+ description: SHA-256 binding the challenge to the requested action and target
7999
+
8000
+ AttestDeviceChallengeRequest:
8001
+ type: object
8002
+ required: [challenge_nonce, signature]
8003
+ properties:
8004
+ challenge_nonce:
8005
+ type: string
8006
+ signature:
8007
+ type: string
8008
+ description: Signature over the challenge nonce using the device's private key
8009
+
8010
+ AttestDeviceChallengeResponse:
8011
+ type: object
8012
+ required: [step_up_token, expires_at]
8013
+ properties:
8014
+ step_up_token:
8015
+ type: string
8016
+ description: Short-lived token authorizing the bound action
8017
+ expires_at:
8018
+ type: string
8019
+ format: date-time
8020
+
8021
+ RegisterPushTokenRequest:
8022
+ type: object
8023
+ required: [token, platform]
8024
+ properties:
8025
+ token:
8026
+ type: string
8027
+ description: Push notification token from APNs or FCM
8028
+ platform:
8029
+ type: string
8030
+ enum: [apns, fcm]
8031
+
8032
+ DecideApprovalRequest:
8033
+ type: object
8034
+ required: [decision]
8035
+ properties:
8036
+ decision:
8037
+ type: string
8038
+ enum: [approve, reject]
8039
+ reason:
8040
+ type: string
8041
+ description: Optional human-readable reason for the decision
8042
+
8043
+ ApprovalResponse:
8044
+ type: object
8045
+ required: [id, org_id, user_id, action, target_type, target_id, risk_tier, status, summary, created_at]
8046
+ properties:
8047
+ id:
8048
+ type: string
8049
+ format: uuid
8050
+ org_id:
8051
+ type: string
8052
+ format: uuid
8053
+ user_id:
8054
+ type: string
8055
+ format: uuid
8056
+ agent_id:
8057
+ type: string
8058
+ format: uuid
8059
+ nullable: true
8060
+ action:
8061
+ type: string
8062
+ target_type:
8063
+ type: string
8064
+ target_id:
8065
+ type: string
8066
+ risk_tier:
8067
+ type: integer
8068
+ minimum: 1
8069
+ maximum: 3
8070
+ status:
8071
+ type: string
8072
+ enum: [pending, approved, rejected, expired]
8073
+ summary:
8074
+ type: object
8075
+ description: Structured summary of the action requiring approval
8076
+ reason:
8077
+ type: string
8078
+ nullable: true
8079
+ decision_reason:
8080
+ type: string
8081
+ nullable: true
8082
+ decided_by:
8083
+ type: string
8084
+ format: uuid
8085
+ nullable: true
8086
+ decided_at:
8087
+ type: string
8088
+ format: date-time
8089
+ nullable: true
8090
+ expires_at:
8091
+ type: string
8092
+ format: date-time
8093
+ nullable: true
8094
+ created_at:
8095
+ type: string
8096
+ format: date-time