@1claw/openapi-spec 0.41.2 → 0.41.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/openapi.json +868 -131
  2. package/openapi.yaml +478 -0
  3. package/package.json +38 -38
package/openapi.yaml CHANGED
@@ -78,6 +78,8 @@ tags:
78
78
  description: Known token registry for guardrail enforcement
79
79
  - name: Execution Intents
80
80
  description: Execute HTTP calls, queries, and more through pre-configured bindings
81
+ - name: Payment Cards
82
+ description: Order prepaid/gift cards via x402, then reveal, refresh, and void them
81
83
 
82
84
  # =============================================================================
83
85
  # PATHS
@@ -5558,6 +5560,12 @@ paths:
5558
5560
  description: |
5559
5561
  Submit a decision (approve or reject) for a pending approval.
5560
5562
  Human-only. The approval must be in `pending` status.
5563
+ For `card_order` approvals, approving auto-executes the x402 payment;
5564
+ rejecting marks the card as `rejected`.
5565
+ Risk tier 2+ approvals require step-up authentication via
5566
+ `X-Auth-Confirm` (account password or `rat_` re-auth token from
5567
+ `POST /v1/auth/reauth/begin` + `complete`). Risk tier 3 requires
5568
+ passkey or TOTP re-auth token.
5561
5569
  operationId: decideApproval
5562
5570
  parameters:
5563
5571
  - name: approval_id
@@ -5586,6 +5594,38 @@ paths:
5586
5594
  "409":
5587
5595
  $ref: "#/components/responses/Conflict"
5588
5596
 
5597
+ /v1/approvals/quick-decide:
5598
+ get:
5599
+ tags: [Approvals]
5600
+ summary: One-click approve or deny (email link)
5601
+ description: |
5602
+ Public endpoint (no Bearer auth). The `token` query param is the
5603
+ authenticator — SHA-256 hashed, single-use, 7-day TTL. On success
5604
+ redirects to `{public_url}/approvals/{id}?decided=true`.
5605
+ Auto-executes approved `card_order` and `policy_change` actions.
5606
+ operationId: quickDecideApproval
5607
+ parameters:
5608
+ - name: token
5609
+ in: query
5610
+ required: true
5611
+ schema:
5612
+ type: string
5613
+ - name: decision
5614
+ in: query
5615
+ required: true
5616
+ schema:
5617
+ type: string
5618
+ enum: [approved, rejected]
5619
+ responses:
5620
+ "302":
5621
+ description: Redirect to dashboard confirmation page
5622
+ "400":
5623
+ $ref: "#/components/responses/BadRequest"
5624
+ "404":
5625
+ $ref: "#/components/responses/NotFound"
5626
+ "409":
5627
+ $ref: "#/components/responses/Conflict"
5628
+
5589
5629
  /v1/deposit-destinations:
5590
5630
  post:
5591
5631
  tags: [Treasury]
@@ -6331,6 +6371,227 @@ paths:
6331
6371
  "403":
6332
6372
  $ref: "#/components/responses/Forbidden"
6333
6373
 
