@primitivedotdev/sdk 1.11.0 → 1.12.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.
@@ -73,6 +73,10 @@ const openapiDocument = {
73
73
  "name": "Filters",
74
74
  "description": "Manage whitelist and blocklist filter rules"
75
75
  },
76
+ {
77
+ "name": "Routes",
78
+ "description": "Recipient routing: route inbound mail to a single destination per recipient\naddress. Rules bind an address pattern (exact or wildcard) to an endpoint;\n`function_id` routes an address to a function, minting its route-target\nendpoint.\n"
79
+ },
76
80
  {
77
81
  "name": "Payments",
78
82
  "description": "Collect and pay stablecoin (USDC) payments with x402. Settlement is\nnon-custodial: funds move directly from payer to payee on-chain via an\nEIP-3009 authorization the payer signs with their own key, and Primitive\nnever holds funds. The payee registers a payout address and creates a\nchallenge; the payer signs and settles it under a configurable spend\npolicy (kill-switch, per-payment and per-day caps, payee allowlist).\n"
@@ -1487,6 +1491,129 @@ const openapiDocument = {
1487
1491
  }
1488
1492
  }
1489
1493
  },
1494
+ "/routes": {
1495
+ "get": {
1496
+ "operationId": "listRoutes",
1497
+ "summary": "List recipient routes",
1498
+ "description": "Returns the org's recipient routing rules in evaluation order. Each rule\nbinds a recipient address pattern to one endpoint; inbound mail resolves\nto a single destination at delivery time.\n",
1499
+ "tags": ["Routes"],
1500
+ "responses": {
1501
+ "200": {
1502
+ "description": "List of routes",
1503
+ "content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
1504
+ "type": "object",
1505
+ "properties": { "data": {
1506
+ "type": "array",
1507
+ "items": { "$ref": "#/components/schemas/RecipientRoute" }
1508
+ } }
1509
+ }] } } }
1510
+ },
1511
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1512
+ }
1513
+ },
1514
+ "post": {
1515
+ "operationId": "createRoute",
1516
+ "summary": "Create a recipient route",
1517
+ "description": "Binds a recipient pattern to a destination. Provide exactly one of\n`endpoint_id` (an existing endpoint) or `function_id`. With `function_id`,\na dedicated route-target endpoint is minted for that function in the same\ntransaction, enabling per-address function routing (e.g.\n`alice@acme.com -> functionA`).\n",
1518
+ "tags": ["Routes"],
1519
+ "requestBody": {
1520
+ "required": true,
1521
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRouteInput" } } }
1522
+ },
1523
+ "responses": {
1524
+ "201": {
1525
+ "description": "Route created",
1526
+ "content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
1527
+ "type": "object",
1528
+ "properties": { "data": { "$ref": "#/components/schemas/RecipientRoute" } }
1529
+ }] } } }
1530
+ },
1531
+ "400": { "$ref": "#/components/responses/ValidationError" },
1532
+ "401": { "$ref": "#/components/responses/Unauthorized" },
1533
+ "409": { "$ref": "#/components/responses/Conflict" }
1534
+ }
1535
+ }
1536
+ },
1537
+ "/routes/reorder": { "post": {
1538
+ "operationId": "reorderRoutes",
1539
+ "summary": "Reorder recipient routes",
1540
+ "description": "Update the priority of one or more routes in a single call.",
1541
+ "tags": ["Routes"],
1542
+ "requestBody": {
1543
+ "required": true,
1544
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReorderRoutesInput" } } }
1545
+ },
1546
+ "responses": {
1547
+ "200": {
1548
+ "description": "Updated route list",
1549
+ "content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
1550
+ "type": "object",
1551
+ "properties": { "data": {
1552
+ "type": "array",
1553
+ "items": { "$ref": "#/components/schemas/RecipientRoute" }
1554
+ } }
1555
+ }] } } }
1556
+ },
1557
+ "400": { "$ref": "#/components/responses/ValidationError" },
1558
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1559
+ }
1560
+ } },
1561
+ "/routes/simulate": { "post": {
1562
+ "operationId": "simulateRoute",
1563
+ "summary": "Simulate routing for a recipient",
1564
+ "description": "Resolves where an inbound email to `recipient` would be delivered, with a\ntrace of every rule evaluated and why. Read-only; creates nothing.\n",
1565
+ "tags": ["Routes"],
1566
+ "requestBody": {
1567
+ "required": true,
1568
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulateRouteInput" } } }
1569
+ },
1570
+ "responses": {
1571
+ "200": {
1572
+ "description": "Routing decision",
1573
+ "content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
1574
+ "type": "object",
1575
+ "properties": { "data": { "$ref": "#/components/schemas/SimulateRouteResult" } }
1576
+ }] } } }
1577
+ },
1578
+ "400": { "$ref": "#/components/responses/ValidationError" },
1579
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1580
+ }
1581
+ } },
1582
+ "/routes/{id}": {
1583
+ "parameters": [{ "$ref": "#/components/parameters/ResourceId" }],
1584
+ "patch": {
1585
+ "operationId": "updateRoute",
1586
+ "summary": "Update a recipient route",
1587
+ "tags": ["Routes"],
1588
+ "requestBody": {
1589
+ "required": true,
1590
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateRouteInput" } } }
1591
+ },
1592
+ "responses": {
1593
+ "200": {
1594
+ "description": "Updated route",
1595
+ "content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
1596
+ "type": "object",
1597
+ "properties": { "data": { "$ref": "#/components/schemas/RecipientRoute" } }
1598
+ }] } } }
1599
+ },
1600
+ "400": { "$ref": "#/components/responses/ValidationError" },
1601
+ "401": { "$ref": "#/components/responses/Unauthorized" },
1602
+ "404": { "$ref": "#/components/responses/NotFound" },
1603
+ "409": { "$ref": "#/components/responses/Conflict" }
1604
+ }
1605
+ },
1606
+ "delete": {
1607
+ "operationId": "deleteRoute",
1608
+ "summary": "Delete a recipient route",
1609
+ "tags": ["Routes"],
1610
+ "responses": {
1611
+ "200": { "$ref": "#/components/responses/Deleted" },
1612
+ "401": { "$ref": "#/components/responses/Unauthorized" },
1613
+ "404": { "$ref": "#/components/responses/NotFound" }
1614
+ }
1615
+ }
1616
+ },
1490
1617
  "/webhooks/deliveries": { "get": {
1491
1618
  "operationId": "listDeliveries",
1492
1619
  "summary": "List webhook deliveries",
@@ -6886,6 +7013,265 @@ const openapiDocument = {
6886
7013
  "properties": { "enabled": { "type": "boolean" } },
6887
7014
  "required": ["enabled"]
6888
7015
  },
7016
+ "RecipientRoute": {
7017
+ "type": "object",
7018
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
7019
+ "properties": {
7020
+ "id": {
7021
+ "type": "string",
7022
+ "format": "uuid"
7023
+ },
7024
+ "org_id": {
7025
+ "type": "string",
7026
+ "format": "uuid"
7027
+ },
7028
+ "domain_id": {
7029
+ "type": ["string", "null"],
7030
+ "format": "uuid",
7031
+ "description": "Domain the route is scoped to; null = org-wide."
7032
+ },
7033
+ "match_type": {
7034
+ "type": "string",
7035
+ "enum": [
7036
+ "exact",
7037
+ "wildcard",
7038
+ "regex"
7039
+ ]
7040
+ },
7041
+ "pattern": {
7042
+ "type": "string",
7043
+ "description": "The recipient address pattern (an exact address or a wildcard)."
7044
+ },
7045
+ "pattern_norm": {
7046
+ "type": ["string", "null"],
7047
+ "description": "Normalized pattern used for matching."
7048
+ },
7049
+ "endpoint_id": {
7050
+ "type": "string",
7051
+ "format": "uuid",
7052
+ "description": "The endpoint inbound mail matching this rule is delivered to."
7053
+ },
7054
+ "priority": {
7055
+ "type": "integer",
7056
+ "description": "Evaluation order within a scope; lower is checked first."
7057
+ },
7058
+ "enabled": { "type": "boolean" },
7059
+ "match_count": {
7060
+ "type": "string",
7061
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
7062
+ },
7063
+ "last_matched_at": {
7064
+ "type": ["string", "null"],
7065
+ "format": "date-time"
7066
+ },
7067
+ "created_at": {
7068
+ "type": "string",
7069
+ "format": "date-time"
7070
+ }
7071
+ },
7072
+ "required": ["id"]
7073
+ },
7074
+ "CreateRouteInput": {
7075
+ "type": "object",
7076
+ "additionalProperties": false,
7077
+ "description": "Provide exactly one of `endpoint_id` or `function_id`. With `function_id`,\na route-target endpoint is minted for that function and the route is bound\nto it in one transaction.\n",
7078
+ "properties": {
7079
+ "match_type": {
7080
+ "type": "string",
7081
+ "enum": [
7082
+ "exact",
7083
+ "wildcard",
7084
+ "regex"
7085
+ ]
7086
+ },
7087
+ "pattern": {
7088
+ "type": "string",
7089
+ "minLength": 1,
7090
+ "maxLength": 512
7091
+ },
7092
+ "endpoint_id": {
7093
+ "type": "string",
7094
+ "format": "uuid",
7095
+ "description": "An existing endpoint to route to. Mutually exclusive with function_id."
7096
+ },
7097
+ "function_id": {
7098
+ "type": "string",
7099
+ "format": "uuid",
7100
+ "description": "Route to this function, minting its route-target endpoint if needed. Mutually exclusive with endpoint_id."
7101
+ },
7102
+ "domain_id": {
7103
+ "type": ["string", "null"],
7104
+ "format": "uuid",
7105
+ "description": "Scope the route to a domain; defaults to the pattern's domain."
7106
+ },
7107
+ "priority": {
7108
+ "type": "integer",
7109
+ "minimum": 0,
7110
+ "maximum": 1e6
7111
+ },
7112
+ "enabled": { "type": "boolean" }
7113
+ },
7114
+ "required": ["match_type", "pattern"]
7115
+ },
7116
+ "UpdateRouteInput": {
7117
+ "type": "object",
7118
+ "additionalProperties": false,
7119
+ "properties": {
7120
+ "match_type": {
7121
+ "type": "string",
7122
+ "enum": [
7123
+ "exact",
7124
+ "wildcard",
7125
+ "regex"
7126
+ ]
7127
+ },
7128
+ "pattern": {
7129
+ "type": "string",
7130
+ "minLength": 1,
7131
+ "maxLength": 512
7132
+ },
7133
+ "endpoint_id": {
7134
+ "type": "string",
7135
+ "format": "uuid"
7136
+ },
7137
+ "domain_id": {
7138
+ "type": ["string", "null"],
7139
+ "format": "uuid"
7140
+ },
7141
+ "priority": {
7142
+ "type": "integer",
7143
+ "minimum": 0,
7144
+ "maximum": 1e6
7145
+ },
7146
+ "enabled": { "type": "boolean" }
7147
+ }
7148
+ },
7149
+ "ReorderRoutesInput": {
7150
+ "type": "object",
7151
+ "additionalProperties": false,
7152
+ "properties": { "updates": {
7153
+ "type": "array",
7154
+ "minItems": 1,
7155
+ "maxItems": 1e3,
7156
+ "items": {
7157
+ "type": "object",
7158
+ "additionalProperties": false,
7159
+ "properties": {
7160
+ "id": {
7161
+ "type": "string",
7162
+ "format": "uuid"
7163
+ },
7164
+ "priority": {
7165
+ "type": "integer",
7166
+ "minimum": 0,
7167
+ "maximum": 1e6
7168
+ }
7169
+ },
7170
+ "required": ["id", "priority"]
7171
+ }
7172
+ } },
7173
+ "required": ["updates"]
7174
+ },
7175
+ "SimulateRouteInput": {
7176
+ "type": "object",
7177
+ "additionalProperties": false,
7178
+ "properties": {
7179
+ "recipient": {
7180
+ "type": "string",
7181
+ "minLength": 1,
7182
+ "maxLength": 320
7183
+ },
7184
+ "event_type": {
7185
+ "type": "string",
7186
+ "minLength": 1,
7187
+ "maxLength": 100,
7188
+ "description": "Event type to model; defaults to email.received."
7189
+ }
7190
+ },
7191
+ "required": ["recipient"]
7192
+ },
7193
+ "RouteEvaluatedEntry": {
7194
+ "type": "object",
7195
+ "properties": {
7196
+ "route_id": { "type": "string" },
7197
+ "tier": {
7198
+ "type": "string",
7199
+ "enum": [
7200
+ "exact",
7201
+ "wildcard",
7202
+ "regex"
7203
+ ]
7204
+ },
7205
+ "pattern": { "type": "string" },
7206
+ "result": {
7207
+ "type": "string",
7208
+ "enum": [
7209
+ "hit",
7210
+ "miss",
7211
+ "skipped",
7212
+ "error"
7213
+ ]
7214
+ },
7215
+ "reason": { "type": "string" }
7216
+ },
7217
+ "required": [
7218
+ "route_id",
7219
+ "tier",
7220
+ "pattern",
7221
+ "result"
7222
+ ]
7223
+ },
7224
+ "SimulateRouteResult": {
7225
+ "type": "object",
7226
+ "description": "Where an inbound email to the recipient would be delivered, and why.",
7227
+ "properties": {
7228
+ "outcome": {
7229
+ "type": "string",
7230
+ "enum": [
7231
+ "matched",
7232
+ "defaulted",
7233
+ "none"
7234
+ ]
7235
+ },
7236
+ "recipient": { "type": "string" },
7237
+ "endpoint_id": { "type": ["string", "null"] },
7238
+ "matched_route_id": { "type": ["string", "null"] },
7239
+ "matched_tier": {
7240
+ "type": ["string", "null"],
7241
+ "enum": [
7242
+ "exact",
7243
+ "wildcard",
7244
+ "regex",
7245
+ null
7246
+ ]
7247
+ },
7248
+ "matched_pattern": { "type": ["string", "null"] },
7249
+ "default_scope": {
7250
+ "type": ["string", "null"],
7251
+ "enum": [
7252
+ "domain",
7253
+ "org",
7254
+ null
7255
+ ]
7256
+ },
7257
+ "evaluated": {
7258
+ "type": "array",
7259
+ "items": { "$ref": "#/components/schemas/RouteEvaluatedEntry" }
7260
+ },
7261
+ "truncated": { "type": "boolean" }
7262
+ },
7263
+ "required": [
7264
+ "outcome",
7265
+ "recipient",
7266
+ "endpoint_id",
7267
+ "matched_route_id",
7268
+ "matched_tier",
7269
+ "matched_pattern",
7270
+ "default_scope",
7271
+ "evaluated",
7272
+ "truncated"
7273
+ ]
7274
+ },
6889
7275
  "DeliverySummary": {
6890
7276
  "type": "object",
6891
7277
  "properties": {
@@ -14898,6 +15284,555 @@ const operationManifest = [
14898
15284
  "tag": "Registries",
14899
15285
  "tagCommand": "registries"
14900
15286
  },
15287
+ {
15288
+ "binaryResponse": false,
15289
+ "bodyRequired": true,
15290
+ "command": "create-route",
15291
+ "description": "Binds a recipient pattern to a destination. Provide exactly one of\n`endpoint_id` (an existing endpoint) or `function_id`. With `function_id`,\na dedicated route-target endpoint is minted for that function in the same\ntransaction, enabling per-address function routing (e.g.\n`alice@acme.com -> functionA`).\n",
15292
+ "hasJsonBody": true,
15293
+ "method": "POST",
15294
+ "operationId": "createRoute",
15295
+ "path": "/routes",
15296
+ "pathParams": [],
15297
+ "queryParams": [],
15298
+ "requestSchema": {
15299
+ "type": "object",
15300
+ "additionalProperties": false,
15301
+ "description": "Provide exactly one of `endpoint_id` or `function_id`. With `function_id`,\na route-target endpoint is minted for that function and the route is bound\nto it in one transaction.\n",
15302
+ "properties": {
15303
+ "match_type": {
15304
+ "type": "string",
15305
+ "enum": [
15306
+ "exact",
15307
+ "wildcard",
15308
+ "regex"
15309
+ ]
15310
+ },
15311
+ "pattern": {
15312
+ "type": "string",
15313
+ "minLength": 1,
15314
+ "maxLength": 512
15315
+ },
15316
+ "endpoint_id": {
15317
+ "type": "string",
15318
+ "format": "uuid",
15319
+ "description": "An existing endpoint to route to. Mutually exclusive with function_id."
15320
+ },
15321
+ "function_id": {
15322
+ "type": "string",
15323
+ "format": "uuid",
15324
+ "description": "Route to this function, minting its route-target endpoint if needed. Mutually exclusive with endpoint_id."
15325
+ },
15326
+ "domain_id": {
15327
+ "type": ["string", "null"],
15328
+ "format": "uuid",
15329
+ "description": "Scope the route to a domain; defaults to the pattern's domain."
15330
+ },
15331
+ "priority": {
15332
+ "type": "integer",
15333
+ "minimum": 0,
15334
+ "maximum": 1e6
15335
+ },
15336
+ "enabled": { "type": "boolean" }
15337
+ },
15338
+ "required": ["match_type", "pattern"]
15339
+ },
15340
+ "responseSchema": {
15341
+ "type": "object",
15342
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15343
+ "properties": {
15344
+ "id": {
15345
+ "type": "string",
15346
+ "format": "uuid"
15347
+ },
15348
+ "org_id": {
15349
+ "type": "string",
15350
+ "format": "uuid"
15351
+ },
15352
+ "domain_id": {
15353
+ "type": ["string", "null"],
15354
+ "format": "uuid",
15355
+ "description": "Domain the route is scoped to; null = org-wide."
15356
+ },
15357
+ "match_type": {
15358
+ "type": "string",
15359
+ "enum": [
15360
+ "exact",
15361
+ "wildcard",
15362
+ "regex"
15363
+ ]
15364
+ },
15365
+ "pattern": {
15366
+ "type": "string",
15367
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15368
+ },
15369
+ "pattern_norm": {
15370
+ "type": ["string", "null"],
15371
+ "description": "Normalized pattern used for matching."
15372
+ },
15373
+ "endpoint_id": {
15374
+ "type": "string",
15375
+ "format": "uuid",
15376
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15377
+ },
15378
+ "priority": {
15379
+ "type": "integer",
15380
+ "description": "Evaluation order within a scope; lower is checked first."
15381
+ },
15382
+ "enabled": { "type": "boolean" },
15383
+ "match_count": {
15384
+ "type": "string",
15385
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15386
+ },
15387
+ "last_matched_at": {
15388
+ "type": ["string", "null"],
15389
+ "format": "date-time"
15390
+ },
15391
+ "created_at": {
15392
+ "type": "string",
15393
+ "format": "date-time"
15394
+ }
15395
+ },
15396
+ "required": ["id"]
15397
+ },
15398
+ "sdkName": "createRoute",
15399
+ "summary": "Create a recipient route",
15400
+ "tag": "Routes",
15401
+ "tagCommand": "routes"
15402
+ },
15403
+ {
15404
+ "binaryResponse": false,
15405
+ "bodyRequired": false,
15406
+ "command": "delete-route",
15407
+ "description": null,
15408
+ "hasJsonBody": false,
15409
+ "method": "DELETE",
15410
+ "operationId": "deleteRoute",
15411
+ "path": "/routes/{id}",
15412
+ "pathParams": [{
15413
+ "description": "Resource UUID",
15414
+ "enum": null,
15415
+ "name": "id",
15416
+ "required": true,
15417
+ "type": "string"
15418
+ }],
15419
+ "queryParams": [],
15420
+ "requestSchema": null,
15421
+ "responseSchema": null,
15422
+ "sdkName": "deleteRoute",
15423
+ "summary": "Delete a recipient route",
15424
+ "tag": "Routes",
15425
+ "tagCommand": "routes"
15426
+ },
15427
+ {
15428
+ "binaryResponse": false,
15429
+ "bodyRequired": false,
15430
+ "command": "list-routes",
15431
+ "description": "Returns the org's recipient routing rules in evaluation order. Each rule\nbinds a recipient address pattern to one endpoint; inbound mail resolves\nto a single destination at delivery time.\n",
15432
+ "hasJsonBody": false,
15433
+ "method": "GET",
15434
+ "operationId": "listRoutes",
15435
+ "path": "/routes",
15436
+ "pathParams": [],
15437
+ "queryParams": [],
15438
+ "requestSchema": null,
15439
+ "responseSchema": {
15440
+ "type": "array",
15441
+ "items": {
15442
+ "type": "object",
15443
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15444
+ "properties": {
15445
+ "id": {
15446
+ "type": "string",
15447
+ "format": "uuid"
15448
+ },
15449
+ "org_id": {
15450
+ "type": "string",
15451
+ "format": "uuid"
15452
+ },
15453
+ "domain_id": {
15454
+ "type": ["string", "null"],
15455
+ "format": "uuid",
15456
+ "description": "Domain the route is scoped to; null = org-wide."
15457
+ },
15458
+ "match_type": {
15459
+ "type": "string",
15460
+ "enum": [
15461
+ "exact",
15462
+ "wildcard",
15463
+ "regex"
15464
+ ]
15465
+ },
15466
+ "pattern": {
15467
+ "type": "string",
15468
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15469
+ },
15470
+ "pattern_norm": {
15471
+ "type": ["string", "null"],
15472
+ "description": "Normalized pattern used for matching."
15473
+ },
15474
+ "endpoint_id": {
15475
+ "type": "string",
15476
+ "format": "uuid",
15477
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15478
+ },
15479
+ "priority": {
15480
+ "type": "integer",
15481
+ "description": "Evaluation order within a scope; lower is checked first."
15482
+ },
15483
+ "enabled": { "type": "boolean" },
15484
+ "match_count": {
15485
+ "type": "string",
15486
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15487
+ },
15488
+ "last_matched_at": {
15489
+ "type": ["string", "null"],
15490
+ "format": "date-time"
15491
+ },
15492
+ "created_at": {
15493
+ "type": "string",
15494
+ "format": "date-time"
15495
+ }
15496
+ },
15497
+ "required": ["id"]
15498
+ }
15499
+ },
15500
+ "sdkName": "listRoutes",
15501
+ "summary": "List recipient routes",
15502
+ "tag": "Routes",
15503
+ "tagCommand": "routes"
15504
+ },
15505
+ {
15506
+ "binaryResponse": false,
15507
+ "bodyRequired": true,
15508
+ "command": "reorder-routes",
15509
+ "description": "Update the priority of one or more routes in a single call.",
15510
+ "hasJsonBody": true,
15511
+ "method": "POST",
15512
+ "operationId": "reorderRoutes",
15513
+ "path": "/routes/reorder",
15514
+ "pathParams": [],
15515
+ "queryParams": [],
15516
+ "requestSchema": {
15517
+ "type": "object",
15518
+ "additionalProperties": false,
15519
+ "properties": { "updates": {
15520
+ "type": "array",
15521
+ "minItems": 1,
15522
+ "maxItems": 1e3,
15523
+ "items": {
15524
+ "type": "object",
15525
+ "additionalProperties": false,
15526
+ "properties": {
15527
+ "id": {
15528
+ "type": "string",
15529
+ "format": "uuid"
15530
+ },
15531
+ "priority": {
15532
+ "type": "integer",
15533
+ "minimum": 0,
15534
+ "maximum": 1e6
15535
+ }
15536
+ },
15537
+ "required": ["id", "priority"]
15538
+ }
15539
+ } },
15540
+ "required": ["updates"]
15541
+ },
15542
+ "responseSchema": {
15543
+ "type": "array",
15544
+ "items": {
15545
+ "type": "object",
15546
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15547
+ "properties": {
15548
+ "id": {
15549
+ "type": "string",
15550
+ "format": "uuid"
15551
+ },
15552
+ "org_id": {
15553
+ "type": "string",
15554
+ "format": "uuid"
15555
+ },
15556
+ "domain_id": {
15557
+ "type": ["string", "null"],
15558
+ "format": "uuid",
15559
+ "description": "Domain the route is scoped to; null = org-wide."
15560
+ },
15561
+ "match_type": {
15562
+ "type": "string",
15563
+ "enum": [
15564
+ "exact",
15565
+ "wildcard",
15566
+ "regex"
15567
+ ]
15568
+ },
15569
+ "pattern": {
15570
+ "type": "string",
15571
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15572
+ },
15573
+ "pattern_norm": {
15574
+ "type": ["string", "null"],
15575
+ "description": "Normalized pattern used for matching."
15576
+ },
15577
+ "endpoint_id": {
15578
+ "type": "string",
15579
+ "format": "uuid",
15580
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15581
+ },
15582
+ "priority": {
15583
+ "type": "integer",
15584
+ "description": "Evaluation order within a scope; lower is checked first."
15585
+ },
15586
+ "enabled": { "type": "boolean" },
15587
+ "match_count": {
15588
+ "type": "string",
15589
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15590
+ },
15591
+ "last_matched_at": {
15592
+ "type": ["string", "null"],
15593
+ "format": "date-time"
15594
+ },
15595
+ "created_at": {
15596
+ "type": "string",
15597
+ "format": "date-time"
15598
+ }
15599
+ },
15600
+ "required": ["id"]
15601
+ }
15602
+ },
15603
+ "sdkName": "reorderRoutes",
15604
+ "summary": "Reorder recipient routes",
15605
+ "tag": "Routes",
15606
+ "tagCommand": "routes"
15607
+ },
15608
+ {
15609
+ "binaryResponse": false,
15610
+ "bodyRequired": true,
15611
+ "command": "simulate-route",
15612
+ "description": "Resolves where an inbound email to `recipient` would be delivered, with a\ntrace of every rule evaluated and why. Read-only; creates nothing.\n",
15613
+ "hasJsonBody": true,
15614
+ "method": "POST",
15615
+ "operationId": "simulateRoute",
15616
+ "path": "/routes/simulate",
15617
+ "pathParams": [],
15618
+ "queryParams": [],
15619
+ "requestSchema": {
15620
+ "type": "object",
15621
+ "additionalProperties": false,
15622
+ "properties": {
15623
+ "recipient": {
15624
+ "type": "string",
15625
+ "minLength": 1,
15626
+ "maxLength": 320
15627
+ },
15628
+ "event_type": {
15629
+ "type": "string",
15630
+ "minLength": 1,
15631
+ "maxLength": 100,
15632
+ "description": "Event type to model; defaults to email.received."
15633
+ }
15634
+ },
15635
+ "required": ["recipient"]
15636
+ },
15637
+ "responseSchema": {
15638
+ "type": "object",
15639
+ "description": "Where an inbound email to the recipient would be delivered, and why.",
15640
+ "properties": {
15641
+ "outcome": {
15642
+ "type": "string",
15643
+ "enum": [
15644
+ "matched",
15645
+ "defaulted",
15646
+ "none"
15647
+ ]
15648
+ },
15649
+ "recipient": { "type": "string" },
15650
+ "endpoint_id": { "type": ["string", "null"] },
15651
+ "matched_route_id": { "type": ["string", "null"] },
15652
+ "matched_tier": {
15653
+ "type": ["string", "null"],
15654
+ "enum": [
15655
+ "exact",
15656
+ "wildcard",
15657
+ "regex",
15658
+ null
15659
+ ]
15660
+ },
15661
+ "matched_pattern": { "type": ["string", "null"] },
15662
+ "default_scope": {
15663
+ "type": ["string", "null"],
15664
+ "enum": [
15665
+ "domain",
15666
+ "org",
15667
+ null
15668
+ ]
15669
+ },
15670
+ "evaluated": {
15671
+ "type": "array",
15672
+ "items": {
15673
+ "type": "object",
15674
+ "properties": {
15675
+ "route_id": { "type": "string" },
15676
+ "tier": {
15677
+ "type": "string",
15678
+ "enum": [
15679
+ "exact",
15680
+ "wildcard",
15681
+ "regex"
15682
+ ]
15683
+ },
15684
+ "pattern": { "type": "string" },
15685
+ "result": {
15686
+ "type": "string",
15687
+ "enum": [
15688
+ "hit",
15689
+ "miss",
15690
+ "skipped",
15691
+ "error"
15692
+ ]
15693
+ },
15694
+ "reason": { "type": "string" }
15695
+ },
15696
+ "required": [
15697
+ "route_id",
15698
+ "tier",
15699
+ "pattern",
15700
+ "result"
15701
+ ]
15702
+ }
15703
+ },
15704
+ "truncated": { "type": "boolean" }
15705
+ },
15706
+ "required": [
15707
+ "outcome",
15708
+ "recipient",
15709
+ "endpoint_id",
15710
+ "matched_route_id",
15711
+ "matched_tier",
15712
+ "matched_pattern",
15713
+ "default_scope",
15714
+ "evaluated",
15715
+ "truncated"
15716
+ ]
15717
+ },
15718
+ "sdkName": "simulateRoute",
15719
+ "summary": "Simulate routing for a recipient",
15720
+ "tag": "Routes",
15721
+ "tagCommand": "routes"
15722
+ },
15723
+ {
15724
+ "binaryResponse": false,
15725
+ "bodyRequired": true,
15726
+ "command": "update-route",
15727
+ "description": null,
15728
+ "hasJsonBody": true,
15729
+ "method": "PATCH",
15730
+ "operationId": "updateRoute",
15731
+ "path": "/routes/{id}",
15732
+ "pathParams": [{
15733
+ "description": "Resource UUID",
15734
+ "enum": null,
15735
+ "name": "id",
15736
+ "required": true,
15737
+ "type": "string"
15738
+ }],
15739
+ "queryParams": [],
15740
+ "requestSchema": {
15741
+ "type": "object",
15742
+ "additionalProperties": false,
15743
+ "properties": {
15744
+ "match_type": {
15745
+ "type": "string",
15746
+ "enum": [
15747
+ "exact",
15748
+ "wildcard",
15749
+ "regex"
15750
+ ]
15751
+ },
15752
+ "pattern": {
15753
+ "type": "string",
15754
+ "minLength": 1,
15755
+ "maxLength": 512
15756
+ },
15757
+ "endpoint_id": {
15758
+ "type": "string",
15759
+ "format": "uuid"
15760
+ },
15761
+ "domain_id": {
15762
+ "type": ["string", "null"],
15763
+ "format": "uuid"
15764
+ },
15765
+ "priority": {
15766
+ "type": "integer",
15767
+ "minimum": 0,
15768
+ "maximum": 1e6
15769
+ },
15770
+ "enabled": { "type": "boolean" }
15771
+ }
15772
+ },
15773
+ "responseSchema": {
15774
+ "type": "object",
15775
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15776
+ "properties": {
15777
+ "id": {
15778
+ "type": "string",
15779
+ "format": "uuid"
15780
+ },
15781
+ "org_id": {
15782
+ "type": "string",
15783
+ "format": "uuid"
15784
+ },
15785
+ "domain_id": {
15786
+ "type": ["string", "null"],
15787
+ "format": "uuid",
15788
+ "description": "Domain the route is scoped to; null = org-wide."
15789
+ },
15790
+ "match_type": {
15791
+ "type": "string",
15792
+ "enum": [
15793
+ "exact",
15794
+ "wildcard",
15795
+ "regex"
15796
+ ]
15797
+ },
15798
+ "pattern": {
15799
+ "type": "string",
15800
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15801
+ },
15802
+ "pattern_norm": {
15803
+ "type": ["string", "null"],
15804
+ "description": "Normalized pattern used for matching."
15805
+ },
15806
+ "endpoint_id": {
15807
+ "type": "string",
15808
+ "format": "uuid",
15809
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15810
+ },
15811
+ "priority": {
15812
+ "type": "integer",
15813
+ "description": "Evaluation order within a scope; lower is checked first."
15814
+ },
15815
+ "enabled": { "type": "boolean" },
15816
+ "match_count": {
15817
+ "type": "string",
15818
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15819
+ },
15820
+ "last_matched_at": {
15821
+ "type": ["string", "null"],
15822
+ "format": "date-time"
15823
+ },
15824
+ "created_at": {
15825
+ "type": "string",
15826
+ "format": "date-time"
15827
+ }
15828
+ },
15829
+ "required": ["id"]
15830
+ },
15831
+ "sdkName": "updateRoute",
15832
+ "summary": "Update a recipient route",
15833
+ "tag": "Routes",
15834
+ "tagCommand": "routes"
15835
+ },
14901
15836
  {
14902
15837
  "binaryResponse": false,
14903
15838
  "bodyRequired": true,