@productcraft/trawl 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -6,6 +6,23 @@ import { makeClient, PCClientConfig } from '@productcraft/core';
6
6
  */
7
7
 
8
8
  interface paths {
9
+ "/v1/workspaces/{workspace_id}/credits": {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ /** Remaining Trawl steps for this workspace, whether the balance is low, and recent ledger entries */
17
+ get: operations["CreditsController_get"];
18
+ put?: never;
19
+ post?: never;
20
+ delete?: never;
21
+ options?: never;
22
+ head?: never;
23
+ patch?: never;
24
+ trace?: never;
25
+ };
9
26
  "/v1/workspaces/{workspace_id}/jobs": {
10
27
  parameters: {
11
28
  query?: never;
@@ -58,6 +75,30 @@ interface paths {
58
75
  patch?: never;
59
76
  trace?: never;
60
77
  };
78
+ "/v1/workspaces/{workspace_id}/stats": {
79
+ parameters: {
80
+ query?: never;
81
+ header?: never;
82
+ path?: never;
83
+ cookie?: never;
84
+ };
85
+ /**
86
+ * Trawl stats for a workspace
87
+ * @description Total jobs, jobs created / succeeded / failed and steps used in the window, the credit balance, when the latest job was created and a daily jobs series.
88
+ *
89
+ * **Active** means a job was created.
90
+ *
91
+ * Days are UTC. Counts only: no target URLs, descriptions or job results. Cached for up to 60 seconds (`generated_at`).
92
+ */
93
+ get: operations["WorkspaceStatsController_get"];
94
+ put?: never;
95
+ post?: never;
96
+ delete?: never;
97
+ options?: never;
98
+ head?: never;
99
+ patch?: never;
100
+ trace?: never;
101
+ };
61
102
  "/v1/workspaces/{workspace_id}/webhooks": {
62
103
  parameters: {
63
104
  query?: never;
@@ -65,10 +106,18 @@ interface paths {
65
106
  path?: never;
66
107
  cookie?: never;
67
108
  };
68
- /** List webhooks for the workspace (secrets masked) */
109
+ /**
110
+ * List webhooks for the workspace (paginated, newest first, secrets masked)
111
+ * @deprecated
112
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
113
+ */
69
114
  get: operations["WebhookController_list"];
70
115
  put?: never;
71
- /** Create a workspace webhook. The response includes the signing secret in clear EXACTLY ONCE — copy it now. */
116
+ /**
117
+ * Create a workspace webhook. The response includes the signing secret in clear EXACTLY ONCE — copy it now.
118
+ * @deprecated
119
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
120
+ */
72
121
  post: operations["WebhookController_create"];
73
122
  delete?: never;
74
123
  options?: never;
@@ -76,6 +125,172 @@ interface paths {
76
125
  patch?: never;
77
126
  trace?: never;
78
127
  };
128
+ "/v1/workspaces/{workspace_id}/webhooks/endpoints": {
129
+ parameters: {
130
+ query?: never;
131
+ header?: never;
132
+ path?: never;
133
+ cookie?: never;
134
+ };
135
+ /**
136
+ * List webhook endpoints, oldest first.
137
+ * @description At most 10, so this is always one page. Signing secrets are never returned here, only their last 4 characters.
138
+ */
139
+ get: operations["WebhooksController_trawl_workspace_listEndpoints"];
140
+ put?: never;
141
+ /**
142
+ * Add a webhook endpoint. Returns its signing secret once.
143
+ * @description Deliveries are signed with the Standard Webhooks headers `webhook-id`, `webhook-timestamp` and `webhook-signature` (`v1,<base64 HMAC-SHA256 of "<id>.<timestamp>.<body>">`); the returned `whsec_…` secret works unchanged with any Standard Webhooks library. Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h.
144
+ */
145
+ post: operations["WebhooksController_trawl_workspace_createEndpoint"];
146
+ delete?: never;
147
+ options?: never;
148
+ head?: never;
149
+ patch?: never;
150
+ trace?: never;
151
+ };
152
+ "/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}": {
153
+ parameters: {
154
+ query?: never;
155
+ header?: never;
156
+ path?: never;
157
+ cookie?: never;
158
+ };
159
+ /** Get one webhook endpoint (without its secret). */
160
+ get: operations["WebhooksController_trawl_workspace_getEndpoint"];
161
+ put?: never;
162
+ post?: never;
163
+ /**
164
+ * Delete a webhook endpoint.
165
+ * @description Queued retries are dropped. Its past attempts stay in the event log until the events expire.
166
+ */
167
+ delete: operations["WebhooksController_trawl_workspace_deleteEndpoint"];
168
+ options?: never;
169
+ head?: never;
170
+ /**
171
+ * Change a webhook endpoint: URL, description, events, on/off.
172
+ * @description Only the fields sent change. `enabled: true` (or a new URL) also clears an automatic disable. Switching off cancels queued retries. The secret is unchanged; rotate it with `POST …/rotate-secret`.
173
+ */
174
+ patch: operations["WebhooksController_trawl_workspace_updateEndpoint"];
175
+ trace?: never;
176
+ };
177
+ "/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/rotate-secret": {
178
+ parameters: {
179
+ query?: never;
180
+ header?: never;
181
+ path?: never;
182
+ cookie?: never;
183
+ };
184
+ get?: never;
185
+ put?: never;
186
+ /**
187
+ * Rotate the signing secret. The new one is returned once.
188
+ * @description For `grace_hours` (default 24) the previous secret keeps signing too: `webhook-signature` then lists one `v1,` signature per secret, so receivers can switch over without dropping a delivery.
189
+ */
190
+ post: operations["WebhooksController_trawl_workspace_rotateSecret"];
191
+ delete?: never;
192
+ options?: never;
193
+ head?: never;
194
+ patch?: never;
195
+ trace?: never;
196
+ };
197
+ "/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/test": {
198
+ parameters: {
199
+ query?: never;
200
+ header?: never;
201
+ path?: never;
202
+ cookie?: never;
203
+ };
204
+ get?: never;
205
+ put?: never;
206
+ /**
207
+ * Send a test event to this endpoint now and return the result.
208
+ * @description Delivers the catalogue example of `event_type`, signed like any delivery, with `"test": true` in the body. Works while the endpoint is switched off or not subscribed to that type, is logged in the event log, and is never retried or counted toward an automatic disable. Waits up to 15 s for your receiver.
209
+ */
210
+ post: operations["WebhooksController_trawl_workspace_sendTest"];
211
+ delete?: never;
212
+ options?: never;
213
+ head?: never;
214
+ patch?: never;
215
+ trace?: never;
216
+ };
217
+ "/v1/workspaces/{workspace_id}/webhooks/event-types": {
218
+ parameters: {
219
+ query?: never;
220
+ header?: never;
221
+ path?: never;
222
+ cookie?: never;
223
+ };
224
+ /**
225
+ * List the events an endpoint can subscribe to.
226
+ * @description Each type with a plain description, its group and an example `data` object (what "Send test" delivers).
227
+ */
228
+ get: operations["WebhooksController_trawl_workspace_listEventTypes"];
229
+ put?: never;
230
+ post?: never;
231
+ delete?: never;
232
+ options?: never;
233
+ head?: never;
234
+ patch?: never;
235
+ trace?: never;
236
+ };
237
+ "/v1/workspaces/{workspace_id}/webhooks/events": {
238
+ parameters: {
239
+ query?: never;
240
+ header?: never;
241
+ path?: never;
242
+ cookie?: never;
243
+ };
244
+ /**
245
+ * List webhook events, newest first (kept for 30 days).
246
+ * @description Every event logged while at least one endpoint existed, with the latest state per endpoint and when the next retry is due.
247
+ */
248
+ get: operations["WebhooksController_trawl_workspace_listEvents"];
249
+ put?: never;
250
+ post?: never;
251
+ delete?: never;
252
+ options?: never;
253
+ head?: never;
254
+ patch?: never;
255
+ trace?: never;
256
+ };
257
+ "/v1/workspaces/{workspace_id}/webhooks/events/{event_id}": {
258
+ parameters: {
259
+ query?: never;
260
+ header?: never;
261
+ path?: never;
262
+ cookie?: never;
263
+ };
264
+ /** Get one webhook event with every delivery attempt. */
265
+ get: operations["WebhooksController_trawl_workspace_getEvent"];
266
+ put?: never;
267
+ post?: never;
268
+ delete?: never;
269
+ options?: never;
270
+ head?: never;
271
+ patch?: never;
272
+ trace?: never;
273
+ };
274
+ "/v1/workspaces/{workspace_id}/webhooks/events/{event_id}/replay": {
275
+ parameters: {
276
+ query?: never;
277
+ header?: never;
278
+ path?: never;
279
+ cookie?: never;
280
+ };
281
+ get?: never;
282
+ put?: never;
283
+ /**
284
+ * Send a logged event again, to its endpoints or to one endpoint.
285
+ * @description Same body and `webhook-id`, freshly signed, to every switched-on endpoint that receives this event type now, or only to `endpoint_id`. Waits for the receivers (up to 15 s each) and returns the attempts. A success cancels a retry still queued for that endpoint.
286
+ */
287
+ post: operations["WebhooksController_trawl_workspace_replay"];
288
+ delete?: never;
289
+ options?: never;
290
+ head?: never;
291
+ patch?: never;
292
+ trace?: never;
293
+ };
79
294
  "/v1/workspaces/{workspace_id}/webhooks/{id}": {
80
295
  parameters: {
81
296
  query?: never;
@@ -83,15 +298,27 @@ interface paths {
83
298
  path?: never;
84
299
  cookie?: never;
85
300
  };
86
- /** Get a webhook (secret masked) */
301
+ /**
302
+ * Get a webhook (secret masked)
303
+ * @deprecated
304
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
305
+ */
87
306
  get: operations["WebhookController_get"];
88
307
  put?: never;
89
308
  post?: never;
90
- /** Delete a webhook */
309
+ /**
310
+ * Delete a webhook
311
+ * @deprecated
312
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
313
+ */
91
314
  delete: operations["WebhookController_remove"];
92
315
  options?: never;
93
316
  head?: never;
94
- /** Update url / active flag (active=true clears auto-disable) */
317
+ /**
318
+ * Update url / active flag (active=true clears auto-disable)
319
+ * @deprecated
320
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
321
+ */
95
322
  patch: operations["WebhookController_update"];
96
323
  trace?: never;
97
324
  };
@@ -102,7 +329,11 @@ interface paths {
102
329
  path?: never;
103
330
  cookie?: never;
104
331
  };
105
- /** Recent delivery attempts for a webhook (default 50, max 200, newest first) */
332
+ /**
333
+ * Delivery attempts for a webhook (paginated, default 50, max 200, newest first)
334
+ * @deprecated
335
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
336
+ */
106
337
  get: operations["WebhookController_recentDeliveries"];
107
338
  put?: never;
108
339
  post?: never;
@@ -121,7 +352,11 @@ interface paths {
121
352
  };
122
353
  get?: never;
123
354
  put?: never;
124
- /** Rotate the signing secret. Returns the new secret in clear EXACTLY ONCE. */
355
+ /**
356
+ * Rotate the signing secret. Returns the new secret in clear EXACTLY ONCE; the old one stops at once.
357
+ * @deprecated
358
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
359
+ */
125
360
  post: operations["WebhookController_rotateSecret"];
126
361
  delete?: never;
127
362
  options?: never;
@@ -138,7 +373,11 @@ interface paths {
138
373
  };
139
374
  get?: never;
140
375
  put?: never;
141
- /** Fire a synthetic event to this webhook (asynchronous; check the destination logs) */
376
+ /**
377
+ * Send the `job.succeeded` example to this webhook; the attempt shows in `/deliveries`
378
+ * @deprecated
379
+ * @description Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.
380
+ */
142
381
  post: operations["WebhookController_fireTest"];
143
382
  delete?: never;
144
383
  options?: never;
@@ -170,15 +409,21 @@ interface components {
170
409
  * }
171
410
  */
172
411
  json_schema: Record<string, never>;
173
- /** @description Maximum number of worker steps before the job stops. */
174
- max_steps?: number;
412
+ /**
413
+ * @description Maximum number of agent steps (one LLM call each) before the job stops. Defaults to 20. Multi-source extractions typically need 40+. The server additionally clamps this to an operator ceiling, so a very large value does not guarantee a very long run — `timeout_s` still applies.
414
+ * @default 20
415
+ */
416
+ max_steps: number;
175
417
  /** @description Model tier the worker should use (e.g. `standard`, `pro`). */
176
418
  model_tier?: string;
177
419
  /** @description Seed URLs the worker should start from. */
178
420
  suggested_urls?: string[];
179
421
  /** @description Wall-clock timeout for the job, in seconds. */
180
422
  timeout_s?: number;
181
- /** @description Webhook id to notify when the job finishes. */
423
+ /**
424
+ * Format: uuid
425
+ * @description A webhook endpoint of this workspace to notify when the job finishes. Endpoints made before 17 Oct 2026 receive only the jobs that name them here; endpoints made under `/webhooks/endpoints` receive every job event they subscribe to, so leave this out for them.
426
+ */
182
427
  webhook_id?: string;
183
428
  };
184
429
  CreateWebhookDto: {
@@ -187,6 +432,86 @@ interface components {
187
432
  /** @description Destination URL (https required in prod). */
188
433
  url: string;
189
434
  };
435
+ CreateWebhookEndpointDto: {
436
+ /** @example Production receiver */
437
+ description?: string | null;
438
+ /**
439
+ * @description Create it switched off.
440
+ * @default true
441
+ */
442
+ enabled: boolean;
443
+ /**
444
+ * @description Event types from `GET …/webhooks/event-types`. Empty or omitted means every event, including types added later.
445
+ * @example [
446
+ * "job.succeeded",
447
+ * "job.failed"
448
+ * ]
449
+ */
450
+ event_types?: ("job.succeeded" | "job.failed" | "credits.low")[];
451
+ /**
452
+ * Format: uri
453
+ * @description Where to send events: an absolute https:// URL on a public host.
454
+ * @example https://api.acme.com/webhooks
455
+ */
456
+ url: string;
457
+ };
458
+ CreditLedgerEntryDto: {
459
+ /** Format: date-time */
460
+ created_at: string;
461
+ /**
462
+ * @description Steps added (positive: allowance, top-up, grant) or used (negative: a job).
463
+ * @example -12
464
+ */
465
+ delta_steps: number;
466
+ /** Format: uuid */
467
+ id: string;
468
+ /**
469
+ * Format: uuid
470
+ * @description The job, for a `job` entry.
471
+ */
472
+ job_id: string | null;
473
+ /**
474
+ * @description Why: `initial_free_allowance`, `grant`, `job`, …
475
+ * @example job
476
+ */
477
+ reason: string;
478
+ };
479
+ CreditsResponseDto: {
480
+ /**
481
+ * @description Remaining steps. One agent step uses one credit; new jobs are refused (402) at zero. Can dip slightly below zero, because a running job is always allowed to finish.
482
+ * @example 8420
483
+ */
484
+ balance_steps: number;
485
+ /** @description Recent ledger entries, newest first. */
486
+ entries: components["schemas"]["CreditLedgerEntryDto"][];
487
+ /**
488
+ * @description True when the balance is under `low_balance_threshold_steps`. The `credits.low` webhook fires once when this turns true, and again only after the next top-up.
489
+ * @example false
490
+ */
491
+ low_balance: boolean;
492
+ /**
493
+ * @description The low-balance line: 10% of the last top-up, and never under 100 steps.
494
+ * @example 1000
495
+ */
496
+ low_balance_threshold_steps: number;
497
+ };
498
+ ErrorResponseDto: {
499
+ /**
500
+ * @description Stable, machine-readable error code; branch on this, not on `message`. Always present. A route-specific code when the route defines one (e.g. `WEBHOOK_ENDPOINT_NOT_FOUND`, `SERVICE_NOT_ENABLED`), otherwise the generic code for the status: `BAD_REQUEST`, `VALIDATION_ERROR` (400 from request validation), `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `CONFLICT`, `PAYLOAD_TOO_LARGE`, `UNPROCESSABLE_ENTITY`, `RATE_LIMITED`, `INTERNAL_SERVER_ERROR`, `SERVICE_UNAVAILABLE`.
501
+ * @example SERVICE_NOT_ENABLED
502
+ */
503
+ code: string;
504
+ /**
505
+ * @description Human-readable error message. May be a class-validator array on 400.
506
+ * @example Policy denies trawl.read on pcft:workspace/7a0c2f7e-2b8d-4f7f-9a51-3f1f0e1f3c11
507
+ */
508
+ message: string | string[];
509
+ /**
510
+ * @description HTTP status code echoed in the body. Spelled `statusCode` (camelCase) in every ProductCraft API.
511
+ * @example 403
512
+ */
513
+ statusCode: number;
514
+ };
190
515
  JobListPaginationDto: {
191
516
  has_more: boolean;
192
517
  next_cursor: string | null;
@@ -215,49 +540,551 @@ interface components {
215
540
  webhook_id: string | null;
216
541
  workspace_id: string;
217
542
  };
543
+ ListWebhookEndpointsResponseDto: {
544
+ data: components["schemas"]["WebhookEndpointDto"][];
545
+ /** @description Always one page (an endpoint limit applies). */
546
+ pagination: components["schemas"]["WebhookPaginationDto"];
547
+ };
548
+ ListWebhookEventTypesResponseDto: {
549
+ data: components["schemas"]["WebhookEventTypeDto"][];
550
+ };
551
+ ListWebhookEventsResponseDto: {
552
+ data: components["schemas"]["WebhookEventDto"][];
553
+ pagination: components["schemas"]["WebhookPaginationDto"];
554
+ };
555
+ ReplayWebhookEventResponseDto: {
556
+ /** @description One attempt per endpoint it was sent to. */
557
+ attempts: components["schemas"]["WebhookDeliveryAttemptDto"][];
558
+ event_id: string;
559
+ };
560
+ RotateWebhookSecretDto: {
561
+ /**
562
+ * @description Hours the previous secret keeps signing too (0 ends it now).
563
+ * @default 24
564
+ */
565
+ grace_hours: number;
566
+ };
567
+ SendWebhookTestDto: {
568
+ /**
569
+ * @description Which event to send; its catalogue example is the `data`.
570
+ * @example job.succeeded
571
+ * @enum {string}
572
+ */
573
+ event_type: "job.succeeded" | "job.failed" | "credits.low";
574
+ };
575
+ TrawlStatsInWindowDto: {
576
+ /**
577
+ * @description Of those, jobs that failed.
578
+ * @example 3
579
+ */
580
+ failed: number;
581
+ /**
582
+ * @description Jobs created in the window, in any status.
583
+ * @example 37
584
+ */
585
+ jobs: number;
586
+ /**
587
+ * @description Steps consumed by the jobs created in the window. Jobs still running, and jobs from before metering, add nothing.
588
+ * @example 512
589
+ */
590
+ steps_used: number;
591
+ /**
592
+ * @description Of those, jobs that succeeded.
593
+ * @example 33
594
+ */
595
+ succeeded: number;
596
+ };
597
+ TrawlStatsSeriesDto: {
598
+ /**
599
+ * @description Bucket width.
600
+ * @example day
601
+ * @enum {string}
602
+ */
603
+ granularity: "day";
604
+ /**
605
+ * @description Jobs created per UTC day in the workspace, in any status.
606
+ * @example jobs
607
+ * @enum {string}
608
+ */
609
+ metric: "jobs";
610
+ /** @description Dense and zero-filled: one point per UTC day in the window, oldest first, ending today. */
611
+ points: components["schemas"]["TrawlStatsSeriesPointDto"][];
612
+ };
613
+ TrawlStatsSeriesPointDto: {
614
+ /**
615
+ * Format: date
616
+ * @description UTC calendar day.
617
+ * @example 2026-10-07
618
+ */
619
+ date: string;
620
+ /**
621
+ * @description Value for that day.
622
+ * @example 4
623
+ */
624
+ value: number;
625
+ };
626
+ TrawlStatsTotalsDto: {
627
+ /**
628
+ * @description Remaining Trawl steps: the sum of the credit ledger, the same number `GET /v1/workspaces/{workspaceId}/credits` returns. Zero before the first job; can be slightly negative after the last job of a budget.
629
+ * @example 8650
630
+ */
631
+ balance_steps: number;
632
+ /**
633
+ * @description Jobs in the workspace, all time, in any status.
634
+ * @example 418
635
+ */
636
+ jobs: number;
637
+ };
638
+ TrawlWorkspaceStatsDto: {
639
+ /**
640
+ * Format: date-time
641
+ * @description When these numbers were computed. Responses are cached for up to 60 seconds.
642
+ * @example 2026-10-07T09:00:00.000Z
643
+ */
644
+ generated_at: string;
645
+ /** @description Counts for the window. */
646
+ in_window: components["schemas"]["TrawlStatsInWindowDto"];
647
+ /**
648
+ * Format: date-time
649
+ * @description When the workspace's most recent job was created. Null when there has never been one.
650
+ * @example 2026-10-07T08:41:12.000Z
651
+ */
652
+ last_activity_at: string | null;
653
+ /** @description Daily jobs. */
654
+ series: components["schemas"]["TrawlStatsSeriesDto"];
655
+ /** @description All-time counts and the credit balance. */
656
+ totals: components["schemas"]["TrawlStatsTotalsDto"];
657
+ /**
658
+ * @description Window the counts cover.
659
+ * @example 30d
660
+ * @enum {string}
661
+ */
662
+ window: "1d" | "7d" | "30d";
663
+ };
218
664
  UpdateWebhookDto: {
219
665
  /** @description Pause/resume the webhook. Setting active=true clears auto-disable. */
220
666
  active?: boolean;
221
667
  /** @description New destination URL. */
222
668
  url?: string;
223
669
  };
670
+ UpdateWebhookEndpointDto: {
671
+ description?: string | null;
672
+ /** @description Switch it on or off. Switching on also clears an automatic disable. */
673
+ enabled?: boolean;
674
+ /** @description Replaces the subscription. Event types from `GET …/webhooks/event-types`. Empty or omitted means every event, including types added later. */
675
+ event_types?: ("job.succeeded" | "job.failed" | "credits.low")[];
676
+ /**
677
+ * Format: uri
678
+ * @example https://api.acme.com/webhooks
679
+ */
680
+ url?: string;
681
+ };
224
682
  WebhookCreateResponseDto: {
683
+ /** @description Whether it receives events (`enabled` on the new routes). */
225
684
  active: boolean;
685
+ /**
686
+ * Format: date-time
687
+ * @description Set when it was switched off automatically after sustained failures.
688
+ */
226
689
  auto_disabled_at: string | null;
690
+ /** Format: date-time */
227
691
  created_at: string;
692
+ /** @description Failed deliveries in a row (`consecutive_failures` on the new routes). */
228
693
  failure_count: number;
694
+ /** Format: date-time */
229
695
  first_failure_at: string | null;
696
+ /** Format: uuid */
230
697
  id: string;
698
+ /**
699
+ * Format: date-time
700
+ * @description When the latest attempt was made.
701
+ */
231
702
  last_attempt_at: string | null;
703
+ /** @description HTTP status of the latest attempt. */
232
704
  last_status_code: number | null;
233
- /** @description Plaintext signing secret returned EXACTLY ONCE on create + rotate. Persist immediately — it never appears on subsequent GETs. */
705
+ /** @description Always true: every webhook has a signing secret. */
706
+ secret_set?: boolean;
707
+ /** @description Plaintext signing secret (`whsec_…`), returned EXACTLY ONCE. Persist immediately; it does not appear on later reads. */
234
708
  signing_secret: string;
235
709
  url: string;
710
+ /** Format: uuid */
236
711
  workspace_id: string;
237
712
  };
238
- WebhookListResponseDto: {
239
- data: components["schemas"]["WebhookResponseDto"][];
713
+ WebhookDeliveryAttemptDto: {
714
+ /** @description 1 for the first delivery; retries and replays count up. */
715
+ attempt_number: number;
716
+ /** Format: date-time */
717
+ attempted_at: string;
718
+ /** Format: uuid */
719
+ endpoint_id: string;
720
+ /** @example request timed out */
721
+ error_message: string | null;
722
+ /** @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f */
723
+ event_id: string;
724
+ /** @example user.created */
725
+ event_type: string;
726
+ /** Format: uuid */
727
+ id: string;
728
+ latency_ms: number | null;
729
+ /** @description The first 1 KiB of the response body. */
730
+ response_body: string | null;
731
+ /** @description HTTP status; null when no response came back. */
732
+ status_code: number | null;
733
+ /** @description True for a 2xx response. */
734
+ succeeded: boolean;
735
+ /**
736
+ * @description `automatic` (first delivery or a retry), `replay` or `test`.
737
+ * @enum {string}
738
+ */
739
+ trigger: "automatic" | "replay" | "test";
740
+ /**
741
+ * Format: uri
742
+ * @description Where it was sent.
743
+ */
744
+ url: string;
240
745
  };
241
- WebhookResponseDto: {
242
- active: boolean;
243
- auto_disabled_at: string | null;
746
+ WebhookDeliveryListResponseDto: {
747
+ data: components["schemas"]["WebhookDeliveryResponseDto"][];
748
+ pagination: components["schemas"]["WebhookListPaginationDto"];
749
+ };
750
+ WebhookDeliveryResponseDto: {
751
+ /** @description Which attempt this was for the event: 1 for the first delivery, then 2 to 7 for the automatic retries (1m, 5m, 30m, 2h, 6h and 24h after each failure). Retries keep the same `event_id`. A test or a replay is numbered in the same sequence. */
752
+ attempt_number: number;
753
+ /** Format: date-time */
754
+ attempted_at: string;
755
+ error_message: string | null;
756
+ /** @description Id of the event (`evt_…`), the same across retries. */
757
+ event_id: string;
758
+ /** @example job.succeeded */
759
+ event_type: string;
760
+ /** Format: uuid */
761
+ id: string;
762
+ /** @description The job the event was about; null for an event that is not about a job (`credits.low`). */
763
+ job_id: string | null;
764
+ latency_ms: number | null;
765
+ response_body_truncated: string | null;
766
+ /** @description HTTP status returned by the destination; null when no response was received. */
767
+ status_code: number | null;
768
+ /** Format: uuid */
769
+ webhook_id: string;
770
+ };
771
+ WebhookEndpointDto: {
772
+ /** @description Failed automatic deliveries in a row; a success resets it. */
773
+ consecutive_failures: number;
774
+ /** Format: date-time */
244
775
  created_at: string;
245
- failure_count: number;
776
+ /** @example Production receiver */
777
+ description: string | null;
778
+ /** Format: date-time */
779
+ disabled_at: string | null;
780
+ /** @enum {string|null} */
781
+ disabled_reason: "manual" | "failing" | null;
782
+ /** @description The on/off switch (`PATCH … { enabled }`). */
783
+ enabled: boolean;
784
+ /**
785
+ * @description Subscribed event types. Empty means every event, including types added later.
786
+ * @example []
787
+ */
788
+ event_types: string[];
789
+ /**
790
+ * Format: date-time
791
+ * @description Start of the current failure streak.
792
+ */
246
793
  first_failure_at: string | null;
794
+ /** Format: uuid */
247
795
  id: string;
248
- last_attempt_at: string | null;
249
- last_status_code: number | null;
796
+ /** @description True for endpoints carried over from the product's previous webhook system: they also receive the old signature header until its sunset date. */
797
+ legacy_signature: boolean;
798
+ /** @description True while the previous secret still signs too (after a rotation, for its grace period). */
799
+ prev_signing_secret_active: boolean;
800
+ /**
801
+ * Format: date-time
802
+ * @description Until then the previous secret signs too (after a rotation).
803
+ */
804
+ prev_signing_secret_expires_at: string | null;
805
+ /** @description Id of the owning workspace, app or community. */
806
+ scope_id: string;
807
+ /**
808
+ * @description What owns the endpoint: `workspace`, `app` or `community`.
809
+ * @example workspace
810
+ */
811
+ scope_type: string;
812
+ /**
813
+ * @description Last 4 characters of the signing secret.
814
+ * @example x9Q=
815
+ */
816
+ signing_secret_hint: string;
817
+ /**
818
+ * @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on.
819
+ * @enum {string}
820
+ */
821
+ status: "enabled" | "disabled" | "auto_disabled";
822
+ /** Format: date-time */
823
+ updated_at: string;
824
+ /**
825
+ * Format: uri
826
+ * @example https://api.acme.com/webhooks
827
+ */
250
828
  url: string;
251
- workspace_id: string;
252
829
  };
253
- };
254
- responses: never;
830
+ WebhookEndpointWithSecretDto: {
831
+ /** @description Failed automatic deliveries in a row; a success resets it. */
832
+ consecutive_failures: number;
833
+ /** Format: date-time */
834
+ created_at: string;
835
+ /** @example Production receiver */
836
+ description: string | null;
837
+ /** Format: date-time */
838
+ disabled_at: string | null;
839
+ /** @enum {string|null} */
840
+ disabled_reason: "manual" | "failing" | null;
841
+ /** @description The on/off switch (`PATCH … { enabled }`). */
842
+ enabled: boolean;
843
+ /**
844
+ * @description Subscribed event types. Empty means every event, including types added later.
845
+ * @example []
846
+ */
847
+ event_types: string[];
848
+ /**
849
+ * Format: date-time
850
+ * @description Start of the current failure streak.
851
+ */
852
+ first_failure_at: string | null;
853
+ /** Format: uuid */
854
+ id: string;
855
+ /** @description True for endpoints carried over from the product's previous webhook system: they also receive the old signature header until its sunset date. */
856
+ legacy_signature: boolean;
857
+ /** @description True while the previous secret still signs too (after a rotation, for its grace period). */
858
+ prev_signing_secret_active: boolean;
859
+ /**
860
+ * Format: date-time
861
+ * @description Until then the previous secret signs too (after a rotation).
862
+ */
863
+ prev_signing_secret_expires_at: string | null;
864
+ /** @description Id of the owning workspace, app or community. */
865
+ scope_id: string;
866
+ /**
867
+ * @description What owns the endpoint: `workspace`, `app` or `community`.
868
+ * @example workspace
869
+ */
870
+ scope_type: string;
871
+ /**
872
+ * @description The signing secret, shown once: pass it unchanged to any Standard Webhooks verifier. Store it now; it cannot be shown again.
873
+ * @example whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw
874
+ */
875
+ signing_secret: string;
876
+ /**
877
+ * @description Last 4 characters of the signing secret.
878
+ * @example x9Q=
879
+ */
880
+ signing_secret_hint: string;
881
+ /**
882
+ * @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on.
883
+ * @enum {string}
884
+ */
885
+ status: "enabled" | "disabled" | "auto_disabled";
886
+ /** Format: date-time */
887
+ updated_at: string;
888
+ /**
889
+ * Format: uri
890
+ * @example https://api.acme.com/webhooks
891
+ */
892
+ url: string;
893
+ };
894
+ WebhookEventDeliveryDto: {
895
+ /** @description Number of the latest attempt; retries and replays count up. */
896
+ attempt_number: number;
897
+ /** Format: date-time */
898
+ attempted_at: string;
899
+ /** Format: uuid */
900
+ endpoint_id: string;
901
+ /**
902
+ * Format: date-time
903
+ * @description When the next automatic attempt is due; null when none is queued.
904
+ */
905
+ next_attempt_at: string | null;
906
+ status_code: number | null;
907
+ /** @description True when the latest attempt got a 2xx. */
908
+ succeeded: boolean;
909
+ };
910
+ WebhookEventDetailDto: {
911
+ /** @description Every attempt, newest first. */
912
+ attempts: components["schemas"]["WebhookDeliveryAttemptDto"][];
913
+ /** Format: date-time */
914
+ created_at: string;
915
+ /** @description Latest attempt per endpoint (an endpoint whose first attempt is still queued is not listed yet). */
916
+ deliveries: components["schemas"]["WebhookEventDeliveryDto"][];
917
+ /**
918
+ * @description Sent as `webhook-id`; the same on every retry and replay.
919
+ * @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
920
+ */
921
+ id: string;
922
+ /** @description The JSON body exactly as sent. */
923
+ payload: {
924
+ [key: string]: unknown;
925
+ };
926
+ /**
927
+ * @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed.
928
+ * @enum {string}
929
+ */
930
+ status: "pending" | "delivered" | "failed" | "not_sent";
931
+ /** @description Made by "Send test". */
932
+ test: boolean;
933
+ /**
934
+ * @example job.succeeded
935
+ * @enum {string}
936
+ */
937
+ type: "job.succeeded" | "job.failed" | "credits.low";
938
+ };
939
+ WebhookEventDto: {
940
+ /** Format: date-time */
941
+ created_at: string;
942
+ /** @description Latest attempt per endpoint (an endpoint whose first attempt is still queued is not listed yet). */
943
+ deliveries: components["schemas"]["WebhookEventDeliveryDto"][];
944
+ /**
945
+ * @description Sent as `webhook-id`; the same on every retry and replay.
946
+ * @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
947
+ */
948
+ id: string;
949
+ /** @description The JSON body exactly as sent. */
950
+ payload: {
951
+ [key: string]: unknown;
952
+ };
953
+ /**
954
+ * @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed.
955
+ * @enum {string}
956
+ */
957
+ status: "pending" | "delivered" | "failed" | "not_sent";
958
+ /** @description Made by "Send test". */
959
+ test: boolean;
960
+ /**
961
+ * @example job.succeeded
962
+ * @enum {string}
963
+ */
964
+ type: "job.succeeded" | "job.failed" | "credits.low";
965
+ };
966
+ WebhookEventTypeDto: {
967
+ /**
968
+ * @description Group shown in the event picker.
969
+ * @example Users
970
+ */
971
+ category: string;
972
+ /** @example A user signed up or was created by an admin. */
973
+ description: string;
974
+ /** @description An example `data` object; "Send test" delivers exactly this. */
975
+ example: {
976
+ [key: string]: unknown;
977
+ };
978
+ /**
979
+ * @example job.succeeded
980
+ * @enum {string}
981
+ */
982
+ type: "job.succeeded" | "job.failed" | "credits.low";
983
+ };
984
+ WebhookListPaginationDto: {
985
+ has_more: boolean;
986
+ next_cursor: string | null;
987
+ };
988
+ WebhookListResponseDto: {
989
+ data: components["schemas"]["WebhookResponseDto"][];
990
+ pagination: components["schemas"]["WebhookListPaginationDto"];
991
+ };
992
+ WebhookPaginationDto: {
993
+ /** @description Whether another page follows. */
994
+ has_more: boolean;
995
+ /** @description Pass as `cursor` to get the next page; null on the last page. */
996
+ next_cursor: string | null;
997
+ };
998
+ WebhookResponseDto: {
999
+ /** @description Whether it receives events (`enabled` on the new routes). */
1000
+ active: boolean;
1001
+ /**
1002
+ * Format: date-time
1003
+ * @description Set when it was switched off automatically after sustained failures.
1004
+ */
1005
+ auto_disabled_at: string | null;
1006
+ /** Format: date-time */
1007
+ created_at: string;
1008
+ /** @description Failed deliveries in a row (`consecutive_failures` on the new routes). */
1009
+ failure_count: number;
1010
+ /** Format: date-time */
1011
+ first_failure_at: string | null;
1012
+ /** Format: uuid */
1013
+ id: string;
1014
+ /**
1015
+ * Format: date-time
1016
+ * @description When the latest attempt was made.
1017
+ */
1018
+ last_attempt_at: string | null;
1019
+ /** @description HTTP status of the latest attempt. */
1020
+ last_status_code: number | null;
1021
+ /** @description Always true: every webhook has a signing secret. */
1022
+ secret_set?: boolean;
1023
+ url: string;
1024
+ /** Format: uuid */
1025
+ workspace_id: string;
1026
+ };
1027
+ WebhookRotateSecretResponseDto: {
1028
+ /** Format: uuid */
1029
+ id: string;
1030
+ /** @description New plaintext signing secret, returned EXACTLY ONCE. Persist immediately; the old secret stops working at once. */
1031
+ secret: string;
1032
+ };
1033
+ WebhookTestAcceptedDto: {
1034
+ /** @example true */
1035
+ accepted: boolean;
1036
+ };
1037
+ };
1038
+ responses: never;
255
1039
  parameters: never;
256
1040
  requestBodies: never;
257
1041
  headers: never;
258
1042
  pathItems: never;
259
1043
  }
260
1044
  interface operations {
1045
+ CreditsController_get: {
1046
+ parameters: {
1047
+ query?: {
1048
+ /** @description How many recent entries to return. Defaults to 50, capped at 200. */
1049
+ limit?: number;
1050
+ };
1051
+ header?: never;
1052
+ path: {
1053
+ workspace_id: string;
1054
+ };
1055
+ cookie?: never;
1056
+ };
1057
+ requestBody?: never;
1058
+ responses: {
1059
+ /** @description Balance, low-balance state and recent entries. */
1060
+ 200: {
1061
+ headers: {
1062
+ [name: string]: unknown;
1063
+ };
1064
+ content: {
1065
+ "application/json": components["schemas"]["CreditsResponseDto"];
1066
+ };
1067
+ };
1068
+ /** @description Missing or invalid bearer token. */
1069
+ 401: {
1070
+ headers: {
1071
+ [name: string]: unknown;
1072
+ };
1073
+ content: {
1074
+ "application/json": components["schemas"]["ErrorResponseDto"];
1075
+ };
1076
+ };
1077
+ /** @description Caller lacks `trawl.read`, or the service is not enabled. */
1078
+ 403: {
1079
+ headers: {
1080
+ [name: string]: unknown;
1081
+ };
1082
+ content: {
1083
+ "application/json": components["schemas"]["ErrorResponseDto"];
1084
+ };
1085
+ };
1086
+ };
1087
+ };
261
1088
  JobController_list: {
262
1089
  parameters: {
263
1090
  query?: {
@@ -281,134 +1108,861 @@ interface operations {
281
1108
  [name: string]: unknown;
282
1109
  };
283
1110
  content: {
284
- "application/json": components["schemas"]["JobListResponseDto"];
1111
+ "application/json": components["schemas"]["JobListResponseDto"];
1112
+ };
1113
+ };
1114
+ /** @description Caller lacks `trawl.list`, or workspace has not enabled the `trawl` service. */
1115
+ 403: {
1116
+ headers: {
1117
+ [name: string]: unknown;
1118
+ };
1119
+ content: {
1120
+ "application/json": components["schemas"]["ErrorResponseDto"];
1121
+ };
1122
+ };
1123
+ };
1124
+ };
1125
+ JobController_create: {
1126
+ parameters: {
1127
+ query?: never;
1128
+ header?: {
1129
+ /** @description Pass a key (1..256 chars, [A-Za-z0-9_\-:]) to make retries safe — replays return the original response for 24h. */
1130
+ "Idempotency-Key"?: string;
1131
+ };
1132
+ path: {
1133
+ workspace_id: string;
1134
+ };
1135
+ cookie?: never;
1136
+ };
1137
+ requestBody: {
1138
+ content: {
1139
+ "application/json": components["schemas"]["CreateJobDto"];
1140
+ };
1141
+ };
1142
+ responses: {
1143
+ /** @description Job created and queued. */
1144
+ 201: {
1145
+ headers: {
1146
+ [name: string]: unknown;
1147
+ };
1148
+ content: {
1149
+ "application/json": components["schemas"]["JobResponseDto"];
1150
+ };
1151
+ };
1152
+ /** @description Invalid JSON Schema (must be a non-empty `type: object`). */
1153
+ 400: {
1154
+ headers: {
1155
+ [name: string]: unknown;
1156
+ };
1157
+ content: {
1158
+ "application/json": components["schemas"]["ErrorResponseDto"];
1159
+ };
1160
+ };
1161
+ /** @description Caller lacks `trawl.create`, or workspace has not enabled the `trawl` service. */
1162
+ 403: {
1163
+ headers: {
1164
+ [name: string]: unknown;
1165
+ };
1166
+ content: {
1167
+ "application/json": components["schemas"]["ErrorResponseDto"];
1168
+ };
1169
+ };
1170
+ /** @description Rate limited. `RATE_LIMITED` — submission window exceeded (default 10/min per workspace); the `Retry-After` header gives the seconds until the window resets. `TOO_MANY_ACTIVE_JOBS` — too many queued/running jobs (default 25); retry once some finish. */
1171
+ 429: {
1172
+ headers: {
1173
+ [name: string]: unknown;
1174
+ };
1175
+ content: {
1176
+ "application/json": components["schemas"]["ErrorResponseDto"];
1177
+ };
1178
+ };
1179
+ };
1180
+ };
1181
+ JobController_get: {
1182
+ parameters: {
1183
+ query?: never;
1184
+ header?: never;
1185
+ path: {
1186
+ workspace_id: string;
1187
+ id: string;
1188
+ };
1189
+ cookie?: never;
1190
+ };
1191
+ requestBody?: never;
1192
+ responses: {
1193
+ /** @description Job row. */
1194
+ 200: {
1195
+ headers: {
1196
+ [name: string]: unknown;
1197
+ };
1198
+ content: {
1199
+ "application/json": components["schemas"]["JobResponseDto"];
1200
+ };
1201
+ };
1202
+ /** @description Job not found in this workspace. */
1203
+ 404: {
1204
+ headers: {
1205
+ [name: string]: unknown;
1206
+ };
1207
+ content: {
1208
+ "application/json": components["schemas"]["ErrorResponseDto"];
1209
+ };
1210
+ };
1211
+ };
1212
+ };
1213
+ JobController_cancel: {
1214
+ parameters: {
1215
+ query?: never;
1216
+ header?: never;
1217
+ path: {
1218
+ workspace_id: string;
1219
+ id: string;
1220
+ };
1221
+ cookie?: never;
1222
+ };
1223
+ requestBody?: never;
1224
+ responses: {
1225
+ /** @description Job cancelled. */
1226
+ 200: {
1227
+ headers: {
1228
+ [name: string]: unknown;
1229
+ };
1230
+ content: {
1231
+ "application/json": components["schemas"]["JobResponseDto"];
1232
+ };
1233
+ };
1234
+ /** @description Job not found in this workspace. */
1235
+ 404: {
1236
+ headers: {
1237
+ [name: string]: unknown;
1238
+ };
1239
+ content: {
1240
+ "application/json": components["schemas"]["ErrorResponseDto"];
1241
+ };
1242
+ };
1243
+ /** @description Job is already in a terminal state and cannot be cancelled. */
1244
+ 422: {
1245
+ headers: {
1246
+ [name: string]: unknown;
1247
+ };
1248
+ content: {
1249
+ "application/json": components["schemas"]["ErrorResponseDto"];
1250
+ };
1251
+ };
1252
+ };
1253
+ };
1254
+ WorkspaceStatsController_get: {
1255
+ parameters: {
1256
+ query?: {
1257
+ /** @description Window for `in_window` and the length of `series`, in UTC days ending today. */
1258
+ window?: "1d" | "7d" | "30d";
1259
+ };
1260
+ header?: never;
1261
+ path: {
1262
+ /** @description Workspace id. */
1263
+ workspace_id: string;
1264
+ };
1265
+ cookie?: never;
1266
+ };
1267
+ requestBody?: never;
1268
+ responses: {
1269
+ /** @description Trawl stats. */
1270
+ 200: {
1271
+ headers: {
1272
+ [name: string]: unknown;
1273
+ };
1274
+ content: {
1275
+ "application/json": components["schemas"]["TrawlWorkspaceStatsDto"];
1276
+ };
1277
+ };
1278
+ /** @description `window` is not one of 1d, 7d, 30d. */
1279
+ 400: {
1280
+ headers: {
1281
+ [name: string]: unknown;
1282
+ };
1283
+ content: {
1284
+ "application/json": components["schemas"]["ErrorResponseDto"];
1285
+ };
1286
+ };
1287
+ /** @description Caller lacks `trawl.read` on the workspace, or Trawl is not enabled on it (`SERVICE_NOT_ENABLED`). */
1288
+ 403: {
1289
+ headers: {
1290
+ [name: string]: unknown;
1291
+ };
1292
+ content: {
1293
+ "application/json": components["schemas"]["ErrorResponseDto"];
1294
+ };
1295
+ };
1296
+ /** @description Workspace not found: the id is unknown, is not a UUID, or is not visible to the caller. Same answer as the service's other workspace routes. */
1297
+ 404: {
1298
+ headers: {
1299
+ [name: string]: unknown;
1300
+ };
1301
+ content: {
1302
+ "application/json": components["schemas"]["ErrorResponseDto"];
1303
+ };
1304
+ };
1305
+ };
1306
+ };
1307
+ WebhookController_list: {
1308
+ parameters: {
1309
+ query?: {
1310
+ /** @description Opaque cursor from the previous response's `pagination.next_cursor`. */
1311
+ cursor?: string;
1312
+ /** @description Page size. Defaults to 20, capped at 100. */
1313
+ limit?: number;
1314
+ };
1315
+ header?: never;
1316
+ path: {
1317
+ workspace_id: string;
1318
+ };
1319
+ cookie?: never;
1320
+ };
1321
+ requestBody?: never;
1322
+ responses: {
1323
+ /** @description Page of webhooks with a pagination cursor. */
1324
+ 200: {
1325
+ headers: {
1326
+ [name: string]: unknown;
1327
+ };
1328
+ content: {
1329
+ "application/json": components["schemas"]["WebhookListResponseDto"];
1330
+ };
1331
+ };
1332
+ /** @description Invalid cursor or limit. */
1333
+ 400: {
1334
+ headers: {
1335
+ [name: string]: unknown;
1336
+ };
1337
+ content: {
1338
+ "application/json": components["schemas"]["ErrorResponseDto"];
1339
+ };
1340
+ };
1341
+ };
1342
+ };
1343
+ WebhookController_create: {
1344
+ parameters: {
1345
+ query?: never;
1346
+ header?: {
1347
+ /** @description Stripe-style idempotency key. The signing secret is returned exactly once; a retry without this header creates a second webhook + secret. 24h TTL. */
1348
+ "Idempotency-Key"?: string;
1349
+ };
1350
+ path: {
1351
+ workspace_id: string;
1352
+ };
1353
+ cookie?: never;
1354
+ };
1355
+ requestBody: {
1356
+ content: {
1357
+ "application/json": components["schemas"]["CreateWebhookDto"];
1358
+ };
1359
+ };
1360
+ responses: {
1361
+ /** @description Webhook created. Includes plaintext `signing_secret` exactly once. */
1362
+ 201: {
1363
+ headers: {
1364
+ [name: string]: unknown;
1365
+ };
1366
+ content: {
1367
+ "application/json": components["schemas"]["WebhookCreateResponseDto"];
1368
+ };
1369
+ };
1370
+ /** @description Invalid URL (must be public HTTPS). */
1371
+ 400: {
1372
+ headers: {
1373
+ [name: string]: unknown;
1374
+ };
1375
+ content: {
1376
+ "application/json": components["schemas"]["ErrorResponseDto"];
1377
+ };
1378
+ };
1379
+ /** @description The workspace already has 10 webhooks. */
1380
+ 409: {
1381
+ headers: {
1382
+ [name: string]: unknown;
1383
+ };
1384
+ content: {
1385
+ "application/json": components["schemas"]["ErrorResponseDto"];
1386
+ };
1387
+ };
1388
+ };
1389
+ };
1390
+ WebhooksController_trawl_workspace_listEndpoints: {
1391
+ parameters: {
1392
+ query?: never;
1393
+ header?: never;
1394
+ path: {
1395
+ workspace_id: string;
1396
+ };
1397
+ cookie?: never;
1398
+ };
1399
+ requestBody?: never;
1400
+ responses: {
1401
+ 200: {
1402
+ headers: {
1403
+ [name: string]: unknown;
1404
+ };
1405
+ content: {
1406
+ "application/json": components["schemas"]["ListWebhookEndpointsResponseDto"];
1407
+ };
1408
+ };
1409
+ /** @description The scope id in the path is malformed. */
1410
+ 400: {
1411
+ headers: {
1412
+ [name: string]: unknown;
1413
+ };
1414
+ content: {
1415
+ "application/json": components["schemas"]["ErrorResponseDto"];
1416
+ };
1417
+ };
1418
+ /** @description Missing or invalid bearer token. */
1419
+ 401: {
1420
+ headers: {
1421
+ [name: string]: unknown;
1422
+ };
1423
+ content: {
1424
+ "application/json": components["schemas"]["ErrorResponseDto"];
1425
+ };
1426
+ };
1427
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1428
+ 403: {
1429
+ headers: {
1430
+ [name: string]: unknown;
1431
+ };
1432
+ content: {
1433
+ "application/json": components["schemas"]["ErrorResponseDto"];
1434
+ };
1435
+ };
1436
+ };
1437
+ };
1438
+ WebhooksController_trawl_workspace_createEndpoint: {
1439
+ parameters: {
1440
+ query?: never;
1441
+ header?: {
1442
+ /** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9_-:]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
1443
+ "Idempotency-Key"?: string;
1444
+ };
1445
+ path: {
1446
+ workspace_id: string;
1447
+ };
1448
+ cookie?: never;
1449
+ };
1450
+ requestBody: {
1451
+ content: {
1452
+ "application/json": components["schemas"]["CreateWebhookEndpointDto"];
1453
+ };
1454
+ };
1455
+ responses: {
1456
+ 201: {
1457
+ headers: {
1458
+ [name: string]: unknown;
1459
+ };
1460
+ content: {
1461
+ "application/json": components["schemas"]["WebhookEndpointWithSecretDto"];
1462
+ };
1463
+ };
1464
+ /** @description Validation failure: URL not https with a public host, or an unknown event type (`WEBHOOK_EVENT_TYPE_UNKNOWN`). */
1465
+ 400: {
1466
+ headers: {
1467
+ [name: string]: unknown;
1468
+ };
1469
+ content: {
1470
+ "application/json": components["schemas"]["ErrorResponseDto"];
1471
+ };
1472
+ };
1473
+ /** @description Missing or invalid bearer token. */
1474
+ 401: {
1475
+ headers: {
1476
+ [name: string]: unknown;
1477
+ };
1478
+ content: {
1479
+ "application/json": components["schemas"]["ErrorResponseDto"];
1480
+ };
1481
+ };
1482
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1483
+ 403: {
1484
+ headers: {
1485
+ [name: string]: unknown;
1486
+ };
1487
+ content: {
1488
+ "application/json": components["schemas"]["ErrorResponseDto"];
1489
+ };
1490
+ };
1491
+ /** @description Already 10 endpoints (`WEBHOOK_ENDPOINT_LIMIT`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
1492
+ 409: {
1493
+ headers: {
1494
+ [name: string]: unknown;
1495
+ };
1496
+ content: {
1497
+ "application/json": components["schemas"]["ErrorResponseDto"];
1498
+ };
1499
+ };
1500
+ /** @description The URL points at a private, loopback or internal address. */
1501
+ 422: {
1502
+ headers: {
1503
+ [name: string]: unknown;
1504
+ };
1505
+ content: {
1506
+ "application/json": components["schemas"]["ErrorResponseDto"];
1507
+ };
1508
+ };
1509
+ };
1510
+ };
1511
+ WebhooksController_trawl_workspace_getEndpoint: {
1512
+ parameters: {
1513
+ query?: never;
1514
+ header?: never;
1515
+ path: {
1516
+ workspace_id: string;
1517
+ endpoint_id: string;
1518
+ };
1519
+ cookie?: never;
1520
+ };
1521
+ requestBody?: never;
1522
+ responses: {
1523
+ 200: {
1524
+ headers: {
1525
+ [name: string]: unknown;
1526
+ };
1527
+ content: {
1528
+ "application/json": components["schemas"]["WebhookEndpointDto"];
1529
+ };
1530
+ };
1531
+ /** @description `endpoint_id` is not a UUID. */
1532
+ 400: {
1533
+ headers: {
1534
+ [name: string]: unknown;
1535
+ };
1536
+ content: {
1537
+ "application/json": components["schemas"]["ErrorResponseDto"];
1538
+ };
1539
+ };
1540
+ /** @description Missing or invalid bearer token. */
1541
+ 401: {
1542
+ headers: {
1543
+ [name: string]: unknown;
1544
+ };
1545
+ content: {
1546
+ "application/json": components["schemas"]["ErrorResponseDto"];
1547
+ };
1548
+ };
1549
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1550
+ 403: {
1551
+ headers: {
1552
+ [name: string]: unknown;
1553
+ };
1554
+ content: {
1555
+ "application/json": components["schemas"]["ErrorResponseDto"];
1556
+ };
1557
+ };
1558
+ /** @description No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`). */
1559
+ 404: {
1560
+ headers: {
1561
+ [name: string]: unknown;
1562
+ };
1563
+ content: {
1564
+ "application/json": components["schemas"]["ErrorResponseDto"];
1565
+ };
1566
+ };
1567
+ };
1568
+ };
1569
+ WebhooksController_trawl_workspace_deleteEndpoint: {
1570
+ parameters: {
1571
+ query?: never;
1572
+ header?: never;
1573
+ path: {
1574
+ workspace_id: string;
1575
+ endpoint_id: string;
1576
+ };
1577
+ cookie?: never;
1578
+ };
1579
+ requestBody?: never;
1580
+ responses: {
1581
+ /** @description Deleted. */
1582
+ 204: {
1583
+ headers: {
1584
+ [name: string]: unknown;
1585
+ };
1586
+ content?: never;
1587
+ };
1588
+ /** @description `endpoint_id` is not a UUID. */
1589
+ 400: {
1590
+ headers: {
1591
+ [name: string]: unknown;
1592
+ };
1593
+ content: {
1594
+ "application/json": components["schemas"]["ErrorResponseDto"];
1595
+ };
1596
+ };
1597
+ /** @description Missing or invalid bearer token. */
1598
+ 401: {
1599
+ headers: {
1600
+ [name: string]: unknown;
1601
+ };
1602
+ content: {
1603
+ "application/json": components["schemas"]["ErrorResponseDto"];
1604
+ };
1605
+ };
1606
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1607
+ 403: {
1608
+ headers: {
1609
+ [name: string]: unknown;
1610
+ };
1611
+ content: {
1612
+ "application/json": components["schemas"]["ErrorResponseDto"];
1613
+ };
1614
+ };
1615
+ /** @description No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`). */
1616
+ 404: {
1617
+ headers: {
1618
+ [name: string]: unknown;
1619
+ };
1620
+ content: {
1621
+ "application/json": components["schemas"]["ErrorResponseDto"];
1622
+ };
1623
+ };
1624
+ };
1625
+ };
1626
+ WebhooksController_trawl_workspace_updateEndpoint: {
1627
+ parameters: {
1628
+ query?: never;
1629
+ header?: {
1630
+ /** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9_-:]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
1631
+ "Idempotency-Key"?: string;
1632
+ };
1633
+ path: {
1634
+ workspace_id: string;
1635
+ endpoint_id: string;
1636
+ };
1637
+ cookie?: never;
1638
+ };
1639
+ requestBody: {
1640
+ content: {
1641
+ "application/json": components["schemas"]["UpdateWebhookEndpointDto"];
1642
+ };
1643
+ };
1644
+ responses: {
1645
+ 200: {
1646
+ headers: {
1647
+ [name: string]: unknown;
1648
+ };
1649
+ content: {
1650
+ "application/json": components["schemas"]["WebhookEndpointDto"];
1651
+ };
1652
+ };
1653
+ /** @description Validation failure, or `endpoint_id` is not a UUID. */
1654
+ 400: {
1655
+ headers: {
1656
+ [name: string]: unknown;
1657
+ };
1658
+ content: {
1659
+ "application/json": components["schemas"]["ErrorResponseDto"];
1660
+ };
1661
+ };
1662
+ /** @description Missing or invalid bearer token. */
1663
+ 401: {
1664
+ headers: {
1665
+ [name: string]: unknown;
1666
+ };
1667
+ content: {
1668
+ "application/json": components["schemas"]["ErrorResponseDto"];
1669
+ };
1670
+ };
1671
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1672
+ 403: {
1673
+ headers: {
1674
+ [name: string]: unknown;
1675
+ };
1676
+ content: {
1677
+ "application/json": components["schemas"]["ErrorResponseDto"];
1678
+ };
1679
+ };
1680
+ /** @description No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`). */
1681
+ 404: {
1682
+ headers: {
1683
+ [name: string]: unknown;
1684
+ };
1685
+ content: {
1686
+ "application/json": components["schemas"]["ErrorResponseDto"];
1687
+ };
1688
+ };
1689
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
1690
+ 409: {
1691
+ headers: {
1692
+ [name: string]: unknown;
1693
+ };
1694
+ content: {
1695
+ "application/json": components["schemas"]["ErrorResponseDto"];
1696
+ };
1697
+ };
1698
+ /** @description The new URL points at a private, loopback or internal address. */
1699
+ 422: {
1700
+ headers: {
1701
+ [name: string]: unknown;
1702
+ };
1703
+ content: {
1704
+ "application/json": components["schemas"]["ErrorResponseDto"];
1705
+ };
1706
+ };
1707
+ };
1708
+ };
1709
+ WebhooksController_trawl_workspace_rotateSecret: {
1710
+ parameters: {
1711
+ query?: never;
1712
+ header?: {
1713
+ /** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9_-:]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
1714
+ "Idempotency-Key"?: string;
1715
+ };
1716
+ path: {
1717
+ workspace_id: string;
1718
+ endpoint_id: string;
1719
+ };
1720
+ cookie?: never;
1721
+ };
1722
+ requestBody: {
1723
+ content: {
1724
+ "application/json": components["schemas"]["RotateWebhookSecretDto"];
1725
+ };
1726
+ };
1727
+ responses: {
1728
+ 200: {
1729
+ headers: {
1730
+ [name: string]: unknown;
1731
+ };
1732
+ content: {
1733
+ "application/json": components["schemas"]["WebhookEndpointWithSecretDto"];
1734
+ };
1735
+ };
1736
+ /** @description `grace_hours` out of range, or `endpoint_id` is not a UUID. */
1737
+ 400: {
1738
+ headers: {
1739
+ [name: string]: unknown;
1740
+ };
1741
+ content: {
1742
+ "application/json": components["schemas"]["ErrorResponseDto"];
1743
+ };
1744
+ };
1745
+ /** @description Missing or invalid bearer token. */
1746
+ 401: {
1747
+ headers: {
1748
+ [name: string]: unknown;
1749
+ };
1750
+ content: {
1751
+ "application/json": components["schemas"]["ErrorResponseDto"];
285
1752
  };
286
1753
  };
287
- /** @description Caller lacks `trawl.list`, or workspace has not enabled the `trawl` service. */
1754
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
288
1755
  403: {
289
1756
  headers: {
290
1757
  [name: string]: unknown;
291
1758
  };
292
- content?: never;
1759
+ content: {
1760
+ "application/json": components["schemas"]["ErrorResponseDto"];
1761
+ };
1762
+ };
1763
+ /** @description No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`). */
1764
+ 404: {
1765
+ headers: {
1766
+ [name: string]: unknown;
1767
+ };
1768
+ content: {
1769
+ "application/json": components["schemas"]["ErrorResponseDto"];
1770
+ };
1771
+ };
1772
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
1773
+ 409: {
1774
+ headers: {
1775
+ [name: string]: unknown;
1776
+ };
1777
+ content: {
1778
+ "application/json": components["schemas"]["ErrorResponseDto"];
1779
+ };
293
1780
  };
294
1781
  };
295
1782
  };
296
- JobController_create: {
1783
+ WebhooksController_trawl_workspace_sendTest: {
297
1784
  parameters: {
298
1785
  query?: never;
299
1786
  header?: {
300
- /** @description Pass a key (1..256 chars, [A-Za-z0-9_\-:]) to make retries safe — replays return the original response for 24h. */
1787
+ /** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9_-:]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
301
1788
  "Idempotency-Key"?: string;
302
1789
  };
303
1790
  path: {
304
1791
  workspace_id: string;
1792
+ endpoint_id: string;
305
1793
  };
306
1794
  cookie?: never;
307
1795
  };
308
1796
  requestBody: {
309
1797
  content: {
310
- "application/json": components["schemas"]["CreateJobDto"];
1798
+ "application/json": components["schemas"]["SendWebhookTestDto"];
311
1799
  };
312
1800
  };
313
1801
  responses: {
314
- /** @description Job created and queued. */
315
- 201: {
1802
+ /** @description The attempt, successful or not. */
1803
+ 200: {
316
1804
  headers: {
317
1805
  [name: string]: unknown;
318
1806
  };
319
1807
  content: {
320
- "application/json": components["schemas"]["JobResponseDto"];
1808
+ "application/json": components["schemas"]["WebhookDeliveryAttemptDto"];
321
1809
  };
322
1810
  };
323
- /** @description Invalid JSON Schema (must be a non-empty `type: object`). */
1811
+ /** @description Unknown `event_type`, or `endpoint_id` is not a UUID. */
324
1812
  400: {
325
1813
  headers: {
326
1814
  [name: string]: unknown;
327
1815
  };
328
- content?: never;
1816
+ content: {
1817
+ "application/json": components["schemas"]["ErrorResponseDto"];
1818
+ };
329
1819
  };
330
- /** @description Caller lacks `trawl.create`, or workspace has not enabled the `trawl` service. */
1820
+ /** @description Missing or invalid bearer token. */
1821
+ 401: {
1822
+ headers: {
1823
+ [name: string]: unknown;
1824
+ };
1825
+ content: {
1826
+ "application/json": components["schemas"]["ErrorResponseDto"];
1827
+ };
1828
+ };
1829
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
331
1830
  403: {
332
1831
  headers: {
333
1832
  [name: string]: unknown;
334
1833
  };
335
- content?: never;
1834
+ content: {
1835
+ "application/json": components["schemas"]["ErrorResponseDto"];
1836
+ };
1837
+ };
1838
+ /** @description No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`). */
1839
+ 404: {
1840
+ headers: {
1841
+ [name: string]: unknown;
1842
+ };
1843
+ content: {
1844
+ "application/json": components["schemas"]["ErrorResponseDto"];
1845
+ };
1846
+ };
1847
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
1848
+ 409: {
1849
+ headers: {
1850
+ [name: string]: unknown;
1851
+ };
1852
+ content: {
1853
+ "application/json": components["schemas"]["ErrorResponseDto"];
1854
+ };
336
1855
  };
337
1856
  };
338
1857
  };
339
- JobController_get: {
1858
+ WebhooksController_trawl_workspace_listEventTypes: {
340
1859
  parameters: {
341
1860
  query?: never;
342
1861
  header?: never;
343
1862
  path: {
344
1863
  workspace_id: string;
345
- id: string;
346
1864
  };
347
1865
  cookie?: never;
348
1866
  };
349
1867
  requestBody?: never;
350
1868
  responses: {
351
- /** @description Job row. */
352
1869
  200: {
353
1870
  headers: {
354
1871
  [name: string]: unknown;
355
1872
  };
356
1873
  content: {
357
- "application/json": components["schemas"]["JobResponseDto"];
1874
+ "application/json": components["schemas"]["ListWebhookEventTypesResponseDto"];
358
1875
  };
359
1876
  };
360
- /** @description Job not found in this workspace. */
361
- 404: {
1877
+ /** @description Missing or invalid bearer token. */
1878
+ 401: {
362
1879
  headers: {
363
1880
  [name: string]: unknown;
364
1881
  };
365
- content?: never;
1882
+ content: {
1883
+ "application/json": components["schemas"]["ErrorResponseDto"];
1884
+ };
1885
+ };
1886
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1887
+ 403: {
1888
+ headers: {
1889
+ [name: string]: unknown;
1890
+ };
1891
+ content: {
1892
+ "application/json": components["schemas"]["ErrorResponseDto"];
1893
+ };
366
1894
  };
367
1895
  };
368
1896
  };
369
- JobController_cancel: {
1897
+ WebhooksController_trawl_workspace_listEvents: {
370
1898
  parameters: {
371
- query?: never;
1899
+ query?: {
1900
+ /** @description Only these types. Repeat the parameter or comma-separate. */
1901
+ type?: ("job.succeeded" | "job.failed" | "credits.low")[];
1902
+ /** @description Only events sent (or queued) to this endpoint. */
1903
+ endpoint_id?: string;
1904
+ status?: "pending" | "delivered" | "failed" | "not_sent";
1905
+ /** @description Only events created at or after this instant. */
1906
+ created_after?: string;
1907
+ /** @description Only events created before this instant. */
1908
+ created_before?: string;
1909
+ limit?: number;
1910
+ /** @description The previous page's `pagination.next_cursor`. */
1911
+ cursor?: string;
1912
+ };
372
1913
  header?: never;
373
1914
  path: {
374
1915
  workspace_id: string;
375
- id: string;
376
1916
  };
377
1917
  cookie?: never;
378
1918
  };
379
1919
  requestBody?: never;
380
1920
  responses: {
381
- /** @description Job cancelled. */
382
1921
  200: {
383
1922
  headers: {
384
1923
  [name: string]: unknown;
385
1924
  };
386
1925
  content: {
387
- "application/json": components["schemas"]["JobResponseDto"];
1926
+ "application/json": components["schemas"]["ListWebhookEventsResponseDto"];
388
1927
  };
389
1928
  };
390
- /** @description Job not found in this workspace. */
391
- 404: {
1929
+ /** @description Invalid filter value or cursor. */
1930
+ 400: {
392
1931
  headers: {
393
1932
  [name: string]: unknown;
394
1933
  };
395
- content?: never;
1934
+ content: {
1935
+ "application/json": components["schemas"]["ErrorResponseDto"];
1936
+ };
396
1937
  };
397
- /** @description Job is already in a terminal state and cannot be cancelled. */
398
- 422: {
1938
+ /** @description Missing or invalid bearer token. */
1939
+ 401: {
399
1940
  headers: {
400
1941
  [name: string]: unknown;
401
1942
  };
402
- content?: never;
1943
+ content: {
1944
+ "application/json": components["schemas"]["ErrorResponseDto"];
1945
+ };
1946
+ };
1947
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1948
+ 403: {
1949
+ headers: {
1950
+ [name: string]: unknown;
1951
+ };
1952
+ content: {
1953
+ "application/json": components["schemas"]["ErrorResponseDto"];
1954
+ };
403
1955
  };
404
1956
  };
405
1957
  };
406
- WebhookController_list: {
1958
+ WebhooksController_trawl_workspace_getEvent: {
407
1959
  parameters: {
408
1960
  query?: never;
409
1961
  header?: never;
410
1962
  path: {
411
1963
  workspace_id: string;
1964
+ /** @description The event id, `evt_<uuid>`. */
1965
+ event_id: string;
412
1966
  };
413
1967
  cookie?: never;
414
1968
  };
@@ -419,36 +1973,117 @@ interface operations {
419
1973
  [name: string]: unknown;
420
1974
  };
421
1975
  content: {
422
- "application/json": components["schemas"]["WebhookListResponseDto"];
1976
+ "application/json": components["schemas"]["WebhookEventDetailDto"];
1977
+ };
1978
+ };
1979
+ /** @description `event_id` is not `evt_<uuid>`. */
1980
+ 400: {
1981
+ headers: {
1982
+ [name: string]: unknown;
1983
+ };
1984
+ content: {
1985
+ "application/json": components["schemas"]["ErrorResponseDto"];
1986
+ };
1987
+ };
1988
+ /** @description Missing or invalid bearer token. */
1989
+ 401: {
1990
+ headers: {
1991
+ [name: string]: unknown;
1992
+ };
1993
+ content: {
1994
+ "application/json": components["schemas"]["ErrorResponseDto"];
1995
+ };
1996
+ };
1997
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
1998
+ 403: {
1999
+ headers: {
2000
+ [name: string]: unknown;
2001
+ };
2002
+ content: {
2003
+ "application/json": components["schemas"]["ErrorResponseDto"];
2004
+ };
2005
+ };
2006
+ /** @description No such event here (`WEBHOOK_EVENT_NOT_FOUND`); events are kept for 30 days. */
2007
+ 404: {
2008
+ headers: {
2009
+ [name: string]: unknown;
2010
+ };
2011
+ content: {
2012
+ "application/json": components["schemas"]["ErrorResponseDto"];
423
2013
  };
424
2014
  };
425
2015
  };
426
2016
  };
427
- WebhookController_create: {
2017
+ WebhooksController_trawl_workspace_replay: {
428
2018
  parameters: {
429
- query?: never;
2019
+ query?: {
2020
+ /** @description Send to this endpoint only. */
2021
+ endpoint_id?: string;
2022
+ };
430
2023
  header?: {
431
- /** @description Stripe-style idempotency key. The signing secret is returned exactly once; a retry without this header creates a second webhook + secret. 24h TTL. */
2024
+ /** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9_-:]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
432
2025
  "Idempotency-Key"?: string;
433
2026
  };
434
2027
  path: {
435
2028
  workspace_id: string;
2029
+ /** @description The event id, `evt_<uuid>`. */
2030
+ event_id: string;
436
2031
  };
437
2032
  cookie?: never;
438
2033
  };
439
- requestBody: {
440
- content: {
441
- "application/json": components["schemas"]["CreateWebhookDto"];
442
- };
443
- };
2034
+ requestBody?: never;
444
2035
  responses: {
445
- /** @description Webhook created. Includes plaintext `signing_secret` exactly once. */
446
- 201: {
2036
+ 200: {
447
2037
  headers: {
448
2038
  [name: string]: unknown;
449
2039
  };
450
2040
  content: {
451
- "application/json": components["schemas"]["WebhookCreateResponseDto"];
2041
+ "application/json": components["schemas"]["ReplayWebhookEventResponseDto"];
2042
+ };
2043
+ };
2044
+ /** @description `event_id` is not `evt_<uuid>`, or `endpoint_id` is not a UUID. */
2045
+ 400: {
2046
+ headers: {
2047
+ [name: string]: unknown;
2048
+ };
2049
+ content: {
2050
+ "application/json": components["schemas"]["ErrorResponseDto"];
2051
+ };
2052
+ };
2053
+ /** @description Missing or invalid bearer token. */
2054
+ 401: {
2055
+ headers: {
2056
+ [name: string]: unknown;
2057
+ };
2058
+ content: {
2059
+ "application/json": components["schemas"]["ErrorResponseDto"];
2060
+ };
2061
+ };
2062
+ /** @description Caller lacks `trawl.webhook.read` (reads) or `trawl.webhook.manage` (changes, Send test, replay), or Trawl is not enabled for the workspace (`SERVICE_NOT_ENABLED`). */
2063
+ 403: {
2064
+ headers: {
2065
+ [name: string]: unknown;
2066
+ };
2067
+ content: {
2068
+ "application/json": components["schemas"]["ErrorResponseDto"];
2069
+ };
2070
+ };
2071
+ /** @description No such event here (`WEBHOOK_EVENT_NOT_FOUND`); events are kept for 30 days. Or No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`). */
2072
+ 404: {
2073
+ headers: {
2074
+ [name: string]: unknown;
2075
+ };
2076
+ content: {
2077
+ "application/json": components["schemas"]["ErrorResponseDto"];
2078
+ };
2079
+ };
2080
+ /** @description `endpoint_id` is switched off or does not receive this event type (`WEBHOOK_ENDPOINT_NOT_SUBSCRIBED`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
2081
+ 409: {
2082
+ headers: {
2083
+ [name: string]: unknown;
2084
+ };
2085
+ content: {
2086
+ "application/json": components["schemas"]["ErrorResponseDto"];
452
2087
  };
453
2088
  };
454
2089
  };
@@ -465,6 +2100,7 @@ interface operations {
465
2100
  };
466
2101
  requestBody?: never;
467
2102
  responses: {
2103
+ /** @description Webhook. */
468
2104
  200: {
469
2105
  headers: {
470
2106
  [name: string]: unknown;
@@ -473,12 +2109,23 @@ interface operations {
473
2109
  "application/json": components["schemas"]["WebhookResponseDto"];
474
2110
  };
475
2111
  };
2112
+ /** @description `id` is not a UUID. */
2113
+ 400: {
2114
+ headers: {
2115
+ [name: string]: unknown;
2116
+ };
2117
+ content: {
2118
+ "application/json": components["schemas"]["ErrorResponseDto"];
2119
+ };
2120
+ };
476
2121
  /** @description Webhook not found. */
477
2122
  404: {
478
2123
  headers: {
479
2124
  [name: string]: unknown;
480
2125
  };
481
- content?: never;
2126
+ content: {
2127
+ "application/json": components["schemas"]["ErrorResponseDto"];
2128
+ };
482
2129
  };
483
2130
  };
484
2131
  };
@@ -494,12 +2141,22 @@ interface operations {
494
2141
  };
495
2142
  requestBody?: never;
496
2143
  responses: {
2144
+ /** @description Deleted. */
497
2145
  204: {
498
2146
  headers: {
499
2147
  [name: string]: unknown;
500
2148
  };
501
2149
  content?: never;
502
2150
  };
2151
+ /** @description Webhook not found. */
2152
+ 404: {
2153
+ headers: {
2154
+ [name: string]: unknown;
2155
+ };
2156
+ content: {
2157
+ "application/json": components["schemas"]["ErrorResponseDto"];
2158
+ };
2159
+ };
503
2160
  };
504
2161
  };
505
2162
  WebhookController_update: {
@@ -518,6 +2175,7 @@ interface operations {
518
2175
  };
519
2176
  };
520
2177
  responses: {
2178
+ /** @description Updated webhook (secret masked). */
521
2179
  200: {
522
2180
  headers: {
523
2181
  [name: string]: unknown;
@@ -526,11 +2184,36 @@ interface operations {
526
2184
  "application/json": components["schemas"]["WebhookResponseDto"];
527
2185
  };
528
2186
  };
2187
+ /** @description Invalid URL. */
2188
+ 400: {
2189
+ headers: {
2190
+ [name: string]: unknown;
2191
+ };
2192
+ content: {
2193
+ "application/json": components["schemas"]["ErrorResponseDto"];
2194
+ };
2195
+ };
2196
+ /** @description Webhook not found. */
2197
+ 404: {
2198
+ headers: {
2199
+ [name: string]: unknown;
2200
+ };
2201
+ content: {
2202
+ "application/json": components["schemas"]["ErrorResponseDto"];
2203
+ };
2204
+ };
529
2205
  };
530
2206
  };
531
2207
  WebhookController_recentDeliveries: {
532
2208
  parameters: {
533
- query?: never;
2209
+ query?: {
2210
+ /** @description Filter by outcome. `succeeded` = 2xx response; `failed` = any non-2xx, including attempts where the destination never responded. */
2211
+ status?: "succeeded" | "failed";
2212
+ /** @description Opaque cursor from the previous response's `pagination.next_cursor`. */
2213
+ cursor?: string;
2214
+ /** @description Page size. Defaults to 50, capped at 200. */
2215
+ limit?: number;
2216
+ };
534
2217
  header?: never;
535
2218
  path: {
536
2219
  workspace_id: string;
@@ -540,12 +2223,32 @@ interface operations {
540
2223
  };
541
2224
  requestBody?: never;
542
2225
  responses: {
543
- /** @description Recent delivery attempts. */
2226
+ /** @description Page of delivery attempts with a pagination cursor. */
544
2227
  200: {
545
2228
  headers: {
546
2229
  [name: string]: unknown;
547
2230
  };
548
- content?: never;
2231
+ content: {
2232
+ "application/json": components["schemas"]["WebhookDeliveryListResponseDto"];
2233
+ };
2234
+ };
2235
+ /** @description Invalid cursor, limit or `status` filter. */
2236
+ 400: {
2237
+ headers: {
2238
+ [name: string]: unknown;
2239
+ };
2240
+ content: {
2241
+ "application/json": components["schemas"]["ErrorResponseDto"];
2242
+ };
2243
+ };
2244
+ /** @description Webhook not found in this workspace. */
2245
+ 404: {
2246
+ headers: {
2247
+ [name: string]: unknown;
2248
+ };
2249
+ content: {
2250
+ "application/json": components["schemas"]["ErrorResponseDto"];
2251
+ };
549
2252
  };
550
2253
  };
551
2254
  };
@@ -561,11 +2264,23 @@ interface operations {
561
2264
  };
562
2265
  requestBody?: never;
563
2266
  responses: {
2267
+ /** @description Secret rotated. Includes the new plaintext secret exactly once. */
564
2268
  201: {
565
2269
  headers: {
566
2270
  [name: string]: unknown;
567
2271
  };
568
- content?: never;
2272
+ content: {
2273
+ "application/json": components["schemas"]["WebhookRotateSecretResponseDto"];
2274
+ };
2275
+ };
2276
+ /** @description Webhook not found. */
2277
+ 404: {
2278
+ headers: {
2279
+ [name: string]: unknown;
2280
+ };
2281
+ content: {
2282
+ "application/json": components["schemas"]["ErrorResponseDto"];
2283
+ };
569
2284
  };
570
2285
  };
571
2286
  };
@@ -581,11 +2296,32 @@ interface operations {
581
2296
  };
582
2297
  requestBody?: never;
583
2298
  responses: {
2299
+ /** @description Sent. Read the outcome from `/deliveries`. */
584
2300
  202: {
585
2301
  headers: {
586
2302
  [name: string]: unknown;
587
2303
  };
588
- content?: never;
2304
+ content: {
2305
+ "application/json": components["schemas"]["WebhookTestAcceptedDto"];
2306
+ };
2307
+ };
2308
+ /** @description Webhook not found. */
2309
+ 404: {
2310
+ headers: {
2311
+ [name: string]: unknown;
2312
+ };
2313
+ content: {
2314
+ "application/json": components["schemas"]["ErrorResponseDto"];
2315
+ };
2316
+ };
2317
+ /** @description The webhook is switched off. */
2318
+ 422: {
2319
+ headers: {
2320
+ [name: string]: unknown;
2321
+ };
2322
+ content: {
2323
+ "application/json": components["schemas"]["ErrorResponseDto"];
2324
+ };
589
2325
  };
590
2326
  };
591
2327
  };