6374
+ /v1/agents/{agent_id}/cards/order:
6375
+ post:
6376
+ tags: [Payment Cards]
6377
+ summary: Order a payment card (x402)
6378
+ description: >
6379
+ Order a prepaid or gift card for an agent. Drives the x402
6380
+ payment flow server-side using the agent's Ethereum signing key
6381
+ (funded with USDC on Base). Requires `cards_enabled` on the agent
6382
+ and a Pro or higher plan. An `Idempotency-Key` header is required.
6383
+ When `card_require_approval` is true (default), the order is held
6384
+ in `awaiting_approval` until a human approves via the dashboard,
6385
+ mobile app, or email one-click link; payment runs only after approval.
6386
+ operationId: orderCard
6387
+ parameters:
6388
+ - $ref: "#/components/parameters/AgentId"
6389
+ - name: Idempotency-Key
6390
+ in: header
6391
+ required: true
6392
+ schema:
6393
+ type: string
6394
+ requestBody:
6395
+ required: true
6396
+ content:
6397
+ application/json:
6398
+ schema:
6399
+ $ref: "#/components/schemas/OrderCardRequest"
6400
+ responses:
6401
+ "202":
6402
+ description: Card order queued for human approval (status awaiting_approval)
6403
+ content:
6404
+ application/json:
6405
+ schema:
6406
+ $ref: "#/components/schemas/CardResponse"
6407
+ "201":
6408
+ description: Card order accepted and payment submitted (status pending)
6409
+ content:
6410
+ application/json:
6411
+ schema:
6412
+ $ref: "#/components/schemas/CardResponse"
6413
+ "200":
6414
+ description: Idempotent replay of a prior order
6415
+ content:
6416
+ application/json:
6417
+ schema:
6418
+ $ref: "#/components/schemas/CardResponse"
6419
+ "400":
6420
+ $ref: "#/components/responses/BadRequest"
6421
+ "403":
6422
+ $ref: "#/components/responses/Forbidden"
6423
+ "409":
6424
+ $ref: "#/components/responses/Conflict"
6425
+
6426
+ /v1/cards:
6427
+ get:
6428
+ tags: [Payment Cards]
6429
+ summary: List payment cards
6430
+ description: List cards for the caller (agents see only their own). Always masked (last4 only).
6431
+ operationId: listCards
6432
+ responses:
6433
+ "200":
6434
+ description: Card list
6435
+ content:
6436
+ application/json:
6437
+ schema:
6438
+ $ref: "#/components/schemas/CardListResponse"
6439
+
6440
+ /v1/cards/import:
6441
+ post:
6442
+ tags: [Payment Cards]
6443
+ summary: Import a card (human-only)
6444
+ description: Manually import an existing card. Full storage mode — PAN stored encrypted, CVV as a one-time-read secret. Human-only.
6445
+ operationId: importCard
6446
+ requestBody:
6447
+ required: true
6448
+ content:
6449
+ application/json:
6450
+ schema:
6451
+ $ref: "#/components/schemas/ImportCardRequest"
6452
+ responses:
6453
+ "201":
6454
+ description: Card imported
6455
+ content:
6456
+ application/json:
6457
+ schema:
6458
+ $ref: "#/components/schemas/CardResponse"
6459
+ "400":
6460
+ $ref: "#/components/responses/BadRequest"
6461
+ "403":
6462
+ $ref: "#/components/responses/Forbidden"
6463
+
6464
+ /v1/cards/gift-cards/search:
6465
+ post:
6466
+ tags: [Payment Cards]
6467
+ summary: Search gift-card brands
6468
+ description: Search available Laso gift-card brands/servers for the org's Laso account.
6469
+ operationId: searchGiftCards
6470
+ requestBody:
6471
+ required: false
6472
+ content:
6473
+ application/json:
6474
+ schema:
6475
+ $ref: "#/components/schemas/SearchGiftCardsRequest"
6476
+ responses:
6477
+ "200":
6478
+ description: Available gift-card brands (provider-shaped payload)
6479
+ content:
6480
+ application/json:
6481
+ schema:
6482
+ type: object
6483
+ additionalProperties: true
6484
+
6485
+ /v1/cards/{card_id}:
6486
+ get:
6487
+ tags: [Payment Cards]
6488
+ summary: Get a payment card
6489
+ description: Get a single card (masked — last4 only).
6490
+ operationId: getCard
6491
+ parameters:
6492
+ - $ref: "#/components/parameters/CardId"
6493
+ responses:
6494
+ "200":
6495
+ description: Card details
6496
+ content:
6497
+ application/json:
6498
+ schema:
6499
+ $ref: "#/components/schemas/CardResponse"
6500
+ "404":
6501
+ $ref: "#/components/responses/NotFound"
6502
+ patch:
6503
+ tags: [Payment Cards]
6504
+ summary: Update a card's reveal policy (human-only)
6505
+ operationId: updateCard
6506
+ parameters:
6507
+ - $ref: "#/components/parameters/CardId"
6508
+ requestBody:
6509
+ required: true
6510
+ content:
6511
+ application/json:
6512
+ schema:
6513
+ $ref: "#/components/schemas/UpdateCardRequest"
6514
+ responses:
6515
+ "200":
6516
+ description: Card updated
6517
+ content:
6518
+ application/json:
6519
+ schema:
6520
+ $ref: "#/components/schemas/CardResponse"
6521
+ "403":
6522
+ $ref: "#/components/responses/Forbidden"
6523
+ "404":
6524
+ $ref: "#/components/responses/NotFound"
6525
+
6526
+ /v1/cards/{card_id}/reveal:
6527
+ post:
6528
+ tags: [Payment Cards]
6529
+ summary: Reveal card details
6530
+ description: >
6531
+ Reveal full card details (PAN/CVV or gift-card redemption).
6532
+ Humans must re-authenticate with their account password via the
6533
+ `X-Auth-Confirm` header. Agents may reveal only when a human has
6534
+ enabled a per-card reveal policy. Once revealed, the card can be
6535
+ used anywhere up to its balance — 1Claw has no further control.
6536
+ operationId: revealCard
6537
+ parameters:
6538
+ - $ref: "#/components/parameters/CardId"
6539
+ - name: X-Auth-Confirm
6540
+ in: header
6541
+ required: false
6542
+ description: Account password (humans) for re-authentication.
6543
+ schema:
6544
+ type: string
6545
+ responses:
6546
+ "200":
6547
+ description: Revealed card details (sensitive)
6548
+ content:
6549
+ application/json:
6550
+ schema:
6551
+ $ref: "#/components/schemas/CardRevealResponse"
6552
+ "403":
6553
+ $ref: "#/components/responses/Forbidden"
6554
+ "404":
6555
+ $ref: "#/components/responses/NotFound"
6556
+
6557
+ /v1/cards/{card_id}/void:
6558
+ post:
6559
+ tags: [Payment Cards]
6560
+ summary: Void a card
6561
+ description: 1Claw-level lock that blocks all further reveals/refreshes. Forward-looking only — a card revealed before void remains live.
6562
+ operationId: voidCard
6563
+ parameters:
6564
+ - $ref: "#/components/parameters/CardId"
6565
+ responses:
6566
+ "200":
6567
+ description: Card voided
6568
+ content:
6569
+ application/json:
6570
+ schema:
6571
+ $ref: "#/components/schemas/CardResponse"
6572
+ "404":
6573
+ $ref: "#/components/responses/NotFound"
6574
+
6575
+ /v1/cards/{card_id}/refresh:
6576
+ post:
6577
+ tags: [Payment Cards]
6578
+ summary: Refresh a card's balance
6579
+ description: Proxy Laso refresh to update balance/status. Rate-limited to once per 5 minutes per card (429 on exceed).
6580
+ operationId: refreshCard
6581
+ parameters:
6582
+ - $ref: "#/components/parameters/CardId"
6583
+ responses:
6584
+ "200":
6585
+ description: Card refreshed
6586
+ content:
6587
+ application/json:
6588
+ schema:
6589
+ $ref: "#/components/schemas/CardResponse"
6590
+ "429":
6591
+ description: Refreshed too recently
6592
+ "404":
6593
+ $ref: "#/components/responses/NotFound"
6594
+
6334
6595
  # =============================================================================
