@primitivedotdev/sdk 1.11.0 → 1.13.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",
@@ -6742,6 +6869,20 @@ const openapiDocument = {
6742
6869
  "deactivated_at": {
6743
6870
  "type": ["string", "null"],
6744
6871
  "format": "date-time"
6872
+ },
6873
+ "kind": {
6874
+ "type": "string",
6875
+ "enum": ["http", "function"],
6876
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
6877
+ },
6878
+ "function_id": {
6879
+ "type": ["string", "null"],
6880
+ "format": "uuid",
6881
+ "description": "The Function this endpoint invokes, when kind is function."
6882
+ },
6883
+ "is_route_target": {
6884
+ "type": "boolean",
6885
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
6745
6886
  }
6746
6887
  },
6747
6888
  "required": [
@@ -6757,14 +6898,20 @@ const openapiDocument = {
6757
6898
  "consecutive_fails"
6758
6899
  ]
6759
6900
  },
6760
- "CreateEndpointInput": {
6901
+ "CreateHttpEndpointInput": {
6761
6902
  "type": "object",
6762
6903
  "additionalProperties": false,
6763
6904
  "properties": {
6905
+ "kind": {
6906
+ "type": "string",
6907
+ "enum": ["http"],
6908
+ "default": "http",
6909
+ "description": "Deliver to a webhook URL."
6910
+ },
6764
6911
  "url": {
6765
6912
  "type": "string",
6766
6913
  "minLength": 1,
6767
- "description": "The webhook URL to deliver events to"
6914
+ "description": "The webhook URL to deliver events to."
6768
6915
  },
6769
6916
  "enabled": {
6770
6917
  "type": "boolean",
@@ -6779,10 +6926,61 @@ const openapiDocument = {
6779
6926
  "rules": {
6780
6927
  "type": "object",
6781
6928
  "description": "Endpoint-specific filtering rules"
6929
+ },
6930
+ "is_route_target": {
6931
+ "type": "boolean",
6932
+ "default": false,
6933
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
6782
6934
  }
6783
6935
  },
6784
6936
  "required": ["url"]
6785
6937
  },
6938
+ "CreateFunctionEndpointInput": {
6939
+ "type": "object",
6940
+ "additionalProperties": false,
6941
+ "properties": {
6942
+ "kind": {
6943
+ "type": "string",
6944
+ "enum": ["function"],
6945
+ "description": "Invoke a Primitive Function."
6946
+ },
6947
+ "function_id": {
6948
+ "type": "string",
6949
+ "format": "uuid",
6950
+ "description": "The Function to invoke."
6951
+ },
6952
+ "enabled": {
6953
+ "type": "boolean",
6954
+ "default": true,
6955
+ "description": "Whether the endpoint is active"
6956
+ },
6957
+ "domain_id": {
6958
+ "type": ["string", "null"],
6959
+ "format": "uuid",
6960
+ "description": "Restrict to emails from a specific domain"
6961
+ },
6962
+ "rules": {
6963
+ "type": "object",
6964
+ "description": "Endpoint-specific filtering rules"
6965
+ },
6966
+ "is_route_target": {
6967
+ "type": "boolean",
6968
+ "default": false,
6969
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
6970
+ }
6971
+ },
6972
+ "required": ["kind", "function_id"]
6973
+ },
6974
+ "CreateEndpointInput": {
6975
+ "oneOf": [{ "$ref": "#/components/schemas/CreateHttpEndpointInput" }, { "$ref": "#/components/schemas/CreateFunctionEndpointInput" }],
6976
+ "discriminator": {
6977
+ "propertyName": "kind",
6978
+ "mapping": {
6979
+ "http": "#/components/schemas/CreateHttpEndpointInput",
6980
+ "function": "#/components/schemas/CreateFunctionEndpointInput"
6981
+ }
6982
+ }
6983
+ },
6786
6984
  "UpdateEndpointInput": {
6787
6985
  "type": "object",
6788
6986
  "additionalProperties": false,
@@ -6886,14 +7084,11 @@ const openapiDocument = {
6886
7084
  "properties": { "enabled": { "type": "boolean" } },
6887
7085
  "required": ["enabled"]
6888
7086
  },
6889
- "DeliverySummary": {
7087
+ "RecipientRoute": {
6890
7088
  "type": "object",
7089
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
6891
7090
  "properties": {
6892
7091
  "id": {
6893
- "type": "string",
6894
- "description": "Delivery ID (numeric string)"
6895
- },
6896
- "email_id": {
6897
7092
  "type": "string",
6898
7093
  "format": "uuid"
6899
7094
  },
@@ -6901,105 +7096,367 @@ const openapiDocument = {
6901
7096
  "type": "string",
6902
7097
  "format": "uuid"
6903
7098
  },
6904
- "endpoint_id": {
6905
- "type": "string",
6906
- "format": "uuid"
7099
+ "domain_id": {
7100
+ "type": ["string", "null"],
7101
+ "format": "uuid",
7102
+ "description": "Domain the route is scoped to; null = org-wide."
6907
7103
  },
6908
- "endpoint_url": { "type": "string" },
6909
- "status": {
7104
+ "match_type": {
6910
7105
  "type": "string",
6911
7106
  "enum": [
6912
- "pending",
6913
- "delivered",
6914
- "header_confirmed",
6915
- "failed"
7107
+ "exact",
7108
+ "wildcard",
7109
+ "regex"
6916
7110
  ]
6917
7111
  },
6918
- "attempt_count": { "type": "integer" },
6919
- "duration_ms": { "type": ["integer", "null"] },
6920
- "last_error": { "type": ["string", "null"] },
6921
- "created_at": {
7112
+ "pattern": {
6922
7113
  "type": "string",
6923
- "format": "date-time"
7114
+ "description": "The recipient address pattern (an exact address or a wildcard)."
6924
7115
  },
6925
- "updated_at": {
7116
+ "pattern_norm": {
7117
+ "type": ["string", "null"],
7118
+ "description": "Normalized pattern used for matching."
7119
+ },
7120
+ "endpoint_id": {
7121
+ "type": "string",
7122
+ "format": "uuid",
7123
+ "description": "The endpoint inbound mail matching this rule is delivered to."
7124
+ },
7125
+ "priority": {
7126
+ "type": "integer",
7127
+ "description": "Evaluation order within a scope; lower is checked first."
7128
+ },
7129
+ "enabled": { "type": "boolean" },
7130
+ "match_count": {
6926
7131
  "type": "string",
7132
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
7133
+ },
7134
+ "last_matched_at": {
7135
+ "type": ["string", "null"],
6927
7136
  "format": "date-time"
6928
7137
  },
6929
- "email": {
6930
- "type": ["object", "null"],
6931
- "properties": {
6932
- "sender": { "type": "string" },
6933
- "recipient": { "type": "string" },
6934
- "subject": { "type": ["string", "null"] }
6935
- },
6936
- "required": ["sender", "recipient"]
7138
+ "created_at": {
7139
+ "type": "string",
7140
+ "format": "date-time"
6937
7141
  }
6938
7142
  },
6939
- "required": [
6940
- "id",
6941
- "email_id",
6942
- "org_id",
6943
- "endpoint_id",
6944
- "endpoint_url",
6945
- "status",
6946
- "attempt_count",
6947
- "created_at",
6948
- "updated_at"
6949
- ]
7143
+ "required": ["id"]
6950
7144
  },
6951
- "ReplayResult": {
7145
+ "CreateRouteInput": {
6952
7146
  "type": "object",
7147
+ "additionalProperties": false,
7148
+ "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",
6953
7149
  "properties": {
6954
- "delivered": {
6955
- "type": "integer",
6956
- "description": "Number of successful deliveries"
7150
+ "match_type": {
7151
+ "type": "string",
7152
+ "enum": [
7153
+ "exact",
7154
+ "wildcard",
7155
+ "regex"
7156
+ ]
6957
7157
  },
6958
- "failed": {
7158
+ "pattern": {
7159
+ "type": "string",
7160
+ "minLength": 1,
7161
+ "maxLength": 512
7162
+ },
7163
+ "endpoint_id": {
7164
+ "type": "string",
7165
+ "format": "uuid",
7166
+ "description": "An existing endpoint to route to. Mutually exclusive with function_id."
7167
+ },
7168
+ "function_id": {
7169
+ "type": "string",
7170
+ "format": "uuid",
7171
+ "description": "Route to this function, minting its route-target endpoint if needed. Mutually exclusive with endpoint_id."
7172
+ },
7173
+ "domain_id": {
7174
+ "type": ["string", "null"],
7175
+ "format": "uuid",
7176
+ "description": "Scope the route to a domain; defaults to the pattern's domain."
7177
+ },
7178
+ "priority": {
6959
7179
  "type": "integer",
6960
- "description": "Number of failed deliveries"
6961
- }
6962
- },
6963
- "required": ["delivered", "failed"]
6964
- },
6965
- "DiscardContentResult": {
6966
- "type": "object",
6967
- "properties": {
6968
- "discarded": {
6969
- "type": "boolean",
6970
- "description": "Always `true` on a 2xx response. The content is either now\ndiscarded as a result of this call, or was already discarded\nbefore this call ran.\n"
7180
+ "minimum": 0,
7181
+ "maximum": 1e6
6971
7182
  },
6972
- "already_discarded": {
6973
- "type": "boolean",
6974
- "description": "`true` if the email's content was already discarded before\nthis call ran (no work was done). `false` if this call was\nthe one that performed the discard.\n"
6975
- }
7183
+ "enabled": { "type": "boolean" }
6976
7184
  },
6977
- "required": ["discarded", "already_discarded"]
6978
- },
6979
- "FunctionDeployStatus": {
6980
- "type": "string",
6981
- "enum": [
6982
- "pending",
6983
- "deployed",
6984
- "failed"
6985
- ],
6986
- "description": "Lifecycle state of the latest deploy attempt:\n * `pending` — deploy in flight; the runtime has not yet\n confirmed the new bundle is live.\n * `deployed` — the running edge handler is the latest code.\n * `failed` — the most recent deploy attempt failed; the\n previously-live code (if any) is still running. The\n `deploy_error` field carries the error message.\n"
7185
+ "required": ["match_type", "pattern"]
6987
7186
  },
6988
- "FunctionListItem": {
7187
+ "UpdateRouteInput": {
6989
7188
  "type": "object",
6990
- "description": "One row from the function listing.",
7189
+ "additionalProperties": false,
6991
7190
  "properties": {
6992
- "id": {
7191
+ "match_type": {
6993
7192
  "type": "string",
6994
- "format": "uuid",
6995
- "description": "Function id, also the script name in the edge runtime."
7193
+ "enum": [
7194
+ "exact",
7195
+ "wildcard",
7196
+ "regex"
7197
+ ]
6996
7198
  },
6997
- "name": {
7199
+ "pattern": {
6998
7200
  "type": "string",
6999
- "description": "Slug-style name set on creation. Stable; cannot be changed."
7201
+ "minLength": 1,
7202
+ "maxLength": 512
7000
7203
  },
7001
- "deploy_status": { "$ref": "#/components/schemas/FunctionDeployStatus" },
7002
- "deployed_at": {
7204
+ "endpoint_id": {
7205
+ "type": "string",
7206
+ "format": "uuid"
7207
+ },
7208
+ "domain_id": {
7209
+ "type": ["string", "null"],
7210
+ "format": "uuid"
7211
+ },
7212
+ "priority": {
7213
+ "type": "integer",
7214
+ "minimum": 0,
7215
+ "maximum": 1e6
7216
+ },
7217
+ "enabled": { "type": "boolean" }
7218
+ }
7219
+ },
7220
+ "ReorderRoutesInput": {
7221
+ "type": "object",
7222
+ "additionalProperties": false,
7223
+ "properties": { "updates": {
7224
+ "type": "array",
7225
+ "minItems": 1,
7226
+ "maxItems": 1e3,
7227
+ "items": {
7228
+ "type": "object",
7229
+ "additionalProperties": false,
7230
+ "properties": {
7231
+ "id": {
7232
+ "type": "string",
7233
+ "format": "uuid"
7234
+ },
7235
+ "priority": {
7236
+ "type": "integer",
7237
+ "minimum": 0,
7238
+ "maximum": 1e6
7239
+ }
7240
+ },
7241
+ "required": ["id", "priority"]
7242
+ }
7243
+ } },
7244
+ "required": ["updates"]
7245
+ },
7246
+ "SimulateRouteInput": {
7247
+ "type": "object",
7248
+ "additionalProperties": false,
7249
+ "properties": {
7250
+ "recipient": {
7251
+ "type": "string",
7252
+ "minLength": 1,
7253
+ "maxLength": 320
7254
+ },
7255
+ "event_type": {
7256
+ "type": "string",
7257
+ "minLength": 1,
7258
+ "maxLength": 100,
7259
+ "description": "Event type to model; defaults to email.received."
7260
+ }
7261
+ },
7262
+ "required": ["recipient"]
7263
+ },
7264
+ "RouteEvaluatedEntry": {
7265
+ "type": "object",
7266
+ "properties": {
7267
+ "route_id": { "type": "string" },
7268
+ "tier": {
7269
+ "type": "string",
7270
+ "enum": [
7271
+ "exact",
7272
+ "wildcard",
7273
+ "regex"
7274
+ ]
7275
+ },
7276
+ "pattern": { "type": "string" },
7277
+ "result": {
7278
+ "type": "string",
7279
+ "enum": [
7280
+ "hit",
7281
+ "miss",
7282
+ "skipped",
7283
+ "error"
7284
+ ]
7285
+ },
7286
+ "reason": { "type": "string" }
7287
+ },
7288
+ "required": [
7289
+ "route_id",
7290
+ "tier",
7291
+ "pattern",
7292
+ "result"
7293
+ ]
7294
+ },
7295
+ "SimulateRouteResult": {
7296
+ "type": "object",
7297
+ "description": "Where an inbound email to the recipient would be delivered, and why.",
7298
+ "properties": {
7299
+ "outcome": {
7300
+ "type": "string",
7301
+ "enum": [
7302
+ "matched",
7303
+ "defaulted",
7304
+ "none"
7305
+ ]
7306
+ },
7307
+ "recipient": { "type": "string" },
7308
+ "endpoint_id": { "type": ["string", "null"] },
7309
+ "matched_route_id": { "type": ["string", "null"] },
7310
+ "matched_tier": {
7311
+ "type": ["string", "null"],
7312
+ "enum": [
7313
+ "exact",
7314
+ "wildcard",
7315
+ "regex",
7316
+ null
7317
+ ]
7318
+ },
7319
+ "matched_pattern": { "type": ["string", "null"] },
7320
+ "default_scope": {
7321
+ "type": ["string", "null"],
7322
+ "enum": [
7323
+ "domain",
7324
+ "org",
7325
+ null
7326
+ ]
7327
+ },
7328
+ "evaluated": {
7329
+ "type": "array",
7330
+ "items": { "$ref": "#/components/schemas/RouteEvaluatedEntry" }
7331
+ },
7332
+ "truncated": { "type": "boolean" }
7333
+ },
7334
+ "required": [
7335
+ "outcome",
7336
+ "recipient",
7337
+ "endpoint_id",
7338
+ "matched_route_id",
7339
+ "matched_tier",
7340
+ "matched_pattern",
7341
+ "default_scope",
7342
+ "evaluated",
7343
+ "truncated"
7344
+ ]
7345
+ },
7346
+ "DeliverySummary": {
7347
+ "type": "object",
7348
+ "properties": {
7349
+ "id": {
7350
+ "type": "string",
7351
+ "description": "Delivery ID (numeric string)"
7352
+ },
7353
+ "email_id": {
7354
+ "type": "string",
7355
+ "format": "uuid"
7356
+ },
7357
+ "org_id": {
7358
+ "type": "string",
7359
+ "format": "uuid"
7360
+ },
7361
+ "endpoint_id": {
7362
+ "type": "string",
7363
+ "format": "uuid"
7364
+ },
7365
+ "endpoint_url": { "type": "string" },
7366
+ "status": {
7367
+ "type": "string",
7368
+ "enum": [
7369
+ "pending",
7370
+ "delivered",
7371
+ "header_confirmed",
7372
+ "failed"
7373
+ ]
7374
+ },
7375
+ "attempt_count": { "type": "integer" },
7376
+ "duration_ms": { "type": ["integer", "null"] },
7377
+ "last_error": { "type": ["string", "null"] },
7378
+ "created_at": {
7379
+ "type": "string",
7380
+ "format": "date-time"
7381
+ },
7382
+ "updated_at": {
7383
+ "type": "string",
7384
+ "format": "date-time"
7385
+ },
7386
+ "email": {
7387
+ "type": ["object", "null"],
7388
+ "properties": {
7389
+ "sender": { "type": "string" },
7390
+ "recipient": { "type": "string" },
7391
+ "subject": { "type": ["string", "null"] }
7392
+ },
7393
+ "required": ["sender", "recipient"]
7394
+ }
7395
+ },
7396
+ "required": [
7397
+ "id",
7398
+ "email_id",
7399
+ "org_id",
7400
+ "endpoint_id",
7401
+ "endpoint_url",
7402
+ "status",
7403
+ "attempt_count",
7404
+ "created_at",
7405
+ "updated_at"
7406
+ ]
7407
+ },
7408
+ "ReplayResult": {
7409
+ "type": "object",
7410
+ "properties": {
7411
+ "delivered": {
7412
+ "type": "integer",
7413
+ "description": "Number of successful deliveries"
7414
+ },
7415
+ "failed": {
7416
+ "type": "integer",
7417
+ "description": "Number of failed deliveries"
7418
+ }
7419
+ },
7420
+ "required": ["delivered", "failed"]
7421
+ },
7422
+ "DiscardContentResult": {
7423
+ "type": "object",
7424
+ "properties": {
7425
+ "discarded": {
7426
+ "type": "boolean",
7427
+ "description": "Always `true` on a 2xx response. The content is either now\ndiscarded as a result of this call, or was already discarded\nbefore this call ran.\n"
7428
+ },
7429
+ "already_discarded": {
7430
+ "type": "boolean",
7431
+ "description": "`true` if the email's content was already discarded before\nthis call ran (no work was done). `false` if this call was\nthe one that performed the discard.\n"
7432
+ }
7433
+ },
7434
+ "required": ["discarded", "already_discarded"]
7435
+ },
7436
+ "FunctionDeployStatus": {
7437
+ "type": "string",
7438
+ "enum": [
7439
+ "pending",
7440
+ "deployed",
7441
+ "failed"
7442
+ ],
7443
+ "description": "Lifecycle state of the latest deploy attempt:\n * `pending` — deploy in flight; the runtime has not yet\n confirmed the new bundle is live.\n * `deployed` — the running edge handler is the latest code.\n * `failed` — the most recent deploy attempt failed; the\n previously-live code (if any) is still running. The\n `deploy_error` field carries the error message.\n"
7444
+ },
7445
+ "FunctionListItem": {
7446
+ "type": "object",
7447
+ "description": "One row from the function listing.",
7448
+ "properties": {
7449
+ "id": {
7450
+ "type": "string",
7451
+ "format": "uuid",
7452
+ "description": "Function id, also the script name in the edge runtime."
7453
+ },
7454
+ "name": {
7455
+ "type": "string",
7456
+ "description": "Slug-style name set on creation. Stable; cannot be changed."
7457
+ },
7458
+ "deploy_status": { "$ref": "#/components/schemas/FunctionDeployStatus" },
7459
+ "deployed_at": {
7003
7460
  "type": ["string", "null"],
7004
7461
  "format": "date-time",
7005
7462
  "description": "Timestamp of the most recent successful deploy. Null until the first deploy succeeds."
@@ -10836,41 +11293,96 @@ const operationManifest = [
10836
11293
  "pathParams": [],
10837
11294
  "queryParams": [],
10838
11295
  "requestSchema": {
10839
- "type": "object",
10840
- "additionalProperties": false,
10841
- "properties": {
10842
- "url": {
10843
- "type": "string",
10844
- "minLength": 1,
10845
- "description": "The webhook URL to deliver events to"
10846
- },
10847
- "enabled": {
10848
- "type": "boolean",
10849
- "default": true,
10850
- "description": "Whether the endpoint is active"
10851
- },
10852
- "domain_id": {
10853
- "type": ["string", "null"],
10854
- "format": "uuid",
10855
- "description": "Restrict to emails from a specific domain"
10856
- },
10857
- "rules": {
10858
- "type": "object",
10859
- "description": "Endpoint-specific filtering rules"
10860
- }
10861
- },
10862
- "required": ["url"]
10863
- },
10864
- "responseSchema": {
10865
- "type": "object",
10866
- "properties": {
10867
- "id": {
10868
- "type": "string",
10869
- "format": "uuid"
11296
+ "oneOf": [{
11297
+ "type": "object",
11298
+ "additionalProperties": false,
11299
+ "properties": {
11300
+ "kind": {
11301
+ "type": "string",
11302
+ "enum": ["http"],
11303
+ "default": "http",
11304
+ "description": "Deliver to a webhook URL."
11305
+ },
11306
+ "url": {
11307
+ "type": "string",
11308
+ "minLength": 1,
11309
+ "description": "The webhook URL to deliver events to."
11310
+ },
11311
+ "enabled": {
11312
+ "type": "boolean",
11313
+ "default": true,
11314
+ "description": "Whether the endpoint is active"
11315
+ },
11316
+ "domain_id": {
11317
+ "type": ["string", "null"],
11318
+ "format": "uuid",
11319
+ "description": "Restrict to emails from a specific domain"
11320
+ },
11321
+ "rules": {
11322
+ "type": "object",
11323
+ "description": "Endpoint-specific filtering rules"
11324
+ },
11325
+ "is_route_target": {
11326
+ "type": "boolean",
11327
+ "default": false,
11328
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
11329
+ }
10870
11330
  },
10871
- "org_id": {
10872
- "type": "string",
10873
- "format": "uuid"
11331
+ "required": ["url"]
11332
+ }, {
11333
+ "type": "object",
11334
+ "additionalProperties": false,
11335
+ "properties": {
11336
+ "kind": {
11337
+ "type": "string",
11338
+ "enum": ["function"],
11339
+ "description": "Invoke a Primitive Function."
11340
+ },
11341
+ "function_id": {
11342
+ "type": "string",
11343
+ "format": "uuid",
11344
+ "description": "The Function to invoke."
11345
+ },
11346
+ "enabled": {
11347
+ "type": "boolean",
11348
+ "default": true,
11349
+ "description": "Whether the endpoint is active"
11350
+ },
11351
+ "domain_id": {
11352
+ "type": ["string", "null"],
11353
+ "format": "uuid",
11354
+ "description": "Restrict to emails from a specific domain"
11355
+ },
11356
+ "rules": {
11357
+ "type": "object",
11358
+ "description": "Endpoint-specific filtering rules"
11359
+ },
11360
+ "is_route_target": {
11361
+ "type": "boolean",
11362
+ "default": false,
11363
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
11364
+ }
11365
+ },
11366
+ "required": ["kind", "function_id"]
11367
+ }],
11368
+ "discriminator": {
11369
+ "propertyName": "kind",
11370
+ "mapping": {
11371
+ "http": "#/components/schemas/CreateHttpEndpointInput",
11372
+ "function": "#/components/schemas/CreateFunctionEndpointInput"
11373
+ }
11374
+ }
11375
+ },
11376
+ "responseSchema": {
11377
+ "type": "object",
11378
+ "properties": {
11379
+ "id": {
11380
+ "type": "string",
11381
+ "format": "uuid"
11382
+ },
11383
+ "org_id": {
11384
+ "type": "string",
11385
+ "format": "uuid"
10874
11386
  },
10875
11387
  "url": { "type": ["string", "null"] },
10876
11388
  "enabled": { "type": "boolean" },
@@ -10922,6 +11434,20 @@ const operationManifest = [
10922
11434
  "deactivated_at": {
10923
11435
  "type": ["string", "null"],
10924
11436
  "format": "date-time"
11437
+ },
11438
+ "kind": {
11439
+ "type": "string",
11440
+ "enum": ["http", "function"],
11441
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
11442
+ },
11443
+ "function_id": {
11444
+ "type": ["string", "null"],
11445
+ "format": "uuid",
11446
+ "description": "The Function this endpoint invokes, when kind is function."
11447
+ },
11448
+ "is_route_target": {
11449
+ "type": "boolean",
11450
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
10925
11451
  }
10926
11452
  },
10927
11453
  "required": [
@@ -11041,6 +11567,20 @@ const operationManifest = [
11041
11567
  "deactivated_at": {
11042
11568
  "type": ["string", "null"],
11043
11569
  "format": "date-time"
11570
+ },
11571
+ "kind": {
11572
+ "type": "string",
11573
+ "enum": ["http", "function"],
11574
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
11575
+ },
11576
+ "function_id": {
11577
+ "type": ["string", "null"],
11578
+ "format": "uuid",
11579
+ "description": "The Function this endpoint invokes, when kind is function."
11580
+ },
11581
+ "is_route_target": {
11582
+ "type": "boolean",
11583
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
11044
11584
  }
11045
11585
  },
11046
11586
  "required": [
@@ -11199,6 +11739,20 @@ const operationManifest = [
11199
11739
  "deactivated_at": {
11200
11740
  "type": ["string", "null"],
11201
11741
  "format": "date-time"
11742
+ },
11743
+ "kind": {
11744
+ "type": "string",
11745
+ "enum": ["http", "function"],
11746
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
11747
+ },
11748
+ "function_id": {
11749
+ "type": ["string", "null"],
11750
+ "format": "uuid",
11751
+ "description": "The Function this endpoint invokes, when kind is function."
11752
+ },
11753
+ "is_route_target": {
11754
+ "type": "boolean",
11755
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
11202
11756
  }
11203
11757
  },
11204
11758
  "required": [
@@ -14898,6 +15452,555 @@ const operationManifest = [
14898
15452
  "tag": "Registries",
14899
15453
  "tagCommand": "registries"
14900
15454
  },
15455
+ {
15456
+ "binaryResponse": false,
15457
+ "bodyRequired": true,
15458
+ "command": "create-route",
15459
+ "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",
15460
+ "hasJsonBody": true,
15461
+ "method": "POST",
15462
+ "operationId": "createRoute",
15463
+ "path": "/routes",
15464
+ "pathParams": [],
15465
+ "queryParams": [],
15466
+ "requestSchema": {
15467
+ "type": "object",
15468
+ "additionalProperties": false,
15469
+ "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",
15470
+ "properties": {
15471
+ "match_type": {
15472
+ "type": "string",
15473
+ "enum": [
15474
+ "exact",
15475
+ "wildcard",
15476
+ "regex"
15477
+ ]
15478
+ },
15479
+ "pattern": {
15480
+ "type": "string",
15481
+ "minLength": 1,
15482
+ "maxLength": 512
15483
+ },
15484
+ "endpoint_id": {
15485
+ "type": "string",
15486
+ "format": "uuid",
15487
+ "description": "An existing endpoint to route to. Mutually exclusive with function_id."
15488
+ },
15489
+ "function_id": {
15490
+ "type": "string",
15491
+ "format": "uuid",
15492
+ "description": "Route to this function, minting its route-target endpoint if needed. Mutually exclusive with endpoint_id."
15493
+ },
15494
+ "domain_id": {
15495
+ "type": ["string", "null"],
15496
+ "format": "uuid",
15497
+ "description": "Scope the route to a domain; defaults to the pattern's domain."
15498
+ },
15499
+ "priority": {
15500
+ "type": "integer",
15501
+ "minimum": 0,
15502
+ "maximum": 1e6
15503
+ },
15504
+ "enabled": { "type": "boolean" }
15505
+ },
15506
+ "required": ["match_type", "pattern"]
15507
+ },
15508
+ "responseSchema": {
15509
+ "type": "object",
15510
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15511
+ "properties": {
15512
+ "id": {
15513
+ "type": "string",
15514
+ "format": "uuid"
15515
+ },
15516
+ "org_id": {
15517
+ "type": "string",
15518
+ "format": "uuid"
15519
+ },
15520
+ "domain_id": {
15521
+ "type": ["string", "null"],
15522
+ "format": "uuid",
15523
+ "description": "Domain the route is scoped to; null = org-wide."
15524
+ },
15525
+ "match_type": {
15526
+ "type": "string",
15527
+ "enum": [
15528
+ "exact",
15529
+ "wildcard",
15530
+ "regex"
15531
+ ]
15532
+ },
15533
+ "pattern": {
15534
+ "type": "string",
15535
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15536
+ },
15537
+ "pattern_norm": {
15538
+ "type": ["string", "null"],
15539
+ "description": "Normalized pattern used for matching."
15540
+ },
15541
+ "endpoint_id": {
15542
+ "type": "string",
15543
+ "format": "uuid",
15544
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15545
+ },
15546
+ "priority": {
15547
+ "type": "integer",
15548
+ "description": "Evaluation order within a scope; lower is checked first."
15549
+ },
15550
+ "enabled": { "type": "boolean" },
15551
+ "match_count": {
15552
+ "type": "string",
15553
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15554
+ },
15555
+ "last_matched_at": {
15556
+ "type": ["string", "null"],
15557
+ "format": "date-time"
15558
+ },
15559
+ "created_at": {
15560
+ "type": "string",
15561
+ "format": "date-time"
15562
+ }
15563
+ },
15564
+ "required": ["id"]
15565
+ },
15566
+ "sdkName": "createRoute",
15567
+ "summary": "Create a recipient route",
15568
+ "tag": "Routes",
15569
+ "tagCommand": "routes"
15570
+ },
15571
+ {
15572
+ "binaryResponse": false,
15573
+ "bodyRequired": false,
15574
+ "command": "delete-route",
15575
+ "description": null,
15576
+ "hasJsonBody": false,
15577
+ "method": "DELETE",
15578
+ "operationId": "deleteRoute",
15579
+ "path": "/routes/{id}",
15580
+ "pathParams": [{
15581
+ "description": "Resource UUID",
15582
+ "enum": null,
15583
+ "name": "id",
15584
+ "required": true,
15585
+ "type": "string"
15586
+ }],
15587
+ "queryParams": [],
15588
+ "requestSchema": null,
15589
+ "responseSchema": null,
15590
+ "sdkName": "deleteRoute",
15591
+ "summary": "Delete a recipient route",
15592
+ "tag": "Routes",
15593
+ "tagCommand": "routes"
15594
+ },
15595
+ {
15596
+ "binaryResponse": false,
15597
+ "bodyRequired": false,
15598
+ "command": "list-routes",
15599
+ "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",
15600
+ "hasJsonBody": false,
15601
+ "method": "GET",
15602
+ "operationId": "listRoutes",
15603
+ "path": "/routes",
15604
+ "pathParams": [],
15605
+ "queryParams": [],
15606
+ "requestSchema": null,
15607
+ "responseSchema": {
15608
+ "type": "array",
15609
+ "items": {
15610
+ "type": "object",
15611
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15612
+ "properties": {
15613
+ "id": {
15614
+ "type": "string",
15615
+ "format": "uuid"
15616
+ },
15617
+ "org_id": {
15618
+ "type": "string",
15619
+ "format": "uuid"
15620
+ },
15621
+ "domain_id": {
15622
+ "type": ["string", "null"],
15623
+ "format": "uuid",
15624
+ "description": "Domain the route is scoped to; null = org-wide."
15625
+ },
15626
+ "match_type": {
15627
+ "type": "string",
15628
+ "enum": [
15629
+ "exact",
15630
+ "wildcard",
15631
+ "regex"
15632
+ ]
15633
+ },
15634
+ "pattern": {
15635
+ "type": "string",
15636
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15637
+ },
15638
+ "pattern_norm": {
15639
+ "type": ["string", "null"],
15640
+ "description": "Normalized pattern used for matching."
15641
+ },
15642
+ "endpoint_id": {
15643
+ "type": "string",
15644
+ "format": "uuid",
15645
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15646
+ },
15647
+ "priority": {
15648
+ "type": "integer",
15649
+ "description": "Evaluation order within a scope; lower is checked first."
15650
+ },
15651
+ "enabled": { "type": "boolean" },
15652
+ "match_count": {
15653
+ "type": "string",
15654
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15655
+ },
15656
+ "last_matched_at": {
15657
+ "type": ["string", "null"],
15658
+ "format": "date-time"
15659
+ },
15660
+ "created_at": {
15661
+ "type": "string",
15662
+ "format": "date-time"
15663
+ }
15664
+ },
15665
+ "required": ["id"]
15666
+ }
15667
+ },
15668
+ "sdkName": "listRoutes",
15669
+ "summary": "List recipient routes",
15670
+ "tag": "Routes",
15671
+ "tagCommand": "routes"
15672
+ },
15673
+ {
15674
+ "binaryResponse": false,
15675
+ "bodyRequired": true,
15676
+ "command": "reorder-routes",
15677
+ "description": "Update the priority of one or more routes in a single call.",
15678
+ "hasJsonBody": true,
15679
+ "method": "POST",
15680
+ "operationId": "reorderRoutes",
15681
+ "path": "/routes/reorder",
15682
+ "pathParams": [],
15683
+ "queryParams": [],
15684
+ "requestSchema": {
15685
+ "type": "object",
15686
+ "additionalProperties": false,
15687
+ "properties": { "updates": {
15688
+ "type": "array",
15689
+ "minItems": 1,
15690
+ "maxItems": 1e3,
15691
+ "items": {
15692
+ "type": "object",
15693
+ "additionalProperties": false,
15694
+ "properties": {
15695
+ "id": {
15696
+ "type": "string",
15697
+ "format": "uuid"
15698
+ },
15699
+ "priority": {
15700
+ "type": "integer",
15701
+ "minimum": 0,
15702
+ "maximum": 1e6
15703
+ }
15704
+ },
15705
+ "required": ["id", "priority"]
15706
+ }
15707
+ } },
15708
+ "required": ["updates"]
15709
+ },
15710
+ "responseSchema": {
15711
+ "type": "array",
15712
+ "items": {
15713
+ "type": "object",
15714
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15715
+ "properties": {
15716
+ "id": {
15717
+ "type": "string",
15718
+ "format": "uuid"
15719
+ },
15720
+ "org_id": {
15721
+ "type": "string",
15722
+ "format": "uuid"
15723
+ },
15724
+ "domain_id": {
15725
+ "type": ["string", "null"],
15726
+ "format": "uuid",
15727
+ "description": "Domain the route is scoped to; null = org-wide."
15728
+ },
15729
+ "match_type": {
15730
+ "type": "string",
15731
+ "enum": [
15732
+ "exact",
15733
+ "wildcard",
15734
+ "regex"
15735
+ ]
15736
+ },
15737
+ "pattern": {
15738
+ "type": "string",
15739
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15740
+ },
15741
+ "pattern_norm": {
15742
+ "type": ["string", "null"],
15743
+ "description": "Normalized pattern used for matching."
15744
+ },
15745
+ "endpoint_id": {
15746
+ "type": "string",
15747
+ "format": "uuid",
15748
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15749
+ },
15750
+ "priority": {
15751
+ "type": "integer",
15752
+ "description": "Evaluation order within a scope; lower is checked first."
15753
+ },
15754
+ "enabled": { "type": "boolean" },
15755
+ "match_count": {
15756
+ "type": "string",
15757
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15758
+ },
15759
+ "last_matched_at": {
15760
+ "type": ["string", "null"],
15761
+ "format": "date-time"
15762
+ },
15763
+ "created_at": {
15764
+ "type": "string",
15765
+ "format": "date-time"
15766
+ }
15767
+ },
15768
+ "required": ["id"]
15769
+ }
15770
+ },
15771
+ "sdkName": "reorderRoutes",
15772
+ "summary": "Reorder recipient routes",
15773
+ "tag": "Routes",
15774
+ "tagCommand": "routes"
15775
+ },
15776
+ {
15777
+ "binaryResponse": false,
15778
+ "bodyRequired": true,
15779
+ "command": "simulate-route",
15780
+ "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",
15781
+ "hasJsonBody": true,
15782
+ "method": "POST",
15783
+ "operationId": "simulateRoute",
15784
+ "path": "/routes/simulate",
15785
+ "pathParams": [],
15786
+ "queryParams": [],
15787
+ "requestSchema": {
15788
+ "type": "object",
15789
+ "additionalProperties": false,
15790
+ "properties": {
15791
+ "recipient": {
15792
+ "type": "string",
15793
+ "minLength": 1,
15794
+ "maxLength": 320
15795
+ },
15796
+ "event_type": {
15797
+ "type": "string",
15798
+ "minLength": 1,
15799
+ "maxLength": 100,
15800
+ "description": "Event type to model; defaults to email.received."
15801
+ }
15802
+ },
15803
+ "required": ["recipient"]
15804
+ },
15805
+ "responseSchema": {
15806
+ "type": "object",
15807
+ "description": "Where an inbound email to the recipient would be delivered, and why.",
15808
+ "properties": {
15809
+ "outcome": {
15810
+ "type": "string",
15811
+ "enum": [
15812
+ "matched",
15813
+ "defaulted",
15814
+ "none"
15815
+ ]
15816
+ },
15817
+ "recipient": { "type": "string" },
15818
+ "endpoint_id": { "type": ["string", "null"] },
15819
+ "matched_route_id": { "type": ["string", "null"] },
15820
+ "matched_tier": {
15821
+ "type": ["string", "null"],
15822
+ "enum": [
15823
+ "exact",
15824
+ "wildcard",
15825
+ "regex",
15826
+ null
15827
+ ]
15828
+ },
15829
+ "matched_pattern": { "type": ["string", "null"] },
15830
+ "default_scope": {
15831
+ "type": ["string", "null"],
15832
+ "enum": [
15833
+ "domain",
15834
+ "org",
15835
+ null
15836
+ ]
15837
+ },
15838
+ "evaluated": {
15839
+ "type": "array",
15840
+ "items": {
15841
+ "type": "object",
15842
+ "properties": {
15843
+ "route_id": { "type": "string" },
15844
+ "tier": {
15845
+ "type": "string",
15846
+ "enum": [
15847
+ "exact",
15848
+ "wildcard",
15849
+ "regex"
15850
+ ]
15851
+ },
15852
+ "pattern": { "type": "string" },
15853
+ "result": {
15854
+ "type": "string",
15855
+ "enum": [
15856
+ "hit",
15857
+ "miss",
15858
+ "skipped",
15859
+ "error"
15860
+ ]
15861
+ },
15862
+ "reason": { "type": "string" }
15863
+ },
15864
+ "required": [
15865
+ "route_id",
15866
+ "tier",
15867
+ "pattern",
15868
+ "result"
15869
+ ]
15870
+ }
15871
+ },
15872
+ "truncated": { "type": "boolean" }
15873
+ },
15874
+ "required": [
15875
+ "outcome",
15876
+ "recipient",
15877
+ "endpoint_id",
15878
+ "matched_route_id",
15879
+ "matched_tier",
15880
+ "matched_pattern",
15881
+ "default_scope",
15882
+ "evaluated",
15883
+ "truncated"
15884
+ ]
15885
+ },
15886
+ "sdkName": "simulateRoute",
15887
+ "summary": "Simulate routing for a recipient",
15888
+ "tag": "Routes",
15889
+ "tagCommand": "routes"
15890
+ },
15891
+ {
15892
+ "binaryResponse": false,
15893
+ "bodyRequired": true,
15894
+ "command": "update-route",
15895
+ "description": null,
15896
+ "hasJsonBody": true,
15897
+ "method": "PATCH",
15898
+ "operationId": "updateRoute",
15899
+ "path": "/routes/{id}",
15900
+ "pathParams": [{
15901
+ "description": "Resource UUID",
15902
+ "enum": null,
15903
+ "name": "id",
15904
+ "required": true,
15905
+ "type": "string"
15906
+ }],
15907
+ "queryParams": [],
15908
+ "requestSchema": {
15909
+ "type": "object",
15910
+ "additionalProperties": false,
15911
+ "properties": {
15912
+ "match_type": {
15913
+ "type": "string",
15914
+ "enum": [
15915
+ "exact",
15916
+ "wildcard",
15917
+ "regex"
15918
+ ]
15919
+ },
15920
+ "pattern": {
15921
+ "type": "string",
15922
+ "minLength": 1,
15923
+ "maxLength": 512
15924
+ },
15925
+ "endpoint_id": {
15926
+ "type": "string",
15927
+ "format": "uuid"
15928
+ },
15929
+ "domain_id": {
15930
+ "type": ["string", "null"],
15931
+ "format": "uuid"
15932
+ },
15933
+ "priority": {
15934
+ "type": "integer",
15935
+ "minimum": 0,
15936
+ "maximum": 1e6
15937
+ },
15938
+ "enabled": { "type": "boolean" }
15939
+ }
15940
+ },
15941
+ "responseSchema": {
15942
+ "type": "object",
15943
+ "description": "A recipient routing rule binding an address pattern to one endpoint.",
15944
+ "properties": {
15945
+ "id": {
15946
+ "type": "string",
15947
+ "format": "uuid"
15948
+ },
15949
+ "org_id": {
15950
+ "type": "string",
15951
+ "format": "uuid"
15952
+ },
15953
+ "domain_id": {
15954
+ "type": ["string", "null"],
15955
+ "format": "uuid",
15956
+ "description": "Domain the route is scoped to; null = org-wide."
15957
+ },
15958
+ "match_type": {
15959
+ "type": "string",
15960
+ "enum": [
15961
+ "exact",
15962
+ "wildcard",
15963
+ "regex"
15964
+ ]
15965
+ },
15966
+ "pattern": {
15967
+ "type": "string",
15968
+ "description": "The recipient address pattern (an exact address or a wildcard)."
15969
+ },
15970
+ "pattern_norm": {
15971
+ "type": ["string", "null"],
15972
+ "description": "Normalized pattern used for matching."
15973
+ },
15974
+ "endpoint_id": {
15975
+ "type": "string",
15976
+ "format": "uuid",
15977
+ "description": "The endpoint inbound mail matching this rule is delivered to."
15978
+ },
15979
+ "priority": {
15980
+ "type": "integer",
15981
+ "description": "Evaluation order within a scope; lower is checked first."
15982
+ },
15983
+ "enabled": { "type": "boolean" },
15984
+ "match_count": {
15985
+ "type": "string",
15986
+ "description": "How many emails have matched this rule (a bigint, returned as a string)."
15987
+ },
15988
+ "last_matched_at": {
15989
+ "type": ["string", "null"],
15990
+ "format": "date-time"
15991
+ },
15992
+ "created_at": {
15993
+ "type": "string",
15994
+ "format": "date-time"
15995
+ }
15996
+ },
15997
+ "required": ["id"]
15998
+ },
15999
+ "sdkName": "updateRoute",
16000
+ "summary": "Update a recipient route",
16001
+ "tag": "Routes",
16002
+ "tagCommand": "routes"
16003
+ },
14901
16004
  {
14902
16005
  "binaryResponse": false,
14903
16006
  "bodyRequired": true,