@1claw/openapi-spec 0.22.2 → 0.23.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
@@ -62,6 +62,8 @@ tags:
62
62
  description: Platform administration
63
63
  - name: Health
64
64
  description: Service health checks
65
+ - name: Platform
66
+ description: Platform API for developers building on 1Claw (plt_ keys, user provisioning, bootstrap templates)
65
67
 
66
68
  # =============================================================================
67
69
  # PATHS
@@ -3356,6 +3358,318 @@ paths:
3356
3358
  "401":
3357
3359
  description: Unauthorized
3358
3360
 
3361
+ # --- Platform API ---
3362
+
3363
+ /v1/platform/apps:
3364
+ post:
3365
+ tags: [Platform]
3366
+ summary: Register a platform app
3367
+ description: Register a new platform app for building on top of 1Claw. Returns an API key (plt_ prefix) that must be saved immediately.
3368
+ security:
3369
+ - BearerAuth: []
3370
+ requestBody:
3371
+ required: true
3372
+ content:
3373
+ application/json:
3374
+ schema:
3375
+ $ref: "#/components/schemas/CreatePlatformAppRequest"
3376
+ responses:
3377
+ "201":
3378
+ description: Platform app created
3379
+ content:
3380
+ application/json:
3381
+ schema:
3382
+ $ref: "#/components/schemas/PlatformAppCreatedResponse"
3383
+ "400":
3384
+ description: Invalid request
3385
+ "403":
3386
+ description: Only human users can register platform apps
3387
+ get:
3388
+ tags: [Platform]
3389
+ summary: List platform apps
3390
+ description: List all platform apps in the organization.
3391
+ security:
3392
+ - BearerAuth: []
3393
+ responses:
3394
+ "200":
3395
+ description: List of platform apps
3396
+ content:
3397
+ application/json:
3398
+ schema:
3399
+ type: array
3400
+ items:
3401
+ $ref: "#/components/schemas/PlatformAppResponse"
3402
+
3403
+ /v1/platform/apps/{appId}:
3404
+ get:
3405
+ tags: [Platform]
3406
+ summary: Get platform app details
3407
+ security:
3408
+ - BearerAuth: []
3409
+ parameters:
3410
+ - in: path
3411
+ name: appId
3412
+ required: true
3413
+ schema:
3414
+ type: string
3415
+ format: uuid
3416
+ responses:
3417
+ "200":
3418
+ description: Platform app details
3419
+ content:
3420
+ application/json:
3421
+ schema:
3422
+ $ref: "#/components/schemas/PlatformAppResponse"
3423
+ "404":
3424
+ description: Not found
3425
+ patch:
3426
+ tags: [Platform]
3427
+ summary: Update platform app
3428
+ security:
3429
+ - BearerAuth: []
3430
+ parameters:
3431
+ - in: path
3432
+ name: appId
3433
+ required: true
3434
+ schema:
3435
+ type: string
3436
+ format: uuid
3437
+ requestBody:
3438
+ required: true
3439
+ content:
3440
+ application/json:
3441
+ schema:
3442
+ $ref: "#/components/schemas/UpdatePlatformAppRequest"
3443
+ responses:
3444
+ "200":
3445
+ description: Updated platform app
3446
+ content:
3447
+ application/json:
3448
+ schema:
3449
+ $ref: "#/components/schemas/PlatformAppResponse"
3450
+ delete:
3451
+ tags: [Platform]
3452
+ summary: Delete platform app
3453
+ security:
3454
+ - BearerAuth: []
3455
+ parameters:
3456
+ - in: path
3457
+ name: appId
3458
+ required: true
3459
+ schema:
3460
+ type: string
3461
+ format: uuid
3462
+ responses:
3463
+ "204":
3464
+ description: Deleted
3465
+ "403":
3466
+ description: Only human users can delete platform apps
3467
+
3468
+ /v1/platform/apps/{appId}/templates:
3469
+ post:
3470
+ tags: [Platform]
3471
+ summary: Create bootstrap template
3472
+ description: Create a template that defines what vault, agents, and policies to bootstrap for each connected user.
3473
+ security:
3474
+ - BearerAuth: []
3475
+ parameters:
3476
+ - in: path
3477
+ name: appId
3478
+ required: true
3479
+ schema:
3480
+ type: string
3481
+ format: uuid
3482
+ requestBody:
3483
+ required: true
3484
+ content:
3485
+ application/json:
3486
+ schema:
3487
+ $ref: "#/components/schemas/CreateTemplateRequest"
3488
+ responses:
3489
+ "201":
3490
+ description: Template created
3491
+ content:
3492
+ application/json:
3493
+ schema:
3494
+ $ref: "#/components/schemas/PlatformTemplateResponse"
3495
+ get:
3496
+ tags: [Platform]
3497
+ summary: List templates
3498
+ security:
3499
+ - BearerAuth: []
3500
+ parameters:
3501
+ - in: path
3502
+ name: appId
3503
+ required: true
3504
+ schema:
3505
+ type: string
3506
+ format: uuid
3507
+ responses:
3508
+ "200":
3509
+ description: List of templates
3510
+ content:
3511
+ application/json:
3512
+ schema:
3513
+ type: array
3514
+ items:
3515
+ $ref: "#/components/schemas/PlatformTemplateResponse"
3516
+
3517
+ /v1/platform/users/upsert:
3518
+ post:
3519
+ tags: [Platform]
3520
+ summary: Provision or look up a platform user
3521
+ description: Upserts a user using either an OIDC subject_token (verified against the platform app's JWKS) or an email address. Returns the user handle and connection ID.
3522
+ security:
3523
+ - BearerAuth: []
3524
+ requestBody:
3525
+ required: true
3526
+ content:
3527
+ application/json:
3528
+ schema:
3529
+ $ref: "#/components/schemas/UpsertPlatformUserRequest"
3530
+ responses:
3531
+ "200":
3532
+ description: Existing user found
3533
+ content:
3534
+ application/json:
3535
+ schema:
3536
+ $ref: "#/components/schemas/PlatformUserResponse"
3537
+ "201":
3538
+ description: New user created
3539
+ content:
3540
+ application/json:
3541
+ schema:
3542
+ $ref: "#/components/schemas/PlatformUserResponse"
3543
+
3544
+ /v1/platform/apps/{appId}/users:
3545
+ get:
3546
+ tags: [Platform]
3547
+ summary: List connected users
3548
+ description: List all users connected to this platform app.
3549
+ security:
3550
+ - BearerAuth: []
3551
+ parameters:
3552
+ - in: path
3553
+ name: appId
3554
+ required: true
3555
+ schema:
3556
+ type: string
3557
+ format: uuid
3558
+ responses:
3559
+ "200":
3560
+ description: Connected users
3561
+ content:
3562
+ application/json:
3563
+ schema:
3564
+ type: array
3565
+ items:
3566
+ $ref: "#/components/schemas/PlatformConnectedUserResponse"
3567
+
3568
+ /v1/platform/connections/{connectionId}/bootstrap:
3569
+ post:
3570
+ tags: [Platform]
3571
+ summary: Bootstrap resources for a connected user
3572
+ description: Executes a template to create vault, agent, and policies for the connected user. Returns a claim URL and token for the user to claim their resources.
3573
+ security:
3574
+ - BearerAuth: []
3575
+ parameters:
3576
+ - in: path
3577
+ name: connectionId
3578
+ required: true
3579
+ schema:
3580
+ type: string
3581
+ format: uuid
3582
+ requestBody:
3583
+ required: true
3584
+ content:
3585
+ application/json:
3586
+ schema:
3587
+ $ref: "#/components/schemas/BootstrapRequest"
3588
+ responses:
3589
+ "201":
3590
+ description: Resources bootstrapped
3591
+ content:
3592
+ application/json:
3593
+ schema:
3594
+ $ref: "#/components/schemas/BootstrapResponse"
3595
+
3596
+ /v1/platform/apps/{appId}/audit:
3597
+ get:
3598
+ tags: [Platform]
3599
+ summary: Platform audit log
3600
+ description: Returns audit events related to this platform app.
3601
+ security:
3602
+ - BearerAuth: []
3603
+ parameters:
3604
+ - in: path
3605
+ name: appId
3606
+ required: true
3607
+ schema:
3608
+ type: string
3609
+ format: uuid
3610
+ - in: query
3611
+ name: limit
3612
+ schema:
3613
+ type: integer
3614
+ default: 50
3615
+ - in: query
3616
+ name: offset
3617
+ schema:
3618
+ type: integer
3619
+ default: 0
3620
+ responses:
3621
+ "200":
3622
+ description: Audit events
3623
+ content:
3624
+ application/json:
3625
+ schema:
3626
+ type: object
3627
+ properties:
3628
+ events:
3629
+ type: array
3630
+ items:
3631
+ type: object
3632
+
3633
+ /v1/platform/connected-apps:
3634
+ get:
3635
+ tags: [Platform]
3636
+ summary: List connected apps (user side)
3637
+ description: Returns platform apps connected to the calling user's account.
3638
+ security:
3639
+ - BearerAuth: []
3640
+ responses:
3641
+ "200":
3642
+ description: Connected apps
3643
+ content:
3644
+ application/json:
3645
+ schema:
3646
+ type: object
3647
+ properties:
3648
+ connected_apps:
3649
+ type: array
3650
+ items:
3651
+ $ref: "#/components/schemas/ConnectedAppResponse"
3652
+
3653
+ /v1/platform/connected-apps/{connectionId}:
3654
+ delete:
3655
+ tags: [Platform]
3656
+ summary: Disconnect a platform app
3657
+ description: Disconnect the calling user from a platform app.
3658
+ security:
3659
+ - BearerAuth: []
3660
+ parameters:
3661
+ - in: path
3662
+ name: connectionId
3663
+ required: true
3664
+ schema:
3665
+ type: string
3666
+ format: uuid
3667
+ responses:
3668
+ "204":
3669
+ description: Disconnected
3670
+ "404":
3671
+ description: Connection not found
3672
+
3359
3673
  # =============================================================================
3360
3674
  # COMPONENTS
3361
3675
  # =============================================================================
@@ -6512,3 +6826,298 @@ components:
6512
6826
  enum: [healthy, degraded]
6513
6827
  version:
6514
6828
  type: string
6829
+
6830
+ # --- Platform API Schemas ---
6831
+
6832
+ CreatePlatformAppRequest:
6833
+ type: object
6834
+ required: [name, slug]
6835
+ properties:
6836
+ name:
6837
+ type: string
6838
+ slug:
6839
+ type: string
6840
+ minLength: 3
6841
+ maxLength: 64
6842
+ pattern: "^[a-zA-Z0-9_-]+$"
6843
+ description:
6844
+ type: string
6845
+ oidc_jwks_url:
6846
+ type: string
6847
+ format: uri
6848
+ oidc_issuer:
6849
+ type: string
6850
+ format: uri
6851
+ redirect_uris:
6852
+ type: array
6853
+ items:
6854
+ type: string
6855
+ format: uri
6856
+ billing_model:
6857
+ type: string
6858
+ enum: [platform_pays, user_pays, hybrid]
6859
+ default: platform_pays
6860
+ auth_mode:
6861
+ type: string
6862
+ enum: [silent, user_signin, configurable]
6863
+ default: silent
6864
+ max_connected_users:
6865
+ type: integer
6866
+ nullable: true
6867
+
6868
+ UpdatePlatformAppRequest:
6869
+ type: object
6870
+ properties:
6871
+ name:
6872
+ type: string
6873
+ description:
6874
+ type: string
6875
+ logo_url:
6876
+ type: string
6877
+ oidc_jwks_url:
6878
+ type: string
6879
+ oidc_issuer:
6880
+ type: string
6881
+ redirect_uris:
6882
+ type: array
6883
+ items:
6884
+ type: string
6885
+ webhook_url:
6886
+ type: string
6887
+ billing_model:
6888
+ type: string
6889
+ enum: [platform_pays, user_pays, hybrid]
6890
+ auth_mode:
6891
+ type: string
6892
+ enum: [silent, user_signin, configurable]
6893
+ max_connected_users:
6894
+ type: integer
6895
+ nullable: true
6896
+ is_active:
6897
+ type: boolean
6898
+
6899
+ PlatformAppResponse:
6900
+ type: object
6901
+ properties:
6902
+ id:
6903
+ type: string
6904
+ format: uuid
6905
+ name:
6906
+ type: string
6907
+ slug:
6908
+ type: string
6909
+ description:
6910
+ type: string
6911
+ logo_url:
6912
+ type: string
6913
+ nullable: true
6914
+ api_key_prefix:
6915
+ type: string
6916
+ oidc_jwks_url:
6917
+ type: string
6918
+ nullable: true
6919
+ oidc_issuer:
6920
+ type: string
6921
+ nullable: true
6922
+ redirect_uris:
6923
+ type: array
6924
+ items:
6925
+ type: string
6926
+ webhook_url:
6927
+ type: string
6928
+ nullable: true
6929
+ is_active:
6930
+ type: boolean
6931
+ billing_model:
6932
+ type: string
6933
+ auth_mode:
6934
+ type: string
6935
+ max_connected_users:
6936
+ type: integer
6937
+ nullable: true
6938
+ connected_users:
6939
+ type: integer
6940
+ created_at:
6941
+ type: string
6942
+ format: date-time
6943
+ updated_at:
6944
+ type: string
6945
+ format: date-time
6946
+
6947
+ PlatformAppCreatedResponse:
6948
+ allOf:
6949
+ - $ref: "#/components/schemas/PlatformAppResponse"
6950
+ - type: object
6951
+ required: [api_key]
6952
+ properties:
6953
+ api_key:
6954
+ type: string
6955
+ description: The platform API key. Save immediately - it cannot be retrieved again.
6956
+
6957
+ CreateTemplateRequest:
6958
+ type: object
6959
+ required: [name, spec]
6960
+ properties:
6961
+ name:
6962
+ type: string
6963
+ description:
6964
+ type: string
6965
+ spec:
6966
+ type: object
6967
+ description: Template specification defining vault, agents, and policies to bootstrap.
6968
+
6969
+ PlatformTemplateResponse:
6970
+ type: object
6971
+ properties:
6972
+ id:
6973
+ type: string
6974
+ format: uuid
6975
+ platform_app_id:
6976
+ type: string
6977
+ format: uuid
6978
+ name:
6979
+ type: string
6980
+ description:
6981
+ type: string
6982
+ version:
6983
+ type: integer
6984
+ spec:
6985
+ type: object
6986
+ is_active:
6987
+ type: boolean
6988
+ created_at:
6989
+ type: string
6990
+ format: date-time
6991
+ updated_at:
6992
+ type: string
6993
+ format: date-time
6994
+
6995
+ UpsertPlatformUserRequest:
6996
+ type: object
6997
+ properties:
6998
+ subject_token:
6999
+ type: string
7000
+ description: OIDC JWT from the platform's IdP (verified against JWKS)
7001
+ subject_token_type:
7002
+ type: string
7003
+ default: "urn:ietf:params:oauth:token-type:jwt"
7004
+ email:
7005
+ type: string
7006
+ format: email
7007
+ description: Fallback when subject_token is not provided
7008
+ display_name:
7009
+ type: string
7010
+
7011
+ PlatformUserResponse:
7012
+ type: object
7013
+ properties:
7014
+ user_handle:
7015
+ type: string
7016
+ format: uuid
7017
+ is_new:
7018
+ type: boolean
7019
+ connection_id:
7020
+ type: string
7021
+ format: uuid
7022
+ email:
7023
+ type: string
7024
+
7025
+ PlatformConnectedUserResponse:
7026
+ type: object
7027
+ properties:
7028
+ connection_id:
7029
+ type: string
7030
+ format: uuid
7031
+ user_id:
7032
+ type: string
7033
+ format: uuid
7034
+ external_subject:
7035
+ type: string
7036
+ status:
7037
+ type: string
7038
+ vault_ids:
7039
+ type: array
7040
+ items:
7041
+ type: string
7042
+ format: uuid
7043
+ agent_ids:
7044
+ type: array
7045
+ items:
7046
+ type: string
7047
+ format: uuid
7048
+ created_at:
7049
+ type: string
7050
+ format: date-time
7051
+ claimed_at:
7052
+ type: string
7053
+ format: date-time
7054
+ nullable: true
7055
+
7056
+ BootstrapRequest:
7057
+ type: object
7058
+ properties:
7059
+ template_id:
7060
+ type: string
7061
+ format: uuid
7062
+ description: Template to use. Falls back to the app's default template.
7063
+ return_to:
7064
+ type: string
7065
+ format: uri
7066
+ description: URL to redirect the user to after claiming resources.
7067
+
7068
+ BootstrapResponse:
7069
+ type: object
7070
+ properties:
7071
+ claim_url:
7072
+ type: string
7073
+ format: uri
7074
+ claim_token:
7075
+ type: string
7076
+ expires_in:
7077
+ type: integer
7078
+ description: Seconds until the claim token expires
7079
+ connection_id:
7080
+ type: string
7081
+ format: uuid
7082
+ summary:
7083
+ type: object
7084
+ properties:
7085
+ vault_id:
7086
+ type: string
7087
+ format: uuid
7088
+ nullable: true
7089
+ agent_id:
7090
+ type: string
7091
+ format: uuid
7092
+ nullable: true
7093
+ policy_ids:
7094
+ type: array
7095
+ items:
7096
+ type: string
7097
+ format: uuid
7098
+
7099
+ ConnectedAppResponse:
7100
+ type: object
7101
+ properties:
7102
+ connection_id:
7103
+ type: string
7104
+ format: uuid
7105
+ app_name:
7106
+ type: string
7107
+ app_slug:
7108
+ type: string
7109
+ status:
7110
+ type: string
7111
+ vault_ids:
7112
+ type: array
7113
+ items:
7114
+ type: string
7115
+ format: uuid
7116
+ agent_ids:
7117
+ type: array
7118
+ items:
7119
+ type: string
7120
+ format: uuid
7121
+ created_at:
7122
+ type: string
7123
+ format: date-time
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1claw/openapi-spec",
3
- "version": "0.22.2",
3
+ "version": "0.23.0",
4
4
  "description": "OpenAPI 3.1.0 specification for the 1Claw Vault API — generate clients in any language",
5
5
  "license": "MIT",
6
6
  "repository": {