6335
6596
  # COMPONENTS
6336
6597
  # =============================================================================
@@ -6375,6 +6636,13 @@ components:
6375
6636
  schema:
6376
6637
  type: string
6377
6638
  format: uuid
6639
+ CardId:
6640
+ name: card_id
6641
+ in: path
6642
+ required: true
6643
+ schema:
6644
+ type: string
6645
+ format: uuid
6378
6646
  IncludeSignedTx:
6379
6647
  name: include_signed_tx
6380
6648
  in: query
@@ -6427,6 +6695,153 @@ components:
6427
6695
  $ref: "#/components/schemas/ProblemDetails"
6428
6696
 
6429
6697
  schemas:
6698
+ OrderCardRequest:
6699
+ type: object
6700
+ required: [kind, amount_usd]
6701
+ properties:
6702
+ kind:
6703
+ type: string
6704
+ enum: [prepaid, gift_card]
6705
+ amount_usd:
6706
+ type: string
6707
+ description: USD amount to load onto the card.
6708
+ example: "25.00"
6709
+ laso_server_id:
6710
+ type: string
6711
+ description: Optional Laso gift-card server/brand id (gift cards only).
6712
+ country:
6713
+ type: string
6714
+ description: Optional country (prepaid cards; defaults to US).
6715
+ CardResponse:
6716
+ type: object
6717
+ description: Masked card view — never contains PAN/CVV.
6718
+ required: [id, issuer, kind, currency, status, storage_mode, reveal_policy, created_at, updated_at]
6719
+ properties:
6720
+ id:
6721
+ type: string
6722
+ format: uuid
6723
+ agent_id:
6724
+ type: string
6725
+ format: uuid
6726
+ nullable: true
6727
+ issuer:
6728
+ type: string
6729
+ enum: [laso, manual]
6730
+ kind:
6731
+ type: string
6732
+ enum: [prepaid, gift_card]
6733
+ brand:
6734
+ type: string
6735
+ last4:
6736
+ type: string
6737
+ exp_month:
6738
+ type: integer
6739
+ exp_year:
6740
+ type: integer
6741
+ currency:
6742
+ type: string
6743
+ order_amount_usd:
6744
+ type: string
6745
+ balance:
6746
+ type: string
6747
+ status:
6748
+ type: string
6749
+ enum: [ordering, pending, ready, depleted, expired, voided, orphaned_payment, awaiting_approval, rejected]
6750
+ storage_mode:
6751
+ type: string
6752
+ enum: [reference, full]
6753
+ reveal_policy:
6754
+ type: object
6755
+ additionalProperties: true
6756
+ approval_id:
6757
+ type: string
6758
+ format: uuid
6759
+ description: Linked approval when status is awaiting_approval
6760
+ void_after:
6761
+ type: string
6762
+ format: date-time
6763
+ created_at:
6764
+ type: string
6765
+ format: date-time
6766
+ updated_at:
6767
+ type: string
6768
+ format: date-time
6769
+ CardListResponse:
6770
+ type: object
6771
+ required: [cards]
6772
+ properties:
6773
+ cards:
6774
+ type: array
6775
+ items:
6776
+ $ref: "#/components/schemas/CardResponse"
6777
+ CardRevealResponse:
6778
+ type: object
6779
+ description: Revealed card details — sensitive. Returned only by the reveal endpoint.
6780
+ required: [id, disclaimer]
6781
+ properties:
6782
+ id:
6783
+ type: string
6784
+ format: uuid
6785
+ pan:
6786
+ type: string
6787
+ cvv:
6788
+ type: string
6789
+ exp_month:
6790
+ type: integer
6791
+ exp_year:
6792
+ type: integer
6793
+ brand:
6794
+ type: string
6795
+ redemption:
6796
+ type: object
6797
+ additionalProperties: true
6798
+ description: Gift-card redemption payload (URL/code/PIN) when applicable.
6799
+ disclaimer:
6800
+ type: string
6801
+ UpdateCardRequest:
6802
+ type: object
6803
+ description: Human-settable per-card reveal policy + lifecycle controls.
6804
+ properties:
6805
+ agent_reveal:
6806
+ type: boolean
6807
+ max_reveals:
6808
+ type: integer
6809
+ reveal_expires_at:
6810
+ type: string
6811
+ format: date-time
6812
+ nullable: true
6813
+ void_after:
6814
+ type: string
6815
+ format: date-time
6816
+ nullable: true
6817
+ ImportCardRequest:
6818
+ type: object
6819
+ required: [pan, cvv, exp_month, exp_year]
6820
+ properties:
6821
+ pan:
6822
+ type: string
6823
+ cvv:
6824
+ type: string
6825
+ exp_month:
6826
+ type: integer
6827
+ exp_year:
6828
+ type: integer
6829
+ brand:
6830
+ type: string
6831
+ currency:
6832
+ type: string
6833
+ balance:
6834
+ type: string
6835
+ agent_id:
6836
+ type: string
6837
+ format: uuid
6838
+ SearchGiftCardsRequest:
6839
+ type: object
6840
+ properties:
6841
+ query:
6842
+ type: string
6843
+ country:
6844
+ type: string
6430
6845
  ProblemDetails:
