@trycourier/courier 8.0.0 → 9.1.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/client.d.mts +5 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/automations/automations.d.mts +82 -1
  10. package/resources/automations/automations.d.mts.map +1 -1
  11. package/resources/automations/automations.d.ts +82 -1
  12. package/resources/automations/automations.d.ts.map +1 -1
  13. package/resources/automations/automations.js +4 -0
  14. package/resources/automations/automations.js.map +1 -1
  15. package/resources/automations/automations.mjs +4 -0
  16. package/resources/automations/automations.mjs.map +1 -1
  17. package/resources/automations/index.d.mts +2 -1
  18. package/resources/automations/index.d.mts.map +1 -1
  19. package/resources/automations/index.d.ts +2 -1
  20. package/resources/automations/index.d.ts.map +1 -1
  21. package/resources/automations/index.js +3 -1
  22. package/resources/automations/index.js.map +1 -1
  23. package/resources/automations/index.mjs +1 -0
  24. package/resources/automations/index.mjs.map +1 -1
  25. package/resources/automations/runs.d.mts +69 -0
  26. package/resources/automations/runs.d.mts.map +1 -0
  27. package/resources/automations/runs.d.ts +69 -0
  28. package/resources/automations/runs.d.ts.map +1 -0
  29. package/resources/automations/runs.js +43 -0
  30. package/resources/automations/runs.js.map +1 -0
  31. package/resources/automations/runs.mjs +39 -0
  32. package/resources/automations/runs.mjs.map +1 -0
  33. package/resources/index.d.mts +2 -2
  34. package/resources/index.d.mts.map +1 -1
  35. package/resources/index.d.ts +2 -2
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js.map +1 -1
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/journeys/index.d.mts +2 -1
  40. package/resources/journeys/index.d.mts.map +1 -1
  41. package/resources/journeys/index.d.ts +2 -1
  42. package/resources/journeys/index.d.ts.map +1 -1
  43. package/resources/journeys/index.js +3 -1
  44. package/resources/journeys/index.js.map +1 -1
  45. package/resources/journeys/index.mjs +1 -0
  46. package/resources/journeys/index.mjs.map +1 -1
  47. package/resources/journeys/journeys.d.mts +183 -4
  48. package/resources/journeys/journeys.d.mts.map +1 -1
  49. package/resources/journeys/journeys.d.ts +183 -4
  50. package/resources/journeys/journeys.d.ts.map +1 -1
  51. package/resources/journeys/journeys.js +4 -0
  52. package/resources/journeys/journeys.js.map +1 -1
  53. package/resources/journeys/journeys.mjs +4 -0
  54. package/resources/journeys/journeys.mjs.map +1 -1
  55. package/resources/journeys/runs.d.mts +83 -0
  56. package/resources/journeys/runs.d.mts.map +1 -0
  57. package/resources/journeys/runs.d.ts +83 -0
  58. package/resources/journeys/runs.d.ts.map +1 -0
  59. package/resources/journeys/runs.js +59 -0
  60. package/resources/journeys/runs.js.map +1 -0
  61. package/resources/journeys/runs.mjs +55 -0
  62. package/resources/journeys/runs.mjs.map +1 -0
  63. package/resources/notifications/notifications.d.mts +0 -12
  64. package/resources/notifications/notifications.d.mts.map +1 -1
  65. package/resources/notifications/notifications.d.ts +0 -12
  66. package/resources/notifications/notifications.d.ts.map +1 -1
  67. package/resources/notifications/notifications.js +0 -14
  68. package/resources/notifications/notifications.js.map +1 -1
  69. package/resources/notifications/notifications.mjs +0 -14
  70. package/resources/notifications/notifications.mjs.map +1 -1
  71. package/resources/shared.d.mts +23 -2
  72. package/resources/shared.d.mts.map +1 -1
  73. package/resources/shared.d.ts +23 -2
  74. package/resources/shared.d.ts.map +1 -1
  75. package/resources/users/preferences.d.mts +12 -0
  76. package/resources/users/preferences.d.mts.map +1 -1
  77. package/resources/users/preferences.d.ts +12 -0
  78. package/resources/users/preferences.d.ts.map +1 -1
  79. package/src/client.ts +25 -0
  80. package/src/resources/automations/automations.ts +101 -0
  81. package/src/resources/automations/index.ts +5 -0
  82. package/src/resources/automations/runs.ts +87 -0
  83. package/src/resources/index.ts +12 -0
  84. package/src/resources/journeys/index.ts +9 -0
  85. package/src/resources/journeys/journeys.ts +226 -2
  86. package/src/resources/journeys/runs.ts +104 -0
  87. package/src/resources/notifications/notifications.ts +0 -15
  88. package/src/resources/shared.ts +24 -2
  89. package/src/resources/users/preferences.ts +14 -0
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
  94. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -119,6 +119,10 @@ import {
119
119
  import {
120
120
  AutomationInvokeResponse,
121
121
  AutomationListParams,
122
+ AutomationRunListItem,
123
+ AutomationRunListResponse,
124
+ AutomationRunStep,
125
+ AutomationRunStepsResponse,
122
126
  AutomationTemplate,
123
127
  AutomationTemplateListResponse,
124
128
  Automations,
@@ -136,6 +140,7 @@ import {
136
140
  Journey,
137
141
  JourneyAINode,
138
142
  JourneyAPIInvokeTriggerNode,
143
+ JourneyAudienceTriggerNode,
139
144
  JourneyCancelParams,
140
145
  JourneyConditionAtom,
141
146
  JourneyConditionGroup,
@@ -158,6 +163,12 @@ import {
158
163
  JourneyReplaceParams,
159
164
  JourneyResponse,
160
165
  JourneyRetrieveParams,
166
+ JourneyRun,
167
+ JourneyRunListItem,
168
+ JourneyRunListResponse,
169
+ JourneyRunResponse,
170
+ JourneyRunStep,
171
+ JourneyRunStepsResponse,
161
172
  JourneySegmentTriggerNode,
162
173
  JourneySendNode,
163
174
  JourneyState,
@@ -171,6 +182,7 @@ import {
171
182
  JourneyThrottleStaticNode,
172
183
  JourneyVersionItem,
173
184
  JourneyVersionsListResponse,
185
+ JourneyWebhookTriggerNode,
174
186
  Journeys,
175
187
  JourneysInvokeRequest,
176
188
  JourneysInvokeResponse,
@@ -1141,6 +1153,10 @@ export declare namespace Courier {
1141
1153
  export {
1142
1154
  Automations as Automations,
1143
1155
  type AutomationInvokeResponse as AutomationInvokeResponse,
1156
+ type AutomationRunListItem as AutomationRunListItem,
1157
+ type AutomationRunListResponse as AutomationRunListResponse,
1158
+ type AutomationRunStep as AutomationRunStep,
1159
+ type AutomationRunStepsResponse as AutomationRunStepsResponse,
1144
1160
  type AutomationTemplate as AutomationTemplate,
1145
1161
  type AutomationTemplateListResponse as AutomationTemplateListResponse,
1146
1162
  type AutomationListParams as AutomationListParams,
@@ -1154,6 +1170,7 @@ export declare namespace Courier {
1154
1170
  type Journey as Journey,
1155
1171
  type JourneyAINode as JourneyAINode,
1156
1172
  type JourneyAPIInvokeTriggerNode as JourneyAPIInvokeTriggerNode,
1173
+ type JourneyAudienceTriggerNode as JourneyAudienceTriggerNode,
1157
1174
  type JourneyConditionAtom as JourneyConditionAtom,
1158
1175
  type JourneyConditionGroup as JourneyConditionGroup,
1159
1176
  type JourneyConditionNestedGroup as JourneyConditionNestedGroup,
@@ -1169,6 +1186,12 @@ export declare namespace Courier {
1169
1186
  type JourneyNode as JourneyNode,
1170
1187
  type JourneyPublishRequest as JourneyPublishRequest,
1171
1188
  type JourneyResponse as JourneyResponse,
1189
+ type JourneyRun as JourneyRun,
1190
+ type JourneyRunListItem as JourneyRunListItem,
1191
+ type JourneyRunListResponse as JourneyRunListResponse,
1192
+ type JourneyRunResponse as JourneyRunResponse,
1193
+ type JourneyRunStep as JourneyRunStep,
1194
+ type JourneyRunStepsResponse as JourneyRunStepsResponse,
1172
1195
  type JourneySegmentTriggerNode as JourneySegmentTriggerNode,
1173
1196
  type JourneySendNode as JourneySendNode,
1174
1197
  type JourneyState as JourneyState,
@@ -1182,6 +1205,7 @@ export declare namespace Courier {
1182
1205
  type JourneyThrottleStaticNode as JourneyThrottleStaticNode,
1183
1206
  type JourneyVersionItem as JourneyVersionItem,
1184
1207
  type JourneyVersionsListResponse as JourneyVersionsListResponse,
1208
+ type JourneyWebhookTriggerNode as JourneyWebhookTriggerNode,
1185
1209
  type JourneysInvokeRequest as JourneysInvokeRequest,
1186
1210
  type JourneysInvokeResponse as JourneysInvokeResponse,
1187
1211
  type JourneysListResponse as JourneysListResponse,
@@ -1392,6 +1416,7 @@ export declare namespace Courier {
1392
1416
  export type AirshipProfile = API.AirshipProfile;
1393
1417
  export type AirshipProfileAudience = API.AirshipProfileAudience;
1394
1418
  export type Alignment = API.Alignment;
1419
+ export type Apn = API.Apn;
1395
1420
  export type AudienceFilter = API.AudienceFilter;
1396
1421
  export type AudienceFilterConfig = API.AudienceFilterConfig;
1397
1422
  export type AudienceRecipient = API.AudienceRecipient;
@@ -3,6 +3,8 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as InvokeAPI from './invoke';
5
5
  import { Invoke, InvokeInvokeAdHocParams, InvokeInvokeByTemplateParams } from './invoke';
6
+ import * as RunsAPI from './runs';
7
+ import { RunListParams, Runs } from './runs';
6
8
  import { APIPromise } from '../../core/api-promise';
7
9
  import { RequestOptions } from '../../internal/request-options';
8
10
 
@@ -11,6 +13,7 @@ import { RequestOptions } from '../../internal/request-options';
11
13
  */
12
14
  export class Automations extends APIResource {
13
15
  invoke: InvokeAPI.Invoke = new InvokeAPI.Invoke(this._client);
16
+ runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
14
17
 
15
18
  /**
16
19
  * Lists the workspace's saved automation templates, each with its id and a cursor
@@ -34,6 +37,97 @@ export interface AutomationInvokeResponse {
34
37
  runId: string;
35
38
  }
36
39
 
40
+ /**
41
+ * An Automation run as it appears in a list response.
42
+ */
43
+ export interface AutomationRunListItem {
44
+ /**
45
+ * A unique identifier representing the run.
46
+ */
47
+ run_id: string;
48
+
49
+ /**
50
+ * Internal provenance strings describing what started the run, e.g.
51
+ * `invoke/<template_id>` or `segment/page/Pricing Page`. Diagnostic only — the
52
+ * format is unstable and should not be parsed.
53
+ */
54
+ source: Array<string>;
55
+
56
+ /**
57
+ * When the run started, as an ISO 8601 timestamp.
58
+ */
59
+ created_at?: string;
60
+
61
+ /**
62
+ * The state of the run: `PROCESSING`, `PROCESSED`, `WAITING`, `CANCELED`, `ERROR`,
63
+ * `THROTTLED`, or `NOT PROCESSED`. Not an enum — new values have been added
64
+ * before.
65
+ */
66
+ status?: string;
67
+
68
+ /**
69
+ * The id of the Automation Template this run belongs to.
70
+ */
71
+ template_id?: string;
72
+ }
73
+
74
+ /**
75
+ * A page of Automation runs.
76
+ */
77
+ export interface AutomationRunListResponse {
78
+ runs: Array<AutomationRunListItem>;
79
+
80
+ /**
81
+ * Pass back as `cursor` to fetch the next page. Absent on the last page.
82
+ */
83
+ next_cursor?: string;
84
+ }
85
+
86
+ /**
87
+ * One executed step of an Automation run.
88
+ */
89
+ export interface AutomationRunStep {
90
+ /**
91
+ * The kind of step that ran, e.g. `send`, `delay`, or `update-profile`.
92
+ */
93
+ action: string;
94
+
95
+ /**
96
+ * The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
97
+ * Not an enum — new values have been added before.
98
+ */
99
+ status: string;
100
+
101
+ /**
102
+ * When the step started, as an ISO 8601 timestamp.
103
+ */
104
+ created_at?: string;
105
+
106
+ /**
107
+ * The message this step produced, present on send steps. Pass it to
108
+ * `GET /messages/{message_id}` for delivery status. A send to a List or an
109
+ * Audience yields one id for the request, not one per recipient.
110
+ */
111
+ message_id?: string;
112
+
113
+ /**
114
+ * A unique identifier representing the step.
115
+ */
116
+ step_id?: string;
117
+
118
+ /**
119
+ * When the step last changed state, as an ISO 8601 timestamp.
120
+ */
121
+ updated_at?: string;
122
+ }
123
+
124
+ /**
125
+ * Every step of an Automation run. Not paginated.
126
+ */
127
+ export interface AutomationRunStepsResponse {
128
+ steps: Array<AutomationRunStep>;
129
+ }
130
+
37
131
  export interface AutomationTemplate {
38
132
  /**
39
133
  * The unique identifier of the automation template.
@@ -85,10 +179,15 @@ export interface AutomationListParams {
85
179
  }
86
180
 
87
181
  Automations.Invoke = Invoke;
182
+ Automations.Runs = Runs;
88
183
 
89
184
  export declare namespace Automations {
90
185
  export {
91
186
  type AutomationInvokeResponse as AutomationInvokeResponse,
187
+ type AutomationRunListItem as AutomationRunListItem,
188
+ type AutomationRunListResponse as AutomationRunListResponse,
189
+ type AutomationRunStep as AutomationRunStep,
190
+ type AutomationRunStepsResponse as AutomationRunStepsResponse,
92
191
  type AutomationTemplate as AutomationTemplate,
93
192
  type AutomationTemplateListResponse as AutomationTemplateListResponse,
94
193
  type AutomationListParams as AutomationListParams,
@@ -99,4 +198,6 @@ export declare namespace Automations {
99
198
  type InvokeInvokeAdHocParams as InvokeInvokeAdHocParams,
100
199
  type InvokeInvokeByTemplateParams as InvokeInvokeByTemplateParams,
101
200
  };
201
+
202
+ export { Runs as Runs, type RunListParams as RunListParams };
102
203
  }
@@ -3,8 +3,13 @@
3
3
  export {
4
4
  Automations,
5
5
  type AutomationInvokeResponse,
6
+ type AutomationRunListItem,
7
+ type AutomationRunListResponse,
8
+ type AutomationRunStep,
9
+ type AutomationRunStepsResponse,
6
10
  type AutomationTemplate,
7
11
  type AutomationTemplateListResponse,
8
12
  type AutomationListParams,
9
13
  } from './automations';
10
14
  export { Invoke, type InvokeInvokeAdHocParams, type InvokeInvokeByTemplateParams } from './invoke';
15
+ export { Runs, type RunListParams } from './runs';
@@ -0,0 +1,87 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as AutomationsAPI from './automations';
5
+ import { APIPromise } from '../../core/api-promise';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ /**
10
+ * Invoke a stored automation template or an ad hoc automation defined in the request.
11
+ */
12
+ export class Runs extends APIResource {
13
+ /**
14
+ * List runs of the workspace's v2 Automations, newest first, filtered by status,
15
+ * Template, or date range and paged by cursor. Journey (v3) runs are listed by
16
+ * `GET /journeys/runs` instead — the two surfaces never return each other's runs.
17
+ * Runs are retained for 95 days.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const automationRunListResponse =
22
+ * await client.automations.runs.list();
23
+ * ```
24
+ */
25
+ list(
26
+ query: RunListParams | null | undefined = {},
27
+ options?: RequestOptions,
28
+ ): APIPromise<AutomationsAPI.AutomationRunListResponse> {
29
+ return this._client.get('/automations/runs', { query, ...options });
30
+ }
31
+
32
+ /**
33
+ * List the per-step state of one Automation run, in full — this endpoint is not
34
+ * paginated. `message_id` is present on send steps that produced a message; follow
35
+ * it to `GET /messages/{message_id}` for delivery status. A send to a List or an
36
+ * Audience yields one `message_id` for the request, not one per recipient.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const automationRunStepsResponse =
41
+ * await client.automations.runs.listSteps('x');
42
+ * ```
43
+ */
44
+ listSteps(id: string, options?: RequestOptions): APIPromise<AutomationsAPI.AutomationRunStepsResponse> {
45
+ return this._client.get(path`/automations/runs/${id}/steps`, options);
46
+ }
47
+ }
48
+
49
+ export interface RunListParams {
50
+ /**
51
+ * A cursor token for pagination. Use the `next_cursor` from the previous response
52
+ * to fetch the next page of results. Treat it as opaque.
53
+ */
54
+ cursor?: string;
55
+
56
+ /**
57
+ * An inclusive upper bound on `created_at`, in the same format as `start_date`.
58
+ */
59
+ end_date?: string;
60
+
61
+ /**
62
+ * The number of runs to return per page, between `1` and `50`. Defaults to `20`.
63
+ * Values outside the range are clamped, and a non-numeric value falls back to
64
+ * `20`.
65
+ */
66
+ limit?: string;
67
+
68
+ /**
69
+ * An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
70
+ * `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`.
71
+ */
72
+ start_date?: string;
73
+
74
+ /**
75
+ * A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
76
+ */
77
+ status?: string;
78
+
79
+ /**
80
+ * A comma-separated list of Automation Template ids to filter on.
81
+ */
82
+ template_id?: string;
83
+ }
84
+
85
+ export declare namespace Runs {
86
+ export { type RunListParams as RunListParams };
87
+ }
@@ -21,6 +21,10 @@ export { Auth, type AuthIssueTokenResponse, type AuthIssueTokenParams } from './
21
21
  export {
22
22
  Automations,
23
23
  type AutomationInvokeResponse,
24
+ type AutomationRunListItem,
25
+ type AutomationRunListResponse,
26
+ type AutomationRunStep,
27
+ type AutomationRunStepsResponse,
24
28
  type AutomationTemplate,
25
29
  type AutomationTemplateListResponse,
26
30
  type AutomationListParams,
@@ -89,6 +93,7 @@ export {
89
93
  type Journey,
90
94
  type JourneyAINode,
91
95
  type JourneyAPIInvokeTriggerNode,
96
+ type JourneyAudienceTriggerNode,
92
97
  type JourneyConditionAtom,
93
98
  type JourneyConditionGroup,
94
99
  type JourneyConditionNestedGroup,
@@ -104,6 +109,12 @@ export {
104
109
  type JourneyNode,
105
110
  type JourneyPublishRequest,
106
111
  type JourneyResponse,
112
+ type JourneyRun,
113
+ type JourneyRunListItem,
114
+ type JourneyRunListResponse,
115
+ type JourneyRunResponse,
116
+ type JourneyRunStep,
117
+ type JourneyRunStepsResponse,
107
118
  type JourneySegmentTriggerNode,
108
119
  type JourneySendNode,
109
120
  type JourneyState,
@@ -117,6 +128,7 @@ export {
117
128
  type JourneyThrottleStaticNode,
118
129
  type JourneyVersionItem,
119
130
  type JourneyVersionsListResponse,
131
+ type JourneyWebhookTriggerNode,
120
132
  type JourneysInvokeRequest,
121
133
  type JourneysInvokeResponse,
122
134
  type JourneysListResponse,
@@ -8,6 +8,7 @@ export {
8
8
  type Journey,
9
9
  type JourneyAINode,
10
10
  type JourneyAPIInvokeTriggerNode,
11
+ type JourneyAudienceTriggerNode,
11
12
  type JourneyConditionAtom,
12
13
  type JourneyConditionGroup,
13
14
  type JourneyConditionNestedGroup,
@@ -23,6 +24,12 @@ export {
23
24
  type JourneyNode,
24
25
  type JourneyPublishRequest,
25
26
  type JourneyResponse,
27
+ type JourneyRun,
28
+ type JourneyRunListItem,
29
+ type JourneyRunListResponse,
30
+ type JourneyRunResponse,
31
+ type JourneyRunStep,
32
+ type JourneyRunStepsResponse,
26
33
  type JourneySegmentTriggerNode,
27
34
  type JourneySendNode,
28
35
  type JourneyState,
@@ -36,6 +43,7 @@ export {
36
43
  type JourneyThrottleStaticNode,
37
44
  type JourneyVersionItem,
38
45
  type JourneyVersionsListResponse,
46
+ type JourneyWebhookTriggerNode,
39
47
  type JourneysInvokeRequest,
40
48
  type JourneysInvokeResponse,
41
49
  type JourneysListResponse,
@@ -47,6 +55,7 @@ export {
47
55
  type JourneyPublishParams,
48
56
  type JourneyReplaceParams,
49
57
  } from './journeys';
58
+ export { Runs, type RunListParams } from './runs';
50
59
  export {
51
60
  Templates,
52
61
  type TemplateCreateParams,
@@ -3,6 +3,8 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as JourneysAPI from './journeys';
5
5
  import * as Shared from '../shared';
6
+ import * as RunsAPI from './runs';
7
+ import { RunListParams, Runs } from './runs';
6
8
  import * as TemplatesAPI from './templates';
7
9
  import {
8
10
  TemplateArchiveParams,
@@ -27,6 +29,7 @@ import { path } from '../../internal/utils/path';
27
29
  */
28
30
  export class Journeys extends APIResource {
29
31
  templates: TemplatesAPI.Templates = new TemplatesAPI.Templates(this._client);
32
+ runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
30
33
 
31
34
  /**
32
35
  * Creates a journey from a set of nodes, in draft state unless you pass a
@@ -409,6 +412,34 @@ export interface JourneyAPIInvokeTriggerNode {
409
412
  schema?: { [key: string]: unknown };
410
413
  }
411
414
 
415
+ /**
416
+ * Trigger fired when a user newly matches an Audience. Leaving and re-joining the
417
+ * Audience re-enters the Journey. Membership is new-members-only: users already in
418
+ * the Audience when the Journey is published do not enter. Unlike the v2
419
+ * Automations audience trigger, there is no member scope, event type, or frequency
420
+ * mode to configure, and `audience_id` must name one Audience — wildcards are not
421
+ * supported.
422
+ */
423
+ export interface JourneyAudienceTriggerNode {
424
+ /**
425
+ * The Audience to watch. Must name a single Audience; wildcards are not supported.
426
+ */
427
+ audience_id: string;
428
+
429
+ trigger_type: 'audience';
430
+
431
+ type: 'trigger';
432
+
433
+ id?: string;
434
+
435
+ /**
436
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
437
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
438
+ * express "no conditions".
439
+ */
440
+ conditions?: JourneyConditionsField;
441
+ }
442
+
412
443
  /**
413
444
  * A single condition expressed as a positional tuple of strings.
414
445
  *
@@ -650,6 +681,8 @@ export type JourneyMergeStrategy = 'overwrite' | 'soft-merge' | 'replace' | 'non
650
681
  export type JourneyNode =
651
682
  | JourneyAPIInvokeTriggerNode
652
683
  | JourneySegmentTriggerNode
684
+ | JourneyAudienceTriggerNode
685
+ | JourneyWebhookTriggerNode
653
686
  | JourneySendNode
654
687
  | JourneyDelayDurationNode
655
688
  | JourneyDelayUntilNode
@@ -829,10 +862,157 @@ export interface JourneyResponse {
829
862
  }
830
863
 
831
864
  /**
832
- * Trigger fired by a segment event (`identify`, `group`, or `track`).
865
+ * One run of a Journey. `status` and `created_at` are absent on a small number of
866
+ * legacy runs stored without them.
867
+ */
868
+ export interface JourneyRun {
869
+ /**
870
+ * A unique identifier representing the run.
871
+ */
872
+ run_id: string;
873
+
874
+ /**
875
+ * Internal provenance strings describing what started the run, e.g.
876
+ * `invoke/<journey_id>` or `segment/page/Pricing Page`. Diagnostic only — the
877
+ * format is unstable and should not be parsed.
878
+ */
879
+ source: Array<string>;
880
+
881
+ /**
882
+ * When the run started, as an ISO 8601 timestamp.
883
+ */
884
+ created_at?: string;
885
+
886
+ /**
887
+ * The state of the run: `PROCESSING`, `PROCESSED`, `WAITING`, `CANCELED`, `ERROR`,
888
+ * `THROTTLED`, or `NOT PROCESSED`. Not an enum — new values have been added
889
+ * before.
890
+ */
891
+ status?: string;
892
+
893
+ /**
894
+ * The id of the Journey this run belongs to.
895
+ */
896
+ template_id?: string;
897
+
898
+ /**
899
+ * When the run last changed state, as an ISO 8601 timestamp.
900
+ */
901
+ updated_at?: string;
902
+ }
903
+
904
+ /**
905
+ * A Journey run as it appears in a list response, without `updated_at`.
906
+ */
907
+ export interface JourneyRunListItem {
908
+ /**
909
+ * A unique identifier representing the run.
910
+ */
911
+ run_id: string;
912
+
913
+ /**
914
+ * Internal provenance strings describing what started the run. Diagnostic only.
915
+ */
916
+ source: Array<string>;
917
+
918
+ /**
919
+ * When the run started, as an ISO 8601 timestamp.
920
+ */
921
+ created_at?: string;
922
+
923
+ /**
924
+ * The state of the run. See `JourneyRun.status` for the values it takes.
925
+ */
926
+ status?: string;
927
+
928
+ /**
929
+ * The id of the Journey this run belongs to.
930
+ */
931
+ template_id?: string;
932
+ }
933
+
934
+ /**
935
+ * A page of Journey runs.
936
+ */
937
+ export interface JourneyRunListResponse {
938
+ runs: Array<JourneyRunListItem>;
939
+
940
+ /**
941
+ * Pass back as `cursor` to fetch the next page. Absent on the last page.
942
+ */
943
+ next_cursor?: string;
944
+
945
+ /**
946
+ * Pass back as `cursor` to fetch the previous page. Absent on the first page.
947
+ */
948
+ prev_cursor?: string;
949
+ }
950
+
951
+ /**
952
+ * A single Journey run.
953
+ */
954
+ export interface JourneyRunResponse {
955
+ /**
956
+ * One run of a Journey. `status` and `created_at` are absent on a small number of
957
+ * legacy runs stored without them.
958
+ */
959
+ run: JourneyRun;
960
+ }
961
+
962
+ /**
963
+ * One executed node of a Journey run. `node_id` is the id of the node in the
964
+ * published Journey, so a step maps directly onto the Journey graph.
965
+ */
966
+ export interface JourneyRunStep {
967
+ /**
968
+ * The kind of node that ran, e.g. `send`, `delay`, or `exit`.
969
+ */
970
+ action: string;
971
+
972
+ /**
973
+ * The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
974
+ * Not an enum — new values have been added before.
975
+ */
976
+ status: string;
977
+
978
+ /**
979
+ * When the step started, as an ISO 8601 timestamp.
980
+ */
981
+ created_at?: string;
982
+
983
+ /**
984
+ * The message this step produced, present on send steps. Pass it to
985
+ * `GET /messages/{message_id}` for delivery status. A send to a List or an
986
+ * Audience yields one id for the request, not one per recipient.
987
+ */
988
+ message_id?: string;
989
+
990
+ /**
991
+ * The id of the node in the published Journey that this step executed.
992
+ */
993
+ node_id?: string;
994
+
995
+ /**
996
+ * When the step last changed state, as an ISO 8601 timestamp.
997
+ */
998
+ updated_at?: string;
999
+ }
1000
+
1001
+ /**
1002
+ * Every step of a Journey run. Not paginated.
1003
+ */
1004
+ export interface JourneyRunStepsResponse {
1005
+ steps: Array<JourneyRunStep>;
1006
+ }
1007
+
1008
+ /**
1009
+ * Trigger fired by a segment event (`identify`, `group`, `track`, or `page`). A
1010
+ * trigger with no `event_id` fires on any event of its type — the only shape
1011
+ * `identify` and `group` can take, and the one that catches a stock
1012
+ * `analytics.page()` call.
833
1013
  */
834
1014
  export interface JourneySegmentTriggerNode {
835
- request_type: 'identify' | 'group' | 'track';
1015
+ request_type: 'identify' | 'group' | 'track' | 'page';
836
1016
 
837
1017
  trigger_type: 'segment';
838
1018
 
@@ -1181,6 +1361,39 @@ export interface JourneyVersionsListResponse {
1181
1361
  results: Array<JourneyVersionItem>;
1182
1362
  }
1183
1363
 
1364
+ /**
1365
+ * Trigger fired when an external system POSTs to the webhook URL minted for
1366
+ * `event_source`. Narrow it to one event with `event_id`, or omit `event_id` to
1367
+ * accept every event delivered to the URL.
1368
+ */
1369
+ export interface JourneyWebhookTriggerNode {
1370
+ /**
1371
+ * The provider key the webhook URL is minted for. Required, and must not contain a
1372
+ * forward slash.
1373
+ */
1374
+ event_source: string;
1375
+
1376
+ trigger_type: 'webhook';
1377
+
1378
+ type: 'trigger';
1379
+
1380
+ id?: string;
1381
+
1382
+ /**
1383
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
1384
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
1385
+ * express "no conditions".
1386
+ */
1387
+ conditions?: JourneyConditionsField;
1388
+
1389
+ /**
1390
+ * An optional event filter, matched against the payload's `event` field. A sender
1391
+ * that supplies no `event` matches the literal `custom`. Must not contain a
1392
+ * forward slash. Omit to accept every event delivered to the URL.
1393
+ */
1394
+ event_id?: string;
1395
+ }
1396
+
1184
1397
  /**
1185
1398
  * Request body for invoking a journey. Requires either a user identifier or a
1186
1399
  * profile with contact information. User identifiers can be provided via user_id
@@ -1427,6 +1640,7 @@ export interface JourneyReplaceParams {
1427
1640
  }
1428
1641
 
1429
1642
  Journeys.Templates = Templates;
1643
+ Journeys.Runs = Runs;
1430
1644
 
1431
1645
  export declare namespace Journeys {
1432
1646
  export {
@@ -1436,6 +1650,7 @@ export declare namespace Journeys {
1436
1650
  type Journey as Journey,
1437
1651
  type JourneyAINode as JourneyAINode,
1438
1652
  type JourneyAPIInvokeTriggerNode as JourneyAPIInvokeTriggerNode,
1653
+ type JourneyAudienceTriggerNode as JourneyAudienceTriggerNode,
1439
1654
  type JourneyConditionAtom as JourneyConditionAtom,
1440
1655
  type JourneyConditionGroup as JourneyConditionGroup,
1441
1656
  type JourneyConditionNestedGroup as JourneyConditionNestedGroup,
@@ -1451,6 +1666,12 @@ export declare namespace Journeys {
1451
1666
  type JourneyNode as JourneyNode,
1452
1667
  type JourneyPublishRequest as JourneyPublishRequest,
1453
1668
  type JourneyResponse as JourneyResponse,
1669
+ type JourneyRun as JourneyRun,
1670
+ type JourneyRunListItem as JourneyRunListItem,
1671
+ type JourneyRunListResponse as JourneyRunListResponse,
1672
+ type JourneyRunResponse as JourneyRunResponse,
1673
+ type JourneyRunStep as JourneyRunStep,
1674
+ type JourneyRunStepsResponse as JourneyRunStepsResponse,
1454
1675
  type JourneySegmentTriggerNode as JourneySegmentTriggerNode,
1455
1676
  type JourneySendNode as JourneySendNode,
1456
1677
  type JourneyState as JourneyState,
@@ -1464,6 +1685,7 @@ export declare namespace Journeys {
1464
1685
  type JourneyThrottleStaticNode as JourneyThrottleStaticNode,
1465
1686
  type JourneyVersionItem as JourneyVersionItem,
1466
1687
  type JourneyVersionsListResponse as JourneyVersionsListResponse,
1688
+ type JourneyWebhookTriggerNode as JourneyWebhookTriggerNode,
1467
1689
  type JourneysInvokeRequest as JourneysInvokeRequest,
1468
1690
  type JourneysInvokeResponse as JourneysInvokeResponse,
1469
1691
  type JourneysListResponse as JourneysListResponse,
@@ -1489,4 +1711,6 @@ export declare namespace Journeys {
1489
1711
  type TemplateReplaceParams as TemplateReplaceParams,
1490
1712
  type TemplateRetrieveContentParams as TemplateRetrieveContentParams,
1491
1713
  };
1714
+
1715
+ export { Runs as Runs, type RunListParams as RunListParams };
1492
1716
  }