6431
6846
  type: object
6432
6847
  description: RFC 7807 error envelope
@@ -7376,6 +7791,27 @@ components:
7376
7791
  items:
7377
7792
  type: string
7378
7793
  description: Solana wallet addresses whose ATAs may be created. Empty = unrestricted.
7794
+ cards_enabled:
7795
+ type: boolean
7796
+ description: Whether this agent may order payment cards (x402 card ordering). Pro+ tier.
7797
+ card_max_order_usd:
7798
+ type: string
7799
+ description: Maximum USD amount for a single card order.
7800
+ card_daily_limit_usd:
7801
+ type: string
7802
+ description: Maximum cumulative USD spent ordering cards per rolling 24h window.
7803
+ card_payto_allowlist:
7804
+ type: array
7805
+ items:
7806
+ type: string
7807
+ description: Allowed x402 payTo recipients for card orders (empty = built-in Laso recipients).
7808
+ card_reveal_enabled:
7809
+ type: boolean
7810
+ description: Whether agents may reveal card details subject to per-card reveal policy.
7811
+ card_require_approval:
7812
+ type: boolean
7813
+ default: true
7814
+ description: When true, card orders route through the human approval queue before x402 payment.
7379
7815
  api_key_expires_at:
7380
7816
  type: string
7381
7817
  format: date-time
@@ -7461,6 +7897,28 @@ components:
7461
7897
  items:
7462
7898
  type: string
7463
7899
  description: Solana wallet addresses whose ATAs may be created.
7900
+ cards_enabled:
7901
+ type: boolean
7902
+ description: Whether this agent may order payment cards (x402 card ordering). Pro+ tier.
7903
+ card_max_order_usd:
7904
+ type: string
7905
+ nullable: true
7906
+ description: Maximum USD amount for a single card order. null clears.
7907
+ card_daily_limit_usd:
7908
+ type: string
7909
+ nullable: true
7910
+ description: Maximum cumulative USD spent ordering cards per rolling 24h window. null clears.
7911
+ card_payto_allowlist:
7912
+ type: array
7913
+ items:
7914
+ type: string
7915
+ description: Allowed x402 payTo recipients for card orders (empty = built-in Laso recipients).
7916
+ card_reveal_enabled:
7917
+ type: boolean
7918
+ description: Whether agents may reveal card details subject to per-card reveal policy.
7919
+ card_require_approval:
7920
+ type: boolean
7921
+ description: When true, card orders route through the human approval queue before x402 payment.
7464
7922
  federation_enabled:
7465
7923
  type: boolean
7466
7924
  description: |
@@ -7628,6 +8086,26 @@ components:
7628
8086
  items:
7629
8087
  type: string
7630
8088
  description: Solana wallet addresses whose ATAs may be created.
8089
+ cards_enabled:
8090
+ type: boolean
8091
+ description: Whether this agent may order payment cards (x402 card ordering).
8092
+ card_max_order_usd:
8093
+ type: string
8094
+ description: Maximum USD amount for a single card order.
8095
+ card_daily_limit_usd:
8096
+ type: string
8097
+ description: Maximum cumulative USD spent ordering cards per rolling 24h window.
8098
+ card_payto_allowlist:
8099
+ type: array
8100
+ items:
8101
+ type: string
8102
+ description: Allowed x402 payTo recipients for card orders (empty = built-in Laso recipients).
8103
+ card_reveal_enabled:
8104
+ type: boolean
8105
+ description: Whether agents may reveal card details subject to per-card reveal policy.
8106
+ card_require_approval:
8107
+ type: boolean
8108
+ description: When true, card orders route through the human approval queue before x402 payment.
7631
8109
  tx_count_today:
7632
8110
  type: integer
7633
8111
  description: Today's transaction count (UTC calendar day). Present when intents_api_enabled.
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
1
  {
2
- "name": "@1claw/openapi-spec",
3
- "version": "0.41.2",
4
- "description": "OpenAPI 3.1.0 specification for the 1Claw Vault API generate clients in any language",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/1clawAI/1claw.git",
9
- "directory": "packages/openapi-spec"
10
- },
11
- "files": [
12
- "openapi.yaml",
13
- "openapi.json",
14
- "README.md"
15
- ],
16
- "exports": {
17
- "./openapi.yaml": "./openapi.yaml",
18
- "./openapi.json": "./openapi.json"
19
- },
20
- "scripts": {
21
- "build": "node scripts/yaml-to-json.mjs",
22
- "prepublishOnly": "npm run build"
23
- },
24
- "publishConfig": {
25
- "access": "public"
26
- },
27
- "keywords": [
28
- "1claw",
29
- "openapi",
30
- "api-spec",
31
- "codegen",
32
- "swagger",
33
- "secrets",
34
- "vault",
35
- "ai-agents"
36
- ],
37
- "devDependencies": {
38
- "js-yaml": "^4.1.1"
39
- }
2
+ "name": "@1claw/openapi-spec",
3
+ "version": "0.41.4",
4
+ "description": "OpenAPI 3.1.0 specification for the 1Claw Vault API \u2014 generate clients in any language",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/1clawAI/1claw.git",
9
+ "directory": "packages/openapi-spec"
10
+ },
11
+ "files": [
12
+ "openapi.yaml",
13
+ "openapi.json",
14
+ "README.md"
15
+ ],
16
+ "exports": {
17
+ "./openapi.yaml": "./openapi.yaml",
18
+ "./openapi.json": "./openapi.json"
19
+ },
20
+ "scripts": {
21
+ "build": "node scripts/yaml-to-json.mjs",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "keywords": [
28
+ "1claw",
29
+ "openapi",
30
+ "api-spec",
31
+ "codegen",
32
+ "swagger",
33
+ "secrets",
34
+ "vault",
35
+ "ai-agents"
36
+ ],
37
+ "devDependencies": {
38
+ "js-yaml": "^4.1.1"
39
+ }
40
40
  }