@open-send/sdk 0.0.0-stage → 1.0.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.
- package/LICENSE +22 -0
- package/README.md +143 -2
- package/dist/index.cjs +1793 -0
- package/dist/index.d.cts +4303 -0
- package/dist/index.d.mts +4303 -0
- package/dist/index.mjs +1751 -0
- package/package.json +48 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,4303 @@
|
|
|
1
|
+
type EmailsSendOutputEvents = {
|
|
2
|
+
/** What happened: the status the email moved to. */
|
|
3
|
+
type: "queued" | "sent" | "delivered" | "delayed" | "bounced" | "opened" | "clicked" | "complained" | "failed" | "scheduled" | "canceled";
|
|
4
|
+
/** When it happened. */
|
|
5
|
+
at: string;
|
|
6
|
+
/** More about it, such as the reason for a bounce. Often empty. */
|
|
7
|
+
detail: string;
|
|
8
|
+
};
|
|
9
|
+
type AudiencesCreateOutput = {
|
|
10
|
+
object: "audience";
|
|
11
|
+
/** The id of the audience. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** The name of the audience. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** How many contacts are in it. */
|
|
16
|
+
contacts: number;
|
|
17
|
+
/** How many of them are subscribed. */
|
|
18
|
+
subscribed: number;
|
|
19
|
+
/** How many of them have unsubscribed. */
|
|
20
|
+
unsubscribed: number;
|
|
21
|
+
/** When the audience was made. */
|
|
22
|
+
createdAt: string;
|
|
23
|
+
};
|
|
24
|
+
type WorkspaceGetOutputServices = {
|
|
25
|
+
/** The part: `api`, `sending`, `receiving`, `webhooks`, `payments`, `assistant` or `images`, the storage that keeps copies of your images. */
|
|
26
|
+
id: "api" | "sending" | "receiving" | "webhooks" | "payments" | "assistant" | "images";
|
|
27
|
+
/** `ok` when it works, `off` when it is not connected, `degraded` or `down` when it fails. */
|
|
28
|
+
state: "ok" | "off" | "degraded" | "down";
|
|
29
|
+
};
|
|
30
|
+
type WorkspaceGetOutputUnsubscribePage = {
|
|
31
|
+
/** The heading of the unsubscribe page. */
|
|
32
|
+
title: string;
|
|
33
|
+
/** The sentence under the heading. */
|
|
34
|
+
message: string;
|
|
35
|
+
/** The words on the button. */
|
|
36
|
+
button: string;
|
|
37
|
+
/** The colour of the button, as a hex colour such as `#111111`. */
|
|
38
|
+
accent: string;
|
|
39
|
+
/** Whether the page asks why the person is leaving. */
|
|
40
|
+
askReason: boolean;
|
|
41
|
+
/** Whether the page shows your logo. */
|
|
42
|
+
showLogo: boolean;
|
|
43
|
+
};
|
|
44
|
+
type ContactPropertiesCreateOutput = {
|
|
45
|
+
object: "contact_property";
|
|
46
|
+
/** The id of the property. */
|
|
47
|
+
id: string;
|
|
48
|
+
/** The name contacts hold a value under, and the name of its `{{slot}}`. */
|
|
49
|
+
key: string;
|
|
50
|
+
/** What its values are: `string`, `number` or `boolean`. */
|
|
51
|
+
type: "string" | "number" | "boolean";
|
|
52
|
+
/** What fills its slot for a contact with no value, or `null`. */
|
|
53
|
+
fallback: string | number | boolean | null;
|
|
54
|
+
/** When the property was made. */
|
|
55
|
+
createdAt: string;
|
|
56
|
+
};
|
|
57
|
+
type WorkspaceGetOutputViewer = {
|
|
58
|
+
/** The name of the person, or of the API key. */
|
|
59
|
+
name: string;
|
|
60
|
+
/** The address of the person. Empty for an API key. */
|
|
61
|
+
email: string;
|
|
62
|
+
/** The address of their picture, or `null`. */
|
|
63
|
+
image: string | null;
|
|
64
|
+
/** How the request was signed: `session` for a signed-in person, `key` for an API key. */
|
|
65
|
+
kind: "session" | "key" | "demo";
|
|
66
|
+
/** Their role in the workspace, or `null` for an API key. */
|
|
67
|
+
role: "owner" | "admin" | "member" | "viewer" | null;
|
|
68
|
+
};
|
|
69
|
+
type SuppressionsCreateOutput = {
|
|
70
|
+
object: "suppression";
|
|
71
|
+
/** The id of the entry. */
|
|
72
|
+
id: string;
|
|
73
|
+
/** The address that is not sent to. */
|
|
74
|
+
email: string;
|
|
75
|
+
/** Why it is on the list: `bounce`, `complaint` or `manual` when you put it there. */
|
|
76
|
+
reason: "bounce" | "complaint" | "manual";
|
|
77
|
+
/** More about the reason, or `null`. */
|
|
78
|
+
detail: string | null;
|
|
79
|
+
/** Whether the entry can be removed. An address that complained cannot. */
|
|
80
|
+
removable: boolean;
|
|
81
|
+
/** When the address was put on the list. */
|
|
82
|
+
createdAt: string;
|
|
83
|
+
};
|
|
84
|
+
type AutomationsCreateOutputStats = {
|
|
85
|
+
/** How many runs have started. */
|
|
86
|
+
entered: number;
|
|
87
|
+
/** How many runs are going on now. */
|
|
88
|
+
active: number;
|
|
89
|
+
/** How many runs reached the end of their path. */
|
|
90
|
+
completed: number;
|
|
91
|
+
/** How many runs left early. */
|
|
92
|
+
exited: number;
|
|
93
|
+
/** How many runs ended on a step that failed. */
|
|
94
|
+
failed: number;
|
|
95
|
+
/** How many runs were cancelled. */
|
|
96
|
+
canceled: number;
|
|
97
|
+
/** How many emails its runs sent. */
|
|
98
|
+
sent: number;
|
|
99
|
+
/** When a run last started, or `null`. */
|
|
100
|
+
lastRunAt: string | null;
|
|
101
|
+
};
|
|
102
|
+
type AutomationsCreateOutputProblems = {
|
|
103
|
+
/** What kind of problem it is: `missing`, `invalid`, `unknown_step`, `unreachable`, `loop` or `empty`. */
|
|
104
|
+
code: "missing" | "invalid" | "unknown_step" | "unreachable" | "loop" | "empty";
|
|
105
|
+
/** The id of the step it is about, or `null` for the trigger and the settings. */
|
|
106
|
+
step: string | null;
|
|
107
|
+
/** The field it is about, such as `subject` or `trigger.event`. */
|
|
108
|
+
field: string;
|
|
109
|
+
/** The problem in words. */
|
|
110
|
+
message: string;
|
|
111
|
+
/** `true` when it has to be fixed before the automation can be published. */
|
|
112
|
+
blocking: boolean;
|
|
113
|
+
};
|
|
114
|
+
type EventsCreateOutput = {
|
|
115
|
+
object: "event";
|
|
116
|
+
/** The id of the event. */
|
|
117
|
+
id: string;
|
|
118
|
+
/** The name of the event, such as `order.paid`. */
|
|
119
|
+
name: string;
|
|
120
|
+
/** The type of each value its data has to carry: `string`, `number`, `boolean` or `date`. `null` takes any data. */
|
|
121
|
+
schema: {
|
|
122
|
+
[key: string]: "string" | "number" | "boolean" | "date";
|
|
123
|
+
} | null;
|
|
124
|
+
/** How many times it has been sent. */
|
|
125
|
+
received: number;
|
|
126
|
+
/** When it was last sent, or `null`. */
|
|
127
|
+
lastReceivedAt: string | null;
|
|
128
|
+
/** When the event was first defined or sent. */
|
|
129
|
+
createdAt: string;
|
|
130
|
+
};
|
|
131
|
+
type DomainsCreateOutputRecords = {
|
|
132
|
+
/** The id of the record. */
|
|
133
|
+
id: string;
|
|
134
|
+
/** The type of DNS record: `MX`, `TXT` or `CNAME`. */
|
|
135
|
+
type: "MX" | "TXT" | "CNAME";
|
|
136
|
+
/** The name to publish the record under. */
|
|
137
|
+
host: string;
|
|
138
|
+
/** What the record has to hold. */
|
|
139
|
+
value: string;
|
|
140
|
+
/** The priority of an `MX` record, and `null` for the other types. */
|
|
141
|
+
priority: number | null;
|
|
142
|
+
/** How long resolvers may keep the record, as your DNS provider writes it. */
|
|
143
|
+
ttl: string;
|
|
144
|
+
/** Whether the record was found: `pending`, `verified` or `failed`. */
|
|
145
|
+
status: "pending" | "verified" | "failed";
|
|
146
|
+
};
|
|
147
|
+
type EventsSendOutput = {
|
|
148
|
+
object: "event_receipt";
|
|
149
|
+
/** The id of this one event that was sent. */
|
|
150
|
+
id: string;
|
|
151
|
+
/** The name of the event. */
|
|
152
|
+
name: string;
|
|
153
|
+
/** The address of the person it was about. */
|
|
154
|
+
email: string;
|
|
155
|
+
/** The id of their contact, or `null`. */
|
|
156
|
+
contactId: string | null;
|
|
157
|
+
/** The data that came with it. */
|
|
158
|
+
data: {
|
|
159
|
+
[key: string]: unknown;
|
|
160
|
+
};
|
|
161
|
+
/** How many runs it started. */
|
|
162
|
+
started: number;
|
|
163
|
+
/** How many waiting runs it let go on. */
|
|
164
|
+
resumed: number;
|
|
165
|
+
/** How many runs it ended. */
|
|
166
|
+
exited: number;
|
|
167
|
+
/** When it was received. */
|
|
168
|
+
createdAt: string;
|
|
169
|
+
};
|
|
170
|
+
type EventsListInput = {
|
|
171
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
172
|
+
q?: string;
|
|
173
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
174
|
+
limit?: number;
|
|
175
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
176
|
+
offset?: number;
|
|
177
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
178
|
+
after?: string;
|
|
179
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
180
|
+
before?: string;
|
|
181
|
+
};
|
|
182
|
+
type BroadcastsRemoveOutput = {
|
|
183
|
+
/** What kind of thing was removed. */
|
|
184
|
+
object: "list" | "email" | "broadcast" | "audience" | "template" | "template_version" | "template_starter" | "automation" | "metrics" | "domain" | "api_key" | "webhook" | "log" | "workspace" | "member" | "method" | "account" | "inbound_email" | "webhook_delivery" | "contact" | "plan" | "checkout" | "invoice" | "ask_answer" | "suppression" | "chat" | "automation_run" | "event" | "event_receipt" | "import" | "import_inventory" | "topic" | "contact_property" | "image" | "server";
|
|
185
|
+
/** The id of what was removed. */
|
|
186
|
+
id: string;
|
|
187
|
+
/** Always `true`: it is gone for good. */
|
|
188
|
+
deleted: true;
|
|
189
|
+
};
|
|
190
|
+
type WorkspaceGetOutputPlan = {
|
|
191
|
+
/** The id of the plan: `free`, `pro` or `max`, or `self_hosted` on a server a team hosts itself. */
|
|
192
|
+
id: string;
|
|
193
|
+
/** The name of the plan. */
|
|
194
|
+
name: string;
|
|
195
|
+
/** When the counts of the current month start again. */
|
|
196
|
+
renewsAt: string;
|
|
197
|
+
/** How the plan is paid: by the `month` or by the `year`. `null` when nobody pays for it. */
|
|
198
|
+
interval: "month" | "year" | null;
|
|
199
|
+
/** Until when the plan is paid for, or `null`. */
|
|
200
|
+
paidUntil: string | null;
|
|
201
|
+
/** What every 1,000 emails past a limit cost on this plan, in cents of a US dollar, or `null`. */
|
|
202
|
+
extraEmailCents: number | null;
|
|
203
|
+
/** Whether sending stops when the emails of the month are used up. */
|
|
204
|
+
stopsAtLimit: boolean;
|
|
205
|
+
};
|
|
206
|
+
type AutomationsTestOutputSteps = {
|
|
207
|
+
/** The id of the step. */
|
|
208
|
+
id: string;
|
|
209
|
+
/** What the step does. */
|
|
210
|
+
kind: "send_email" | "delay" | "wait_until" | "wait_for_event" | "condition" | "branch" | "split" | "update_contact" | "delete_contact" | "add_to_audience" | "remove_from_audience" | "webhook" | "send_event" | "exit";
|
|
211
|
+
/** The name of the step. */
|
|
212
|
+
name: string;
|
|
213
|
+
/** What happened: `sent`, `done`, `waiting`, `waited`, `yes`, `no`, `skipped` or `failed`. */
|
|
214
|
+
outcome: "sent" | "done" | "waiting" | "waited" | "yes" | "no" | "skipped" | "failed";
|
|
215
|
+
/** More about it, such as why it failed. Often empty. */
|
|
216
|
+
detail: string;
|
|
217
|
+
/** The id of the email it sent, or `null`. */
|
|
218
|
+
emailId: string | null;
|
|
219
|
+
/** When it happened. */
|
|
220
|
+
at: string;
|
|
221
|
+
};
|
|
222
|
+
type TopicsCreateOutput = {
|
|
223
|
+
object: "topic";
|
|
224
|
+
/** The id of the topic. */
|
|
225
|
+
id: string;
|
|
226
|
+
/** The name of the topic, as readers see it. */
|
|
227
|
+
name: string;
|
|
228
|
+
/** What the topic is about, as readers see it. Empty when not set. */
|
|
229
|
+
description: string;
|
|
230
|
+
/** What holds for a contact who never chose: `opt_in`, they get it, or `opt_out`, they do not. */
|
|
231
|
+
defaultSubscription: "opt_in" | "opt_out";
|
|
232
|
+
/** `public` when every reader sees the topic on the page where they manage their mail, `private` when only those who chose it do. */
|
|
233
|
+
visibility: "public" | "private";
|
|
234
|
+
/** What the contact you listed the topics for gets: `opt_in` or `opt_out`. `null` when you named no contact. */
|
|
235
|
+
subscription: "opt_in" | "opt_out" | null;
|
|
236
|
+
/** When the topic was made. */
|
|
237
|
+
createdAt: string;
|
|
238
|
+
};
|
|
239
|
+
type AutomationsCreateOutputStepStats = {
|
|
240
|
+
/** The id of the step. */
|
|
241
|
+
id: string;
|
|
242
|
+
/** How many runs got to this step. */
|
|
243
|
+
entered: number;
|
|
244
|
+
/** How many runs are waiting at this step now. */
|
|
245
|
+
here: number;
|
|
246
|
+
/** How many runs went past it. */
|
|
247
|
+
done: number;
|
|
248
|
+
/** How many runs failed on it. */
|
|
249
|
+
failed: number;
|
|
250
|
+
/** How many runs skipped it. */
|
|
251
|
+
skipped: number;
|
|
252
|
+
/** How many emails it sent. */
|
|
253
|
+
sent: number;
|
|
254
|
+
/** How many of those were delivered. */
|
|
255
|
+
delivered: number;
|
|
256
|
+
/** How many were opened. */
|
|
257
|
+
opened: number;
|
|
258
|
+
/** How many had a link clicked. */
|
|
259
|
+
clicked: number;
|
|
260
|
+
/** How many bounced. */
|
|
261
|
+
bounced: number;
|
|
262
|
+
/** How many were marked as spam. */
|
|
263
|
+
complained: number;
|
|
264
|
+
/** How many runs took its `yes` path. */
|
|
265
|
+
yes: number;
|
|
266
|
+
/** How many runs took its `no` path. */
|
|
267
|
+
no: number;
|
|
268
|
+
};
|
|
269
|
+
type ApiKeysEnrollOutput = {
|
|
270
|
+
object: "api_key";
|
|
271
|
+
/** The id of the key. */
|
|
272
|
+
id: string;
|
|
273
|
+
/** The name you gave the key. */
|
|
274
|
+
name: string;
|
|
275
|
+
/** What the key may do: `full` for everything, `sending` for sending email and nothing else. */
|
|
276
|
+
access: "full" | "sending";
|
|
277
|
+
/** `live` for a key that sends real email, `test` for a key whose emails are simulated and reach nobody. */
|
|
278
|
+
mode: "live" | "test";
|
|
279
|
+
/** The start of the key, enough to recognise it. */
|
|
280
|
+
preview: string;
|
|
281
|
+
/** The id of the one domain a sending key may send from, or `null` when it may send from any. */
|
|
282
|
+
domainId: string | null;
|
|
283
|
+
/** The name of that domain, or `null`. */
|
|
284
|
+
domain: string | null;
|
|
285
|
+
/** When the key last made a request, or `null` if it never has. */
|
|
286
|
+
lastUsedAt: string | null;
|
|
287
|
+
/** When the key was made. */
|
|
288
|
+
createdAt: string;
|
|
289
|
+
};
|
|
290
|
+
type BroadcastsCreateInputDesignFonts = {
|
|
291
|
+
/** The name of the font, such as `Inter`. A block or the page uses the font by naming it in `fontFamily`. */
|
|
292
|
+
family: string;
|
|
293
|
+
/** The fonts to use where this one does not load, the one you want most first, such as `Helvetica, Arial, sans-serif`. Pick fonts every device has. */
|
|
294
|
+
fallback: string;
|
|
295
|
+
/** The full `https` address of the font file, on your own domain or a CDN. It cannot be a variable. */
|
|
296
|
+
url: string;
|
|
297
|
+
/** The format of the file: `woff2`, `woff`, `truetype` or `opentype`. */
|
|
298
|
+
format: "woff2" | "woff" | "truetype" | "opentype";
|
|
299
|
+
/** The weight this file holds: a number from 100 to 900 in hundreds, or `normal` or `bold`. Without it, 400. */
|
|
300
|
+
weight?: number | string;
|
|
301
|
+
/** The style this file holds: `normal` or `italic`. Without it, `normal`. */
|
|
302
|
+
style?: "normal" | "italic";
|
|
303
|
+
};
|
|
304
|
+
type ImportsCreateOutputReport = {
|
|
305
|
+
/** What was read: `domains`, `suppressions`, `audiences`, `contacts`, `templates`, `broadcasts`, `webhooks` or `api_keys`. */
|
|
306
|
+
resource: "domains" | "suppressions" | "audiences" | "contacts" | "templates" | "broadcasts" | "webhooks" | "api_keys" | "topics" | "contact_properties" | "automations" | "events";
|
|
307
|
+
/** How many the other account has, as far as the import has read. */
|
|
308
|
+
found: number;
|
|
309
|
+
/** How many were made here. */
|
|
310
|
+
created: number;
|
|
311
|
+
/** How many were here already, from an earlier import or under the same name. */
|
|
312
|
+
reused: number;
|
|
313
|
+
/** How many were left out. The notes say why. */
|
|
314
|
+
skipped: number;
|
|
315
|
+
/** What was left out or changed on the way, each with its reason. The first 50 are kept. */
|
|
316
|
+
notes: Array<{
|
|
317
|
+
/** What the note is about: a domain, a template, an address. */
|
|
318
|
+
name: string;
|
|
319
|
+
/** What happened to it, and what to do about it when there is something. */
|
|
320
|
+
reason: string;
|
|
321
|
+
}>;
|
|
322
|
+
};
|
|
323
|
+
type MembersInviteOutput = {
|
|
324
|
+
object: "member";
|
|
325
|
+
/** The id of the member. */
|
|
326
|
+
id: string;
|
|
327
|
+
/** The name of the person. */
|
|
328
|
+
name: string;
|
|
329
|
+
/** The address of the person. */
|
|
330
|
+
email: string;
|
|
331
|
+
/** What the member may do: `owner`, `admin`, `member` or `viewer`. */
|
|
332
|
+
role: "owner" | "admin" | "member" | "viewer";
|
|
333
|
+
/** `invited` until the person signs in, `active` after that. */
|
|
334
|
+
status: "active" | "invited";
|
|
335
|
+
/** The name of who invited them. */
|
|
336
|
+
invitedBy: string;
|
|
337
|
+
/** When the invitation was sent, or `null` for the person who made the workspace. */
|
|
338
|
+
invitedAt: string | null;
|
|
339
|
+
/** When the member last used the workspace, or `null`. */
|
|
340
|
+
lastActiveAt: string | null;
|
|
341
|
+
/** A link that lets an invited person choose a password and join without an emailed code, or `null`. Only the owner of a server a team hosts itself is given it, signed in, while the invitation is waiting. */
|
|
342
|
+
invitationUrl: string | null;
|
|
343
|
+
/** When the member was added. */
|
|
344
|
+
createdAt: string;
|
|
345
|
+
};
|
|
346
|
+
type WebhooksTestOutput = {
|
|
347
|
+
object: "webhook_delivery";
|
|
348
|
+
/** The id of the delivery. */
|
|
349
|
+
id: string;
|
|
350
|
+
/** The id of the webhook it was for. */
|
|
351
|
+
webhookId: string;
|
|
352
|
+
/** The event that was posted. */
|
|
353
|
+
type: "email.sent" | "email.delivered" | "email.delayed" | "email.bounced" | "email.opened" | "email.clicked" | "email.complained" | "email.failed" | "email.received" | "email.scheduled" | "email.canceled" | "automation.entered" | "automation.finished" | "automation.step";
|
|
354
|
+
/** `pending` while it is still being tried, `delivered` once your address answered 2xx, `failed` after the last try. */
|
|
355
|
+
state: "pending" | "delivered" | "failed";
|
|
356
|
+
/** The HTTP status of the last answer, or 0 when there was none. */
|
|
357
|
+
status: number;
|
|
358
|
+
/** How many times it has been tried. */
|
|
359
|
+
attempts: number;
|
|
360
|
+
/** What went wrong on the last try. Empty when nothing did. */
|
|
361
|
+
error: string;
|
|
362
|
+
/** When it is tried again, or `null`. */
|
|
363
|
+
nextAttemptAt: string | null;
|
|
364
|
+
/** When the event happened. */
|
|
365
|
+
createdAt: string;
|
|
366
|
+
};
|
|
367
|
+
type WebhooksListOutputData = {
|
|
368
|
+
object: "webhook";
|
|
369
|
+
/** The id of the webhook. */
|
|
370
|
+
id: string;
|
|
371
|
+
/** The address events are posted to. */
|
|
372
|
+
url: string;
|
|
373
|
+
/** The events it is told about. */
|
|
374
|
+
events: Array<"email.sent" | "email.delivered" | "email.delayed" | "email.bounced" | "email.opened" | "email.clicked" | "email.complained" | "email.failed" | "email.received" | "email.scheduled" | "email.canceled" | "automation.entered" | "automation.finished" | "automation.step">;
|
|
375
|
+
/** `enabled` while events are posted to it, `disabled` when it is switched off. */
|
|
376
|
+
status: "enabled" | "disabled";
|
|
377
|
+
/** How an event is written and signed: `native` is this API, `resend` is the headers, signature and body an endpoint built for Resend expects. */
|
|
378
|
+
format: "native" | "resend";
|
|
379
|
+
/** When an event was last posted to it, or `null`. */
|
|
380
|
+
lastDeliveryAt: string | null;
|
|
381
|
+
/** The HTTP status your address answered with last time, or `null`. */
|
|
382
|
+
lastStatus: number | null;
|
|
383
|
+
/** When the webhook was added. */
|
|
384
|
+
createdAt: string;
|
|
385
|
+
};
|
|
386
|
+
type AudiencesJoinOutput = {
|
|
387
|
+
object: "contact";
|
|
388
|
+
/** The id of the contact. */
|
|
389
|
+
id: string;
|
|
390
|
+
/** The address of the contact. A workspace holds an address once. */
|
|
391
|
+
email: string;
|
|
392
|
+
/** The first name of the contact. Empty when it is not known. */
|
|
393
|
+
firstName: string;
|
|
394
|
+
/** The last name of the contact. Empty when it is not known. */
|
|
395
|
+
lastName: string;
|
|
396
|
+
/** `subscribed` while the contact gets broadcasts, `unsubscribed` after they leave. */
|
|
397
|
+
status: "subscribed" | "unsubscribed";
|
|
398
|
+
/** When the contact unsubscribed, or `null`. */
|
|
399
|
+
unsubscribedAt: string | null;
|
|
400
|
+
/** Values of your own on the contact, by name. Automations can test them, and broadcasts and automations fill `{{name}}` slots with them. */
|
|
401
|
+
properties: {
|
|
402
|
+
[key: string]: string | number | boolean;
|
|
403
|
+
};
|
|
404
|
+
/** The ids of the audiences the contact is in. */
|
|
405
|
+
audienceIds: string[];
|
|
406
|
+
/** What the contact chose for a topic, by the id of the topic: `opt_in` or `opt_out`. A topic that is not here follows its own default. */
|
|
407
|
+
topics: {
|
|
408
|
+
[key: string]: "opt_in" | "opt_out";
|
|
409
|
+
};
|
|
410
|
+
/** When the contact was added. */
|
|
411
|
+
createdAt: string;
|
|
412
|
+
};
|
|
413
|
+
type AutomationsCreateOutputSettings = {
|
|
414
|
+
/** The time zone its times are read in, such as `Europe/London`. */
|
|
415
|
+
timezone: string;
|
|
416
|
+
/** Whether a person can go through it again: `once` (never), `after_exit` (when they are not in it any more) or `always` (every time, even while they are in it). */
|
|
417
|
+
reentry: "once" | "after_exit" | "always";
|
|
418
|
+
/** With `after_exit`: how many days have to pass after a run ends. 0 for none. */
|
|
419
|
+
reentryAfterDays: number;
|
|
420
|
+
/** The sending hours. An email that is due outside them waits until they open. `null` sends at any time. */
|
|
421
|
+
window: {
|
|
422
|
+
/** The days emails may go out on, such as `["mon", "fri"]`. */
|
|
423
|
+
days: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
424
|
+
/** When the sending hours open, as `HH:MM`. */
|
|
425
|
+
from: string;
|
|
426
|
+
/** When they close, as `HH:MM`. */
|
|
427
|
+
to: string;
|
|
428
|
+
} | null;
|
|
429
|
+
/** Events that take a person out of the automation when they arrive. */
|
|
430
|
+
exitOn: string[];
|
|
431
|
+
/** `true` for marketing: an unsubscribed contact does not enter, a run ends when its contact unsubscribes, and emails to contacts carry the unsubscribe link. `false` for mail that always has to arrive, such as receipts. */
|
|
432
|
+
respectUnsubscribes: boolean;
|
|
433
|
+
};
|
|
434
|
+
type AutomationsCreateInputSettings = {
|
|
435
|
+
/** The time zone its times are read in, such as `Europe/London`. */
|
|
436
|
+
timezone?: string;
|
|
437
|
+
/** Whether a person can go through it again: `once` (never), `after_exit` (when they are not in it any more) or `always` (every time, even while they are in it). */
|
|
438
|
+
reentry?: "once" | "after_exit" | "always";
|
|
439
|
+
/** With `after_exit`: how many days have to pass after a run ends. 0 for none. */
|
|
440
|
+
reentryAfterDays?: number;
|
|
441
|
+
/** The sending hours. An email that is due outside them waits until they open. `null` sends at any time. */
|
|
442
|
+
window?: {
|
|
443
|
+
/** The days emails may go out on, such as `["mon", "fri"]`. */
|
|
444
|
+
days: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
445
|
+
/** When the sending hours open, as `HH:MM`. */
|
|
446
|
+
from: string;
|
|
447
|
+
/** When they close, as `HH:MM`. */
|
|
448
|
+
to: string;
|
|
449
|
+
} | null;
|
|
450
|
+
/** Events that take a person out of the automation when they arrive. */
|
|
451
|
+
exitOn?: string[];
|
|
452
|
+
/** `true` for marketing: an unsubscribed contact does not enter, a run ends when its contact unsubscribes, and emails to contacts carry the unsubscribe link. `false` for mail that always has to arrive, such as receipts. */
|
|
453
|
+
respectUnsubscribes?: boolean;
|
|
454
|
+
};
|
|
455
|
+
type ImagesAddOutput = {
|
|
456
|
+
object: "image";
|
|
457
|
+
/** The id of the image. */
|
|
458
|
+
id: string;
|
|
459
|
+
/** The address the image is served at. Emails link it in place of `source` when the image was copied, and it is the address to write in an email when the image was uploaded. `null` until the image is `ready`. */
|
|
460
|
+
url: string | null;
|
|
461
|
+
/** Where the image came from: the address it was copied from, as it is written in your emails, or the name of the file that was uploaded. */
|
|
462
|
+
source: string;
|
|
463
|
+
/** How the image got here: `address` when it was copied from an address, `upload` when it was sent as a file. */
|
|
464
|
+
origin: "address" | "upload";
|
|
465
|
+
/** `pending` while it waits to be copied, `ready` once it is served, `failed` when it could not be copied. An uploaded image is `ready` at once. */
|
|
466
|
+
status: "pending" | "ready" | "failed";
|
|
467
|
+
/** The media type of the image: `image/png`, `image/jpeg`, `image/gif` or `image/webp`. `null` until it is `ready`. */
|
|
468
|
+
type: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | null;
|
|
469
|
+
/** The size of the image in bytes, or `null` until it is `ready`. */
|
|
470
|
+
size: number | null;
|
|
471
|
+
/** Why the last try to copy it did not work, in words, or `null`. */
|
|
472
|
+
reason: string | null;
|
|
473
|
+
/** When the image was first seen. */
|
|
474
|
+
createdAt: string;
|
|
475
|
+
/** When it was last copied or tried. */
|
|
476
|
+
updatedAt: string;
|
|
477
|
+
};
|
|
478
|
+
type LogsListOutputData = {
|
|
479
|
+
object: "log";
|
|
480
|
+
/** The id of the log entry. */
|
|
481
|
+
id: string;
|
|
482
|
+
/** The HTTP verb of the request. */
|
|
483
|
+
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
484
|
+
/** The path that was asked for. */
|
|
485
|
+
path: string;
|
|
486
|
+
/** The HTTP status of the answer. */
|
|
487
|
+
status: number;
|
|
488
|
+
/** `success` for a 2xx answer, `client_error` for 4xx, `server_error` for 5xx. */
|
|
489
|
+
outcome: "success" | "client_error" | "server_error";
|
|
490
|
+
/** How long the request took, in milliseconds. */
|
|
491
|
+
durationMs: number;
|
|
492
|
+
/** The id of the API key that made it, or `null`. */
|
|
493
|
+
keyId: string | null;
|
|
494
|
+
/** `test` when a test key made the request, otherwise `live`. */
|
|
495
|
+
mode: "live" | "test";
|
|
496
|
+
/** What the client called itself. */
|
|
497
|
+
userAgent: string;
|
|
498
|
+
/** The id the answer carried in its request id header. Empty on an older entry. */
|
|
499
|
+
requestId: string;
|
|
500
|
+
/** Why the request failed, or `null` when it did not. */
|
|
501
|
+
error: {
|
|
502
|
+
/** The kind of error, as in the answer. */
|
|
503
|
+
type: string;
|
|
504
|
+
/** The code of the error, as in the answer. */
|
|
505
|
+
code: string;
|
|
506
|
+
/** What the answer said was wrong. */
|
|
507
|
+
message: string;
|
|
508
|
+
} | null;
|
|
509
|
+
/** What a request that changed something made or changed, or `null`. */
|
|
510
|
+
resource: {
|
|
511
|
+
/** The kind of thing, such as `email` or `domain`. */
|
|
512
|
+
object: string;
|
|
513
|
+
/** Its id. */
|
|
514
|
+
id: string;
|
|
515
|
+
} | null;
|
|
516
|
+
/** The tool an MCP request called, such as `emails_send`, or `null`. */
|
|
517
|
+
tool: string | null;
|
|
518
|
+
/** When the request was made. */
|
|
519
|
+
createdAt: string;
|
|
520
|
+
};
|
|
521
|
+
type AutomationsCreateInputTriggerConditionsConditions = {
|
|
522
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
523
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
524
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
525
|
+
field?: string;
|
|
526
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
527
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
528
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
529
|
+
value?: string | number | boolean;
|
|
530
|
+
/** For `email`: the id of the step that sent it. */
|
|
531
|
+
step?: string;
|
|
532
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
533
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
534
|
+
/** For `event` and `waited`: the name of the event. */
|
|
535
|
+
event?: string;
|
|
536
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
537
|
+
withinDays?: number;
|
|
538
|
+
/** For `audience`: the id of the audience. */
|
|
539
|
+
audienceId?: string;
|
|
540
|
+
/** `true` turns the test around. */
|
|
541
|
+
not?: boolean;
|
|
542
|
+
};
|
|
543
|
+
type BroadcastsCreateOutputDesignBody = {
|
|
544
|
+
/** What the block is. `Section`, `Row`, `Column` and `Container` hold other blocks. `Text`, `Heading`, `Button`, `Link`, `Markdown`, `CodeBlock` and `CodeInline` hold text. `Img` is an image, `Hr` a line and `Html` custom code: HTML of your own that goes into the message as it is. */
|
|
545
|
+
kind: "Section" | "Row" | "Column" | "Container" | "Text" | "Heading" | "Button" | "Link" | "Img" | "Hr" | "Markdown" | "CodeBlock" | "CodeInline" | "Html";
|
|
546
|
+
/** The id of the block. No other block of the design has it. */
|
|
547
|
+
id: string;
|
|
548
|
+
/** CSS for the block, by property name, such as `{ "fontSize": "16px", "color": "#111111" }`. Only properties that work in mail are taken. */
|
|
549
|
+
style?: {
|
|
550
|
+
[key: string]: string | number;
|
|
551
|
+
};
|
|
552
|
+
/** Where the block sits across its line: `left`, `center` or `right`. */
|
|
553
|
+
align?: "left" | "center" | "right";
|
|
554
|
+
/** Class names for the block, one or several with one space between them, such as `hero wide`, 200 characters at most. The `css` of the design reaches the block by them. A name cannot start with `r-`. */
|
|
555
|
+
className?: string;
|
|
556
|
+
/** The one kind of screen the block shows on: `desktop` hides it on a phone, and `phone` shows it on a phone and nowhere else. Without it, the block shows everywhere. */
|
|
557
|
+
only?: "desktop" | "phone";
|
|
558
|
+
/** CSS that takes the place of the style of the block on a phone, a screen up to 600 pixels wide, by property name, such as `{ "fontSize": "14px", "padding": "12px" }`. It takes: fontSize, lineHeight, textAlign, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, marginLeft, width, maxWidth, height. */
|
|
559
|
+
phone?: {
|
|
560
|
+
[key: string]: string | number;
|
|
561
|
+
};
|
|
562
|
+
/** Colours that take the place of the ones of the block for a reader in dark mode, by property name, such as `{ "color": "#f4f4f5" }`. It takes: color, backgroundColor, borderColor. */
|
|
563
|
+
dark?: {
|
|
564
|
+
[key: string]: string | number;
|
|
565
|
+
};
|
|
566
|
+
/** The words of a block that holds text, up to 20000 characters. `{{NAME}}` marks a variable. A `Markdown` block takes Markdown here, a `CodeBlock` takes the code and an `Html` block takes its HTML, up to 60000 characters. */
|
|
567
|
+
text?: string;
|
|
568
|
+
/** The blocks inside a `Section`, a `Row`, a `Column` or a `Container`, each shaped like a block of `body`. A `Row` takes `Column` blocks only, and a `Column` sits in a `Row` only. */
|
|
569
|
+
children?: unknown[];
|
|
570
|
+
/** Where a `Button` or a `Link` leads: a full address, or one variable as the whole value, such as `{{URL}}`. */
|
|
571
|
+
href?: string;
|
|
572
|
+
/** Where the link opens: `_blank` for a new tab or `_self`. Without it, `_blank`. */
|
|
573
|
+
target?: "_blank" | "_self";
|
|
574
|
+
/** The address of the picture of an `Img`: a full address, or one variable as the whole value. */
|
|
575
|
+
src?: string;
|
|
576
|
+
/** What the picture of an `Img` shows, in words, for someone who cannot see it. */
|
|
577
|
+
alt?: string;
|
|
578
|
+
/** The width of an `Img` or a `Column`: a number of pixels, or a length such as `50%`. */
|
|
579
|
+
width?: string | number;
|
|
580
|
+
/** The height of an `Img`: a number of pixels, or a length. */
|
|
581
|
+
height?: string | number;
|
|
582
|
+
/** Where the content of a `Column` sits: `top`, `middle` or `bottom`. */
|
|
583
|
+
valign?: "top" | "middle" | "bottom";
|
|
584
|
+
/** The level of a `Heading`, from `h1` to `h6`. Without it, `h1`. */
|
|
585
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
586
|
+
/** The language of a `CodeBlock`, such as `typescript` or `bash`. One it does not know is shown as plain text. */
|
|
587
|
+
language?: string;
|
|
588
|
+
/** The colours of a `CodeBlock`: `oneDark`, `oneLight`, `dracula`, `nord`, `vscDarkPlus`, `vs`, `ghcolors` or `materialLight`. Without it, `oneDark`. */
|
|
589
|
+
theme?: string;
|
|
590
|
+
/** Whether a `CodeBlock` numbers its lines. */
|
|
591
|
+
lineNumbers?: boolean;
|
|
592
|
+
/** `true` puts the columns of a `Row` under each other on a phone. Only a `Row` takes it. */
|
|
593
|
+
stack?: boolean;
|
|
594
|
+
};
|
|
595
|
+
type BroadcastsCreateInputDesignBody = {
|
|
596
|
+
/** What the block is. `Section`, `Row`, `Column` and `Container` hold other blocks. `Text`, `Heading`, `Button`, `Link`, `Markdown`, `CodeBlock` and `CodeInline` hold text. `Img` is an image, `Hr` a line and `Html` custom code: HTML of your own that goes into the message as it is. */
|
|
597
|
+
kind: "Section" | "Row" | "Column" | "Container" | "Text" | "Heading" | "Button" | "Link" | "Img" | "Hr" | "Markdown" | "CodeBlock" | "CodeInline" | "Html";
|
|
598
|
+
/** A name for the block that no other block of the design has: lowercase letters, digits and hyphens. Leave it out and the block gets one. */
|
|
599
|
+
id?: string;
|
|
600
|
+
/** CSS for the block, by property name, such as `{ "fontSize": "16px", "color": "#111111" }`. Only properties that work in mail are taken. */
|
|
601
|
+
style?: {
|
|
602
|
+
[key: string]: string | number;
|
|
603
|
+
};
|
|
604
|
+
/** Where the block sits across its line: `left`, `center` or `right`. */
|
|
605
|
+
align?: "left" | "center" | "right";
|
|
606
|
+
/** Class names for the block, one or several with one space between them, such as `hero wide`, 200 characters at most. The `css` of the design reaches the block by them. A name cannot start with `r-`. */
|
|
607
|
+
className?: string;
|
|
608
|
+
/** The one kind of screen the block shows on: `desktop` hides it on a phone, and `phone` shows it on a phone and nowhere else. Without it, the block shows everywhere. */
|
|
609
|
+
only?: "desktop" | "phone";
|
|
610
|
+
/** CSS that takes the place of the style of the block on a phone, a screen up to 600 pixels wide, by property name, such as `{ "fontSize": "14px", "padding": "12px" }`. It takes: fontSize, lineHeight, textAlign, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, marginLeft, width, maxWidth, height. */
|
|
611
|
+
phone?: {
|
|
612
|
+
[key: string]: string | number;
|
|
613
|
+
};
|
|
614
|
+
/** Colours that take the place of the ones of the block for a reader in dark mode, by property name, such as `{ "color": "#f4f4f5" }`. It takes: color, backgroundColor, borderColor. */
|
|
615
|
+
dark?: {
|
|
616
|
+
[key: string]: string | number;
|
|
617
|
+
};
|
|
618
|
+
/** The words of a block that holds text, up to 20000 characters. `{{NAME}}` marks a variable. A `Markdown` block takes Markdown here, a `CodeBlock` takes the code and an `Html` block takes its HTML, up to 60000 characters. */
|
|
619
|
+
text?: string;
|
|
620
|
+
/** The blocks inside a `Section`, a `Row`, a `Column` or a `Container`, each shaped like a block of `body`. A `Row` takes `Column` blocks only, and a `Column` sits in a `Row` only. */
|
|
621
|
+
children?: unknown[];
|
|
622
|
+
/** Where a `Button` or a `Link` leads: a full address, or one variable as the whole value, such as `{{URL}}`. */
|
|
623
|
+
href?: string;
|
|
624
|
+
/** Where the link opens: `_blank` for a new tab or `_self`. Without it, `_blank`. */
|
|
625
|
+
target?: "_blank" | "_self";
|
|
626
|
+
/** The address of the picture of an `Img`: a full address, or one variable as the whole value. */
|
|
627
|
+
src?: string;
|
|
628
|
+
/** What the picture of an `Img` shows, in words, for someone who cannot see it. */
|
|
629
|
+
alt?: string;
|
|
630
|
+
/** The width of an `Img` or a `Column`: a number of pixels, or a length such as `50%`. */
|
|
631
|
+
width?: string | number;
|
|
632
|
+
/** The height of an `Img`: a number of pixels, or a length. */
|
|
633
|
+
height?: string | number;
|
|
634
|
+
/** Where the content of a `Column` sits: `top`, `middle` or `bottom`. */
|
|
635
|
+
valign?: "top" | "middle" | "bottom";
|
|
636
|
+
/** The level of a `Heading`, from `h1` to `h6`. Without it, `h1`. */
|
|
637
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
638
|
+
/** The language of a `CodeBlock`, such as `typescript` or `bash`. One it does not know is shown as plain text. */
|
|
639
|
+
language?: string;
|
|
640
|
+
/** The colours of a `CodeBlock`: `oneDark`, `oneLight`, `dracula`, `nord`, `vscDarkPlus`, `vs`, `ghcolors` or `materialLight`. Without it, `oneDark`. */
|
|
641
|
+
theme?: string;
|
|
642
|
+
/** Whether a `CodeBlock` numbers its lines. */
|
|
643
|
+
lineNumbers?: boolean;
|
|
644
|
+
/** `true` puts the columns of a `Row` under each other on a phone. Only a `Row` takes it. */
|
|
645
|
+
stack?: boolean;
|
|
646
|
+
};
|
|
647
|
+
export interface OpenSendInputs {
|
|
648
|
+
emails: {
|
|
649
|
+
/** Send email. Sends one email to up to fifty addresses, from an address on a verified domain of the workspace. It takes cc, bcc, a reply address, headers, tags, attachments, a published template with its variables and a time to send at. With an idempotency key (the field, or the Idempotency-Key header) a repeat within a day answers with the first email. Sent with a test key, or to test addresses only, the email belongs to the sandbox: its `mode` is `test`, it reaches nobody and what happens to it is simulated. */
|
|
650
|
+
send: {
|
|
651
|
+
/** The sender, on a verified domain. An address, or a name and an address as `Acme <hello@mail.example.com>`. Needed unless a template gives one. */
|
|
652
|
+
from?: string;
|
|
653
|
+
/** Who the email is for: one address, or up to 50. A test address, such as `delivered@opensend.test` or `bounced@opensend.test`, reaches nobody and ends the way its name says. */
|
|
654
|
+
to: string | string[];
|
|
655
|
+
/** Who gets a copy: one address, or up to 50. */
|
|
656
|
+
cc?: string | string[];
|
|
657
|
+
/** Who gets a copy without the others seeing: one address, or up to 50. */
|
|
658
|
+
bcc?: string | string[];
|
|
659
|
+
/** The address replies go to, when it is not the sender. Without it, the one of the template when it has one, then the default of the workspace. */
|
|
660
|
+
replyTo?: string;
|
|
661
|
+
/** The subject line. Needed unless a template gives one. */
|
|
662
|
+
subject?: string;
|
|
663
|
+
/** The message as HTML. */
|
|
664
|
+
html?: string;
|
|
665
|
+
/** The message as plain text. Send it with `html`, or alone. With a template it replaces the plain text of the template. */
|
|
666
|
+
text?: string;
|
|
667
|
+
/** Extra headers for the message, by name. Up to 20, and not the ones the platform writes itself. */
|
|
668
|
+
headers?: {
|
|
669
|
+
[key: string]: string;
|
|
670
|
+
};
|
|
671
|
+
/** Labels of your own for the email, by name, such as `{ "campaign": "welcome" }`. Up to 10. They come back on the email and in webhooks. */
|
|
672
|
+
tags?: {
|
|
673
|
+
[key: string]: string;
|
|
674
|
+
};
|
|
675
|
+
/** A published template to build the email from, in place of `subject`, `html` and `text`. Its sender and reply address are used when you give none. */
|
|
676
|
+
template?: {
|
|
677
|
+
/** The id or the alias of a published template. */
|
|
678
|
+
id: string;
|
|
679
|
+
/** A value for each `{{NAME}}` in the template, by name. A variable with a default in the template can be left out. */
|
|
680
|
+
variables?: {
|
|
681
|
+
[key: string]: string | number;
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
/** Files to attach. Up to 10, and 10 MB together. */
|
|
685
|
+
attachments?: Array<{
|
|
686
|
+
/** The name of the file as the recipient sees it. */
|
|
687
|
+
filename: string;
|
|
688
|
+
/** The file, encoded as Base64. Give this or `path`, not both. */
|
|
689
|
+
content?: string;
|
|
690
|
+
/** An `https://` address to fetch the file from. Give this or `content`, not both. */
|
|
691
|
+
path?: string;
|
|
692
|
+
/** The media type of the file, such as `application/pdf`. Without it the type is taken from the name. */
|
|
693
|
+
contentType?: string;
|
|
694
|
+
}>;
|
|
695
|
+
/** When to send it, as an ISO 8601 time with an offset, such as `2026-12-01T09:00:00Z`. Up to 30 days ahead. Without it the email is sent now. */
|
|
696
|
+
scheduledAt?: string;
|
|
697
|
+
/** A key of your own that makes a repeat of this request answer with the first result and send nothing. The `Idempotency-Key` header does the same. */
|
|
698
|
+
idempotencyKey?: string;
|
|
699
|
+
};
|
|
700
|
+
/** Send emails in a batch. Sends up to a hundred emails in one request. Every email is checked first and one that is refused refuses the whole batch, unless `validation` is `permissive`: then the rest are sent and the refused one is listed with its reason. After that each email is accepted or refused by itself, and the answer says which. */
|
|
701
|
+
batch: {
|
|
702
|
+
/** The emails to send, up to 100. Each takes the same fields as one email, without attachments or a schedule. */
|
|
703
|
+
emails: Array<{
|
|
704
|
+
/** The sender, on a verified domain. An address, or a name and an address as `Acme <hello@mail.example.com>`. Needed unless a template gives one. */
|
|
705
|
+
from?: string;
|
|
706
|
+
/** Who the email is for: one address, or up to 50. A test address, such as `delivered@opensend.test` or `bounced@opensend.test`, reaches nobody and ends the way its name says. */
|
|
707
|
+
to: string | string[];
|
|
708
|
+
/** Who gets a copy: one address, or up to 50. */
|
|
709
|
+
cc?: string | string[];
|
|
710
|
+
/** Who gets a copy without the others seeing: one address, or up to 50. */
|
|
711
|
+
bcc?: string | string[];
|
|
712
|
+
/** The address replies go to, when it is not the sender. Without it, the one of the template when it has one, then the default of the workspace. */
|
|
713
|
+
replyTo?: string;
|
|
714
|
+
/** The subject line. Needed unless a template gives one. */
|
|
715
|
+
subject?: string;
|
|
716
|
+
/** The message as HTML. */
|
|
717
|
+
html?: string;
|
|
718
|
+
/** The message as plain text. Send it with `html`, or alone. With a template it replaces the plain text of the template. */
|
|
719
|
+
text?: string;
|
|
720
|
+
/** Extra headers for the message, by name. Up to 20, and not the ones the platform writes itself. */
|
|
721
|
+
headers?: {
|
|
722
|
+
[key: string]: string;
|
|
723
|
+
};
|
|
724
|
+
/** Labels of your own for the email, by name, such as `{ "campaign": "welcome" }`. Up to 10. They come back on the email and in webhooks. */
|
|
725
|
+
tags?: {
|
|
726
|
+
[key: string]: string;
|
|
727
|
+
};
|
|
728
|
+
/** A published template to build the email from, in place of `subject`, `html` and `text`. Its sender and reply address are used when you give none. */
|
|
729
|
+
template?: {
|
|
730
|
+
/** The id or the alias of a published template. */
|
|
731
|
+
id: string;
|
|
732
|
+
/** A value for each `{{NAME}}` in the template, by name. A variable with a default in the template can be left out. */
|
|
733
|
+
variables?: {
|
|
734
|
+
[key: string]: string | number;
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
}>;
|
|
738
|
+
/** What one refused email does to the others: `strict` refuses the whole batch and sends nothing, `permissive` sends the rest and lists the refused one with its reason. Without it you get `strict`. */
|
|
739
|
+
validation?: "strict" | "permissive";
|
|
740
|
+
/** A key of your own that makes a repeat of this request answer with the first result and send nothing. The `Idempotency-Key` header does the same. */
|
|
741
|
+
idempotencyKey?: string;
|
|
742
|
+
};
|
|
743
|
+
/** Reschedule email. Moves an email that is still scheduled to another time, at most 30 days ahead. */
|
|
744
|
+
update: {
|
|
745
|
+
/** The id of the item. */
|
|
746
|
+
id: string;
|
|
747
|
+
/** The new time to send it, as an ISO 8601 time with an offset. Up to 30 days ahead. */
|
|
748
|
+
scheduledAt: string;
|
|
749
|
+
};
|
|
750
|
+
/** Cancel email. Cancels an email that is still scheduled, so it is never sent. */
|
|
751
|
+
cancel: {
|
|
752
|
+
/** The id of the item. */
|
|
753
|
+
id: string;
|
|
754
|
+
};
|
|
755
|
+
/** Retrieve email. One email with its body and every event that has happened to it. */
|
|
756
|
+
get: {
|
|
757
|
+
/** The id of the item. */
|
|
758
|
+
id: string;
|
|
759
|
+
};
|
|
760
|
+
/** List emails. The emails the workspace has sent, newest first, by status, time and search. */
|
|
761
|
+
list: {
|
|
762
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
763
|
+
q?: string;
|
|
764
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
765
|
+
limit?: number;
|
|
766
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
767
|
+
offset?: number;
|
|
768
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
769
|
+
after?: string;
|
|
770
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
771
|
+
before?: string;
|
|
772
|
+
/** The period to look at: `today`, `week`, `month`, `year`, `all` or `custom`. Without it there is no limit in time. */
|
|
773
|
+
range?: "today" | "week" | "month" | "year" | "all" | "custom";
|
|
774
|
+
/** The first day of a `custom` period, as a date such as `2026-11-01`. */
|
|
775
|
+
from?: string;
|
|
776
|
+
/** The last day of a `custom` period, as a date such as `2026-11-30`. */
|
|
777
|
+
to?: string;
|
|
778
|
+
/** Only emails in this state. */
|
|
779
|
+
status?: "queued" | "sent" | "delivered" | "delayed" | "bounced" | "opened" | "clicked" | "complained" | "failed" | "scheduled" | "canceled";
|
|
780
|
+
/** Only real emails (`live`) or only emails of the sandbox (`test`). */
|
|
781
|
+
mode?: "live" | "test";
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
broadcasts: {
|
|
785
|
+
/** Create broadcast. Creates a draft broadcast for one audience. Nothing is sent until you send it. */
|
|
786
|
+
create: {
|
|
787
|
+
/** A name to recognise the broadcast by. Recipients never see it. */
|
|
788
|
+
name: string;
|
|
789
|
+
/** The id of the audience to send to. */
|
|
790
|
+
audienceId: string;
|
|
791
|
+
/** The id of a topic. The broadcast then only reaches the contacts who get that topic, and its unsubscribe link takes a reader out of the topic and not out of everything. */
|
|
792
|
+
topicId?: string | null;
|
|
793
|
+
/** The subject line. `{{first_name}}`, `{{last_name}}` and `{{email}}` are filled in for each contact. */
|
|
794
|
+
subject?: string;
|
|
795
|
+
/** The sender, on a verified domain, such as `Acme <news@mail.example.com>`. */
|
|
796
|
+
from?: string;
|
|
797
|
+
/** The address replies go to, when it is not the sender. Empty to leave it to the default of the workspace. */
|
|
798
|
+
replyTo?: "" | string;
|
|
799
|
+
/** The HTML of the message. The same variables as the subject, and `{{unsubscribe_url}}` for the unsubscribe link. Leave it out with `design`. */
|
|
800
|
+
html?: string;
|
|
801
|
+
/** The plain text of the message, with the same variables. Leave it out with `design`. */
|
|
802
|
+
text?: string;
|
|
803
|
+
/** The message as blocks, in place of `html` and `text`, which are then made from it. The same variables stand in the text of a block, and `{{unsubscribe_url}}` as the whole `href` of a link. `null` or nothing for a broadcast written as HTML. */
|
|
804
|
+
design?: {
|
|
805
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
806
|
+
preview?: string;
|
|
807
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
808
|
+
style?: {
|
|
809
|
+
[key: string]: string | number;
|
|
810
|
+
};
|
|
811
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
812
|
+
dark?: {
|
|
813
|
+
[key: string]: string | number;
|
|
814
|
+
};
|
|
815
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
816
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
817
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
818
|
+
css?: string;
|
|
819
|
+
/** The blocks of the message, from top to bottom. */
|
|
820
|
+
body: BroadcastsCreateInputDesignBody[];
|
|
821
|
+
} | null;
|
|
822
|
+
};
|
|
823
|
+
/** Update broadcast. Changes the name, audience, subject, sender, reply address or message of a broadcast that has not started sending. */
|
|
824
|
+
update: {
|
|
825
|
+
/** The id of the item. */
|
|
826
|
+
id: string;
|
|
827
|
+
/** A new name. */
|
|
828
|
+
name?: string;
|
|
829
|
+
/** The id of another audience to send to. */
|
|
830
|
+
audienceId?: string;
|
|
831
|
+
/** The id of another topic, or `null` to send on no topic. */
|
|
832
|
+
topicId?: string | null;
|
|
833
|
+
/** A new subject line. */
|
|
834
|
+
subject?: string;
|
|
835
|
+
/** A new sender, on a verified domain. */
|
|
836
|
+
from?: string;
|
|
837
|
+
/** A new address for replies. Empty to leave it to the default of the workspace, or to the sender when there is none. */
|
|
838
|
+
replyTo?: "" | string;
|
|
839
|
+
/** New HTML, or `null` to remove it. A broadcast built from blocks takes `design` in its place. */
|
|
840
|
+
html?: string | null;
|
|
841
|
+
/** New plain text, or `null` to remove it. A broadcast built from blocks takes `design` in its place. */
|
|
842
|
+
text?: string | null;
|
|
843
|
+
/** New blocks, as the whole design. The HTML and the plain text are made from them again. `null` turns the broadcast into one written as HTML, which keeps the HTML and the plain text it has unless they come with it. */
|
|
844
|
+
design?: {
|
|
845
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
846
|
+
preview?: string;
|
|
847
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
848
|
+
style?: {
|
|
849
|
+
[key: string]: string | number;
|
|
850
|
+
};
|
|
851
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
852
|
+
dark?: {
|
|
853
|
+
[key: string]: string | number;
|
|
854
|
+
};
|
|
855
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
856
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
857
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
858
|
+
css?: string;
|
|
859
|
+
/** The blocks of the message, from top to bottom. */
|
|
860
|
+
body: BroadcastsCreateInputDesignBody[];
|
|
861
|
+
} | null;
|
|
862
|
+
};
|
|
863
|
+
/** Send broadcast. Schedules a broadcast for now, or for a later time, to everyone subscribed to its audience. */
|
|
864
|
+
send: {
|
|
865
|
+
/** The id of the item. */
|
|
866
|
+
id: string;
|
|
867
|
+
/** When to start sending, as an ISO 8601 time such as `2026-12-01T09:00:00Z`. Without it the broadcast starts now. */
|
|
868
|
+
scheduledAt?: string;
|
|
869
|
+
};
|
|
870
|
+
/** Send test of broadcast. Sends the broadcast as it is saved now to the addresses you give, with "[Test]" before the subject, and leaves the broadcast as it is. It needs a sender, a subject and a message. It is a real email and counts as one. A test key may send it to test addresses only, and the email is then simulated. */
|
|
871
|
+
test: {
|
|
872
|
+
/** The id of the item. */
|
|
873
|
+
id: string;
|
|
874
|
+
/** Who gets the test: one address, or up to 50. */
|
|
875
|
+
to: string | string[];
|
|
876
|
+
};
|
|
877
|
+
/** Duplicate broadcast. Copies a broadcast into a new draft: its audience, sender, subject and message. It works on one that was already sent, and the copy is not scheduled. */
|
|
878
|
+
duplicate: {
|
|
879
|
+
/** The id of the item. */
|
|
880
|
+
id: string;
|
|
881
|
+
/** A name for the copy. Without it the name gets "(copy)" added. */
|
|
882
|
+
name?: string;
|
|
883
|
+
};
|
|
884
|
+
/** Retrieve broadcast. One broadcast with its audience, its schedule and how many it reached. */
|
|
885
|
+
get: {
|
|
886
|
+
/** The id of the item. */
|
|
887
|
+
id: string;
|
|
888
|
+
};
|
|
889
|
+
/** List broadcasts. The broadcasts of the workspace, newest first, by status and audience. */
|
|
890
|
+
list: {
|
|
891
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
892
|
+
q?: string;
|
|
893
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
894
|
+
limit?: number;
|
|
895
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
896
|
+
offset?: number;
|
|
897
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
898
|
+
after?: string;
|
|
899
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
900
|
+
before?: string;
|
|
901
|
+
/** Only broadcasts in this state: `draft`, `scheduled`, `sending` or `sent`. */
|
|
902
|
+
status?: "draft" | "scheduled" | "sent" | "sending";
|
|
903
|
+
/** Only broadcasts for this audience. */
|
|
904
|
+
audienceId?: string;
|
|
905
|
+
};
|
|
906
|
+
/** Delete broadcast. Deletes a broadcast. A scheduled one is never sent. */
|
|
907
|
+
remove: {
|
|
908
|
+
/** The id of the item. */
|
|
909
|
+
id: string;
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
audiences: {
|
|
913
|
+
/** Create audience. Creates an empty audience that contacts can join and broadcasts can be sent to. */
|
|
914
|
+
create: {
|
|
915
|
+
/** A name for the audience, such as `Newsletter`. */
|
|
916
|
+
name: string;
|
|
917
|
+
};
|
|
918
|
+
/** List audiences. The audiences of the workspace with how many contacts each holds. */
|
|
919
|
+
list: {
|
|
920
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
921
|
+
q?: string;
|
|
922
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
923
|
+
limit?: number;
|
|
924
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
925
|
+
offset?: number;
|
|
926
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
927
|
+
after?: string;
|
|
928
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
929
|
+
before?: string;
|
|
930
|
+
/** The period to look at: `today`, `week`, `month`, `year`, `all` or `custom`. Without it there is no limit in time. */
|
|
931
|
+
range?: "today" | "week" | "month" | "year" | "all" | "custom";
|
|
932
|
+
/** The first day of a `custom` period, as a date such as `2026-11-01`. */
|
|
933
|
+
from?: string;
|
|
934
|
+
/** The last day of a `custom` period, as a date such as `2026-11-30`. */
|
|
935
|
+
to?: string;
|
|
936
|
+
/** Only the audiences this contact is in, by the id of the contact or their address. */
|
|
937
|
+
contact?: string;
|
|
938
|
+
};
|
|
939
|
+
/** Retrieve audience. One audience with how many contacts it holds. */
|
|
940
|
+
get: {
|
|
941
|
+
/** The id of the item. */
|
|
942
|
+
id: string;
|
|
943
|
+
};
|
|
944
|
+
/** Rename audience. Gives an audience another name. Its contacts and its broadcasts stay as they are. */
|
|
945
|
+
update: {
|
|
946
|
+
/** The id of the item. */
|
|
947
|
+
id: string;
|
|
948
|
+
/** The new name of the audience. */
|
|
949
|
+
name: string;
|
|
950
|
+
};
|
|
951
|
+
/** Delete audience. Deletes an audience. Its contacts stay in the workspace and in their other audiences. */
|
|
952
|
+
remove: {
|
|
953
|
+
/** The id of the item. */
|
|
954
|
+
id: string;
|
|
955
|
+
};
|
|
956
|
+
/** Add contact to audience. Puts a contact of the workspace into an audience. A contact can be in many, and one that is already in it stays as it is. */
|
|
957
|
+
join: {
|
|
958
|
+
/** The id of the audience. */
|
|
959
|
+
id: string;
|
|
960
|
+
/** The id of the contact, or their address. */
|
|
961
|
+
contact: string;
|
|
962
|
+
};
|
|
963
|
+
/** Remove contact from audience. Takes a contact out of one audience. The contact stays in the workspace and in their other audiences. */
|
|
964
|
+
leave: {
|
|
965
|
+
/** The id of the audience. */
|
|
966
|
+
id: string;
|
|
967
|
+
/** The id of the contact, or their address. */
|
|
968
|
+
contact: string;
|
|
969
|
+
};
|
|
970
|
+
};
|
|
971
|
+
templates: {
|
|
972
|
+
/** Create template. Creates a draft template: a subject and HTML, and when you want them a plain text version, a sender, a reply address and defaults for its variables. Give `design` to build it from blocks, or `starter` to begin with a ready-made one. Its alias is made from its name unless you give one. */
|
|
973
|
+
create: {
|
|
974
|
+
/** A name for the template. */
|
|
975
|
+
name: string;
|
|
976
|
+
/** A short name of your own to send with. Without it one is made from the name. */
|
|
977
|
+
alias?: string;
|
|
978
|
+
/** The subject line. `{{NAME}}` marks a variable. */
|
|
979
|
+
subject?: string;
|
|
980
|
+
/** The HTML of the message. `{{NAME}}` marks a variable. Leave it out with `design`. */
|
|
981
|
+
html?: string;
|
|
982
|
+
/** The message as blocks, in place of `html` and `text`, which are then made from it. `null` or nothing for a template written as HTML. */
|
|
983
|
+
design?: {
|
|
984
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
985
|
+
preview?: string;
|
|
986
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
987
|
+
style?: {
|
|
988
|
+
[key: string]: string | number;
|
|
989
|
+
};
|
|
990
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
991
|
+
dark?: {
|
|
992
|
+
[key: string]: string | number;
|
|
993
|
+
};
|
|
994
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
995
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
996
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
997
|
+
css?: string;
|
|
998
|
+
/** The blocks of the message, from top to bottom. */
|
|
999
|
+
body: BroadcastsCreateInputDesignBody[];
|
|
1000
|
+
} | null;
|
|
1001
|
+
/** The id of a ready-made template to start from, such as `welcome`, in place of `design` and `html`. `templates.starters` lists them. */
|
|
1002
|
+
starter?: string;
|
|
1003
|
+
/** The look the starter is drawn in: `minimal`, `modern`, `bold`, `classic`, `dark` or `soft`. Without it, the default style of the starter. It goes with `starter` only. */
|
|
1004
|
+
style?: "minimal" | "modern" | "bold" | "classic" | "dark" | "soft";
|
|
1005
|
+
/** The message as plain text, for mail apps that show no HTML. `{{NAME}}` marks a variable. `null` for none. */
|
|
1006
|
+
text?: string | null;
|
|
1007
|
+
/** The sender an email built from it gets when the send names none, such as `Acme <hello@mail.example.com>`. Empty for none. */
|
|
1008
|
+
from?: "" | string;
|
|
1009
|
+
/** The address replies go to when the send names none. Empty to leave it to the default of the workspace. */
|
|
1010
|
+
replyTo?: "" | string;
|
|
1011
|
+
/** A value for a variable, by name, used when a send gives none for it, such as `{ "PLAN": "Free" }`. It replaces the defaults saved before. */
|
|
1012
|
+
defaults?: {
|
|
1013
|
+
[key: string]: string;
|
|
1014
|
+
};
|
|
1015
|
+
};
|
|
1016
|
+
/** Get template. One template with its subject, HTML, plain text, sender and defaults. */
|
|
1017
|
+
get: {
|
|
1018
|
+
/** The id of the item. */
|
|
1019
|
+
id: string;
|
|
1020
|
+
};
|
|
1021
|
+
/** List templates. The templates of the workspace, newest first, by status and search. */
|
|
1022
|
+
list: {
|
|
1023
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
1024
|
+
q?: string;
|
|
1025
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1026
|
+
limit?: number;
|
|
1027
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1028
|
+
offset?: number;
|
|
1029
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
1030
|
+
after?: string;
|
|
1031
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
1032
|
+
before?: string;
|
|
1033
|
+
/** Only templates in this state: `draft` or `published`. */
|
|
1034
|
+
status?: "draft" | "published";
|
|
1035
|
+
};
|
|
1036
|
+
/** Update template. Changes a template: its name, alias, subject, HTML, plain text, sender, reply address or the defaults of its variables. What was published keeps being sent until the template is published again. */
|
|
1037
|
+
update: {
|
|
1038
|
+
/** The id of the item. */
|
|
1039
|
+
id: string;
|
|
1040
|
+
/** A new name. */
|
|
1041
|
+
name?: string;
|
|
1042
|
+
/** A new alias. It has to be free. */
|
|
1043
|
+
alias?: string;
|
|
1044
|
+
/** A new subject line. */
|
|
1045
|
+
subject?: string;
|
|
1046
|
+
/** New HTML. A template built from blocks takes `design` in its place. */
|
|
1047
|
+
html?: string;
|
|
1048
|
+
/** New blocks, as the whole design. The HTML and the plain text are made from them again. To change single blocks, send operations to `templates.edit` in its place. `null` turns the template into one written as HTML, which keeps the HTML it has unless `html` comes with it. */
|
|
1049
|
+
design?: {
|
|
1050
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
1051
|
+
preview?: string;
|
|
1052
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
1053
|
+
style?: {
|
|
1054
|
+
[key: string]: string | number;
|
|
1055
|
+
};
|
|
1056
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
1057
|
+
dark?: {
|
|
1058
|
+
[key: string]: string | number;
|
|
1059
|
+
};
|
|
1060
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
1061
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
1062
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
1063
|
+
css?: string;
|
|
1064
|
+
/** The blocks of the message, from top to bottom. */
|
|
1065
|
+
body: BroadcastsCreateInputDesignBody[];
|
|
1066
|
+
} | null;
|
|
1067
|
+
/** The message as plain text, for mail apps that show no HTML. `{{NAME}}` marks a variable. `null` for none. */
|
|
1068
|
+
text?: string | null;
|
|
1069
|
+
/** The sender an email built from it gets when the send names none, such as `Acme <hello@mail.example.com>`. Empty for none. */
|
|
1070
|
+
from?: "" | string;
|
|
1071
|
+
/** The address replies go to when the send names none. Empty to leave it to the default of the workspace. */
|
|
1072
|
+
replyTo?: "" | string;
|
|
1073
|
+
/** A value for a variable, by name, used when a send gives none for it, such as `{ "PLAN": "Free" }`. It replaces the defaults saved before. */
|
|
1074
|
+
defaults?: {
|
|
1075
|
+
[key: string]: string;
|
|
1076
|
+
};
|
|
1077
|
+
};
|
|
1078
|
+
/** Edit template design. Changes single blocks of a template built from blocks, in place of sending its whole design: add a block, change its fields, its style, its phone style or its dark mode colours, move it, take it out or copy it, or change the style, the dark mode colours, the preview, the fonts or the CSS of the whole message. The operations run in order, and when one is refused nothing is saved. The HTML and the plain text are made from the design again. */
|
|
1079
|
+
edit: {
|
|
1080
|
+
/** The id of the item. */
|
|
1081
|
+
id: string;
|
|
1082
|
+
/** What to change, in order: 1 to 50 operations. Each one works on the design the one before it left, and the design has to hold after each. When one is refused, nothing is saved. */
|
|
1083
|
+
operations: Array<{
|
|
1084
|
+
/** What to do: `insert` adds a block, `update` changes one, `move` puts one somewhere else, `remove` takes one out with everything inside it, `duplicate` copies one right after itself with new ids, and `page` changes the style, the dark mode colours, the preview, the fonts or the CSS of the whole message. */
|
|
1085
|
+
op: "insert" | "update" | "move" | "remove" | "duplicate" | "page";
|
|
1086
|
+
/** For `update`, `move`, `remove` and `duplicate`: the id of the block. */
|
|
1087
|
+
id?: string;
|
|
1088
|
+
/** For `insert`: the block to add, shaped like a block of the `body` of a design, with `children` when it holds other blocks. Without an `id` it gets one. */
|
|
1089
|
+
block?: BroadcastsCreateInputDesignBody;
|
|
1090
|
+
/** For `insert` and `move`: the id of the block that takes it, which is a `Section`, a `Row`, a `Column` or a `Container`. Leave it out, or give `null`, for the top level of the message. */
|
|
1091
|
+
parent?: string | null;
|
|
1092
|
+
/** For `insert` and `move`: where the block ends up among the blocks of its parent, counted from 0. Leave it out for the end. */
|
|
1093
|
+
index?: number;
|
|
1094
|
+
/** For `update`: the fields of the block to change, by name. A field set to `null` is taken off the block. */
|
|
1095
|
+
set?: {
|
|
1096
|
+
/** Where the block sits across its line: `left`, `center` or `right`. */
|
|
1097
|
+
align?: "left" | "center" | "right" | null;
|
|
1098
|
+
/** Class names for the block, one or several with one space between them, such as `hero wide`, 200 characters at most. The `css` of the design reaches the block by them. A name cannot start with `r-`. */
|
|
1099
|
+
className?: string | null;
|
|
1100
|
+
/** The one kind of screen the block shows on: `desktop` hides it on a phone, and `phone` shows it on a phone and nowhere else. Without it, the block shows everywhere. */
|
|
1101
|
+
only?: "desktop" | "phone" | null;
|
|
1102
|
+
/** The words of a block that holds text, up to 20000 characters. `{{NAME}}` marks a variable. A `Markdown` block takes Markdown here, a `CodeBlock` takes the code and an `Html` block takes its HTML, up to 60000 characters. */
|
|
1103
|
+
text?: string | null;
|
|
1104
|
+
/** Where a `Button` or a `Link` leads: a full address, or one variable as the whole value, such as `{{URL}}`. */
|
|
1105
|
+
href?: string | null;
|
|
1106
|
+
/** Where the link opens: `_blank` for a new tab or `_self`. Without it, `_blank`. */
|
|
1107
|
+
target?: "_blank" | "_self" | null;
|
|
1108
|
+
/** The address of the picture of an `Img`: a full address, or one variable as the whole value. */
|
|
1109
|
+
src?: string | null;
|
|
1110
|
+
/** What the picture of an `Img` shows, in words, for someone who cannot see it. */
|
|
1111
|
+
alt?: string | null;
|
|
1112
|
+
/** The width of an `Img` or a `Column`: a number of pixels, or a length such as `50%`. */
|
|
1113
|
+
width?: string | number | null;
|
|
1114
|
+
/** The height of an `Img`: a number of pixels, or a length. */
|
|
1115
|
+
height?: string | number | null;
|
|
1116
|
+
/** Where the content of a `Column` sits: `top`, `middle` or `bottom`. */
|
|
1117
|
+
valign?: "top" | "middle" | "bottom" | null;
|
|
1118
|
+
/** The level of a `Heading`, from `h1` to `h6`. Without it, `h1`. */
|
|
1119
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
|
|
1120
|
+
/** The language of a `CodeBlock`, such as `typescript` or `bash`. One it does not know is shown as plain text. */
|
|
1121
|
+
language?: string | null;
|
|
1122
|
+
/** The colours of a `CodeBlock`: `oneDark`, `oneLight`, `dracula`, `nord`, `vscDarkPlus`, `vs`, `ghcolors` or `materialLight`. Without it, `oneDark`. */
|
|
1123
|
+
theme?: string | null;
|
|
1124
|
+
/** Whether a `CodeBlock` numbers its lines. */
|
|
1125
|
+
lineNumbers?: boolean | null;
|
|
1126
|
+
/** `true` puts the columns of a `Row` under each other on a phone. Only a `Row` takes it. */
|
|
1127
|
+
stack?: boolean | null;
|
|
1128
|
+
};
|
|
1129
|
+
/** For `update` and `page`: CSS to merge into the style of the block or of the whole message, by property name. A property set to `null` is taken out. */
|
|
1130
|
+
style?: {
|
|
1131
|
+
[key: string]: string | number | null;
|
|
1132
|
+
};
|
|
1133
|
+
/** For `page`: the line a mail app shows beside the subject before the message is opened. `null` takes it out. */
|
|
1134
|
+
preview?: string | null;
|
|
1135
|
+
/** For `page`: the fonts of the message as the whole list, each shaped like a font of a design. `null` takes them all out. */
|
|
1136
|
+
fonts?: BroadcastsCreateInputDesignFonts[] | null;
|
|
1137
|
+
/** For `update`: CSS to merge into the phone style of the block, by property name. A property set to `null` is taken out. */
|
|
1138
|
+
phone?: {
|
|
1139
|
+
[key: string]: string | number | null;
|
|
1140
|
+
};
|
|
1141
|
+
/** For `update` and `page`: colours to merge into the dark mode colours of the block or of the whole message, by property name. A property set to `null` is taken out. */
|
|
1142
|
+
dark?: {
|
|
1143
|
+
[key: string]: string | number | null;
|
|
1144
|
+
};
|
|
1145
|
+
/** For `page`: the CSS of the whole message, as the whole text. `null` takes it out. */
|
|
1146
|
+
css?: string | null;
|
|
1147
|
+
}>;
|
|
1148
|
+
};
|
|
1149
|
+
/** Publish template. Publishes a template as it is now, so emails can use it. Later edits are not sent until it is published again. */
|
|
1150
|
+
publish: {
|
|
1151
|
+
/** The id of the item. */
|
|
1152
|
+
id: string;
|
|
1153
|
+
};
|
|
1154
|
+
/** Send test of template. Sends the template as it is saved now, published or not, to the addresses you give, with "[Test]" before the subject. It needs a subject and a message. It is a real email and counts as one. A test key may send it to test addresses only, and the email is then simulated. */
|
|
1155
|
+
test: {
|
|
1156
|
+
/** The id of the item. */
|
|
1157
|
+
id: string;
|
|
1158
|
+
/** Who gets the test: one address, or up to 50. */
|
|
1159
|
+
to: string | string[];
|
|
1160
|
+
/** The sender of the test, on a verified domain. Without it, the one of the template. */
|
|
1161
|
+
from?: string;
|
|
1162
|
+
/** A value for a variable, by name, for this test only. A variable with no value and no default stays in the message as `{{NAME}}`. */
|
|
1163
|
+
variables?: {
|
|
1164
|
+
[key: string]: string;
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1167
|
+
/** Render template design. Turns a design, the blocks a template can be built from, into the HTML and the plain text an email gets from it. Nothing is saved and nothing is sent. Give values for variables to see the message filled in. */
|
|
1168
|
+
render: {
|
|
1169
|
+
/** The blocks to render, shaped like the `design` of a template. */
|
|
1170
|
+
design: {
|
|
1171
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
1172
|
+
preview?: string;
|
|
1173
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
1174
|
+
style?: {
|
|
1175
|
+
[key: string]: string | number;
|
|
1176
|
+
};
|
|
1177
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
1178
|
+
dark?: {
|
|
1179
|
+
[key: string]: string | number;
|
|
1180
|
+
};
|
|
1181
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
1182
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
1183
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
1184
|
+
css?: string;
|
|
1185
|
+
/** The blocks of the message, from top to bottom. */
|
|
1186
|
+
body: BroadcastsCreateInputDesignBody[];
|
|
1187
|
+
};
|
|
1188
|
+
/** A value for a variable, by name. A variable with no value stays in the result as `{{NAME}}`. */
|
|
1189
|
+
variables?: {
|
|
1190
|
+
[key: string]: string;
|
|
1191
|
+
};
|
|
1192
|
+
/** `true` to mark every block in the HTML with `data-block` and its id, every variable in text with `data-variable` and its name, and the wrapper of custom code with `data-raw`, so an editor can find them. Leave it out for the HTML a template stores and sends. */
|
|
1193
|
+
marks?: boolean;
|
|
1194
|
+
};
|
|
1195
|
+
/** Duplicate template. Copies a template as it is saved now into a new draft, with a free alias. The copy is not published. */
|
|
1196
|
+
duplicate: {
|
|
1197
|
+
/** The id of the item. */
|
|
1198
|
+
id: string;
|
|
1199
|
+
/** A name for the copy. Without it the name gets "(copy)" added. */
|
|
1200
|
+
name?: string;
|
|
1201
|
+
};
|
|
1202
|
+
/** List template versions. The versions of one template, newest first. Every publish that changes something makes one, and the last 50 are kept. */
|
|
1203
|
+
versions: {
|
|
1204
|
+
/** The id of the item. */
|
|
1205
|
+
id: string;
|
|
1206
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1207
|
+
limit?: number;
|
|
1208
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1209
|
+
offset?: number;
|
|
1210
|
+
};
|
|
1211
|
+
/** Get template version. One version of a template with everything it holds: the subject, the HTML, the plain text, the sender, the reply address and the defaults. */
|
|
1212
|
+
version: {
|
|
1213
|
+
/** The id of the item. */
|
|
1214
|
+
id: string;
|
|
1215
|
+
/** The number of the version. The first publish is 1. */
|
|
1216
|
+
version: number;
|
|
1217
|
+
};
|
|
1218
|
+
/** Restore template version. Copies a version back into the template as the copy you edit. What is published keeps being sent until you publish again. */
|
|
1219
|
+
restore: {
|
|
1220
|
+
/** The id of the item. */
|
|
1221
|
+
id: string;
|
|
1222
|
+
/** The number of the version. The first publish is 1. */
|
|
1223
|
+
version: number;
|
|
1224
|
+
};
|
|
1225
|
+
/** Delete template. Deletes a template. Emails already sent with it keep their content. */
|
|
1226
|
+
remove: {
|
|
1227
|
+
/** The id of the item. */
|
|
1228
|
+
id: string;
|
|
1229
|
+
};
|
|
1230
|
+
/** List template starters. The ready-made templates a new template can start from, by kind and search. Each has a name, what it is for, the subject it starts with and the looks it can be drawn in. Its variables and its message come with `templates.starter`. */
|
|
1231
|
+
starters: {
|
|
1232
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1233
|
+
limit?: number;
|
|
1234
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1235
|
+
offset?: number;
|
|
1236
|
+
/** Text to search for. Only starters that have it in their name or their description are returned. */
|
|
1237
|
+
q?: string;
|
|
1238
|
+
/** Only starters of this kind: `account`, `commerce`, `notify`, `marketing`, `events`, `hospitality`, `health`, `education`, `real-estate`, `nonprofit`, `travel`, `recruiting` or `community`. */
|
|
1239
|
+
category?: "account" | "commerce" | "notify" | "marketing" | "events" | "hospitality" | "health" | "education" | "real-estate" | "nonprofit" | "travel" | "recruiting" | "community";
|
|
1240
|
+
};
|
|
1241
|
+
/** Get template starter. One ready-made template drawn in one of its looks: its blocks, the defaults of its variables, and the HTML and the plain text it makes with those defaults filled in. Nothing is saved. To make a template from it, pass its id as `starter` to `templates.create`. */
|
|
1242
|
+
starter: {
|
|
1243
|
+
/** The id of the starter, such as `welcome`. */
|
|
1244
|
+
id: string;
|
|
1245
|
+
/** The look to draw it in: `minimal`, `modern`, `bold`, `classic`, `dark` or `soft`. Without it, the default style of the starter. */
|
|
1246
|
+
style?: "minimal" | "modern" | "bold" | "classic" | "dark" | "soft";
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
automations: {
|
|
1250
|
+
/** Create automation. Creates a draft automation: what starts it, its steps and its rules. Nothing runs until it is published. */
|
|
1251
|
+
create: {
|
|
1252
|
+
/** A name for the automation. */
|
|
1253
|
+
name: string;
|
|
1254
|
+
/** A sentence about what it is for. */
|
|
1255
|
+
description?: string;
|
|
1256
|
+
/** What starts a run. Without it the automation waits for an event you name later. */
|
|
1257
|
+
trigger?: {
|
|
1258
|
+
/** What starts a run: `event` (an event you send, or a built-in one), `schedule` (a time that repeats, for everyone in an audience), `date` (a date on each contact) or `manual` (only when you enrol someone). */
|
|
1259
|
+
kind: "event" | "schedule" | "date" | "manual";
|
|
1260
|
+
/** For `event`: the name of the event, such as `order.paid`. The built-in names are `contact.created`, `contact.updated`, `contact.subscribed`, `contact.unsubscribed`, `email.delivered`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained` and `email.received`. */
|
|
1261
|
+
event?: string;
|
|
1262
|
+
/** The audience the automation is for. Needed for `schedule` and `date`. For `event` it limits the automation to contacts of that audience. */
|
|
1263
|
+
audienceId?: string;
|
|
1264
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
1265
|
+
match?: "all" | "any";
|
|
1266
|
+
/** For `event`: tests the event and the person have to pass to start a run. */
|
|
1267
|
+
conditions?: Array<{
|
|
1268
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
1269
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
1270
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
1271
|
+
field?: string;
|
|
1272
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
1273
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
1274
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
1275
|
+
value?: string | number | boolean;
|
|
1276
|
+
/** For `email`: the id of the step that sent it. */
|
|
1277
|
+
step?: string;
|
|
1278
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
1279
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
1280
|
+
/** For `event` and `waited`: the name of the event. */
|
|
1281
|
+
event?: string;
|
|
1282
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
1283
|
+
withinDays?: number;
|
|
1284
|
+
/** For `audience`: the id of the audience. */
|
|
1285
|
+
audienceId?: string;
|
|
1286
|
+
/** `true` turns the test around. */
|
|
1287
|
+
not?: boolean;
|
|
1288
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
1289
|
+
match?: "all" | "any";
|
|
1290
|
+
/** For `group`: the tests inside it. */
|
|
1291
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
1292
|
+
}>;
|
|
1293
|
+
/** For `schedule`: how often it repeats: `day`, `week` or `month`. */
|
|
1294
|
+
every?: "day" | "week" | "month";
|
|
1295
|
+
/** For `schedule` and `date`: the time of day it starts, as `HH:MM` in the time zone of the automation. */
|
|
1296
|
+
time?: string;
|
|
1297
|
+
/** For a weekly `schedule`: the days it runs on, such as `["mon", "thu"]`. */
|
|
1298
|
+
days?: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
1299
|
+
/** For a monthly `schedule`: the day of the month, from 1 to 28. */
|
|
1300
|
+
dayOfMonth?: number;
|
|
1301
|
+
/** For `date`: the contact property that holds the date, such as `trial_ends_at`. */
|
|
1302
|
+
property?: string;
|
|
1303
|
+
/** For `date`: how many days after the date to start. A negative number starts before it. */
|
|
1304
|
+
offsetDays?: number;
|
|
1305
|
+
/** For `date`: `true` to start every year on that day, as for a birthday. */
|
|
1306
|
+
yearly?: boolean;
|
|
1307
|
+
};
|
|
1308
|
+
/** The steps of the flow. The first one is where a run starts. */
|
|
1309
|
+
steps?: Array<{
|
|
1310
|
+
/** An id for the step, unique in the flow: letters, digits and underscores, starting with a letter. */
|
|
1311
|
+
id: string;
|
|
1312
|
+
/** What the step does: `send_email`, `delay`, `wait_until`, `wait_for_event`, `condition`, `branch`, `split`, `update_contact`, `delete_contact`, `add_to_audience`, `remove_from_audience`, `webhook`, `send_event` or `exit`. */
|
|
1313
|
+
kind: "send_email" | "delay" | "wait_until" | "wait_for_event" | "condition" | "branch" | "split" | "update_contact" | "delete_contact" | "add_to_audience" | "remove_from_audience" | "webhook" | "send_event" | "exit";
|
|
1314
|
+
/** A name of your own for the step. */
|
|
1315
|
+
name?: string;
|
|
1316
|
+
/** The id of the step that follows, or `null` to end the run here. Without it the step after this one in the list follows. */
|
|
1317
|
+
next?: string | null;
|
|
1318
|
+
/** For `condition`, `split` and `wait_for_event`: the step that follows when the condition holds, the person lands in the first share, or the event arrives. `null` ends the run. */
|
|
1319
|
+
yes?: string | null;
|
|
1320
|
+
/** For `condition`, `split` and `wait_for_event`: the step that follows otherwise. For `branch`: the step that follows when no path holds. `null` ends the run. */
|
|
1321
|
+
no?: string | null;
|
|
1322
|
+
/** For `send_email`: the sender, on a verified domain, such as `Acme <hello@mail.example.com>`. With a template that has a sender it can be left out. */
|
|
1323
|
+
from?: string;
|
|
1324
|
+
/** For `send_email`: another recipient than the person of the run, such as a team address. */
|
|
1325
|
+
to?: string;
|
|
1326
|
+
/** For `send_email`: the address replies go to. Without it, the one of the template when it has one, then the default of the workspace. */
|
|
1327
|
+
replyTo?: string;
|
|
1328
|
+
/** For `send_email`: the subject line. `{{name}}` slots are filled in. */
|
|
1329
|
+
subject?: string;
|
|
1330
|
+
/** For `send_email`: the message as HTML. `{{name}}` slots are filled in. */
|
|
1331
|
+
html?: string;
|
|
1332
|
+
/** For `send_email`: the message as plain text. With a template it replaces the plain text of the template. */
|
|
1333
|
+
text?: string;
|
|
1334
|
+
/** For `send_email`: the id or the alias of a published template, in place of `subject`, `html` and `text`. */
|
|
1335
|
+
template?: string;
|
|
1336
|
+
/** For `send_email`: values for `{{name}}` slots, by name. A value can hold slots of its own. A slot with no value takes the default of the template. */
|
|
1337
|
+
variables?: {
|
|
1338
|
+
[key: string]: string;
|
|
1339
|
+
};
|
|
1340
|
+
/** For `delay`: how long to wait. For `wait_for_event`: how long to wait for the event before the `no` path is taken. For `wait_until` with a `date`: how long before or after the date to go on. */
|
|
1341
|
+
amount?: number;
|
|
1342
|
+
/** The unit of `amount`: `minutes`, `hours`, `days` or `weeks`. */
|
|
1343
|
+
unit?: "minutes" | "hours" | "days" | "weeks";
|
|
1344
|
+
/** For `wait_until`: the time of day to go on at, as `HH:MM` in the time zone of the automation. With a `date` that has no time, the time on that day. */
|
|
1345
|
+
time?: string;
|
|
1346
|
+
/** For `wait_until`: a date to wait for, in place of a time of day. An ISO 8601 date or time such as `2026-12-24` or `2026-12-24T18:00:00Z`, a Unix time, or a slot that holds one, such as `{{starts_at}}`. A date that has passed lets the run go on at once. */
|
|
1347
|
+
date?: string;
|
|
1348
|
+
/** For `wait_until` with a `date` and an `amount`: `true` to go on that long before the date, such as a day before. Without it, that long after. */
|
|
1349
|
+
before?: boolean;
|
|
1350
|
+
/** For `wait_until`: the days of the week it may go on, such as `["mon", "tue"]`. Without it, any day. */
|
|
1351
|
+
days?: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
1352
|
+
/** For `wait_for_event`: the name of the event to wait for. For `send_event`: the name of the event to send, one of your own. */
|
|
1353
|
+
event?: string;
|
|
1354
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
1355
|
+
match?: "all" | "any";
|
|
1356
|
+
/** For `condition`: the tests. For `wait_for_event`: tests the event has to pass, where `data` reads the event that arrives. */
|
|
1357
|
+
conditions?: Array<{
|
|
1358
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
1359
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
1360
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
1361
|
+
field?: string;
|
|
1362
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
1363
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
1364
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
1365
|
+
value?: string | number | boolean;
|
|
1366
|
+
/** For `email`: the id of the step that sent it. */
|
|
1367
|
+
step?: string;
|
|
1368
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
1369
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
1370
|
+
/** For `event` and `waited`: the name of the event. */
|
|
1371
|
+
event?: string;
|
|
1372
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
1373
|
+
withinDays?: number;
|
|
1374
|
+
/** For `audience`: the id of the audience. */
|
|
1375
|
+
audienceId?: string;
|
|
1376
|
+
/** `true` turns the test around. */
|
|
1377
|
+
not?: boolean;
|
|
1378
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
1379
|
+
match?: "all" | "any";
|
|
1380
|
+
/** For `group`: the tests inside it. */
|
|
1381
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
1382
|
+
}>;
|
|
1383
|
+
/** For `branch`: two to eight paths, tested in order. A run takes the first one whose conditions hold, and the `no` path when none does. */
|
|
1384
|
+
branches?: Array<{
|
|
1385
|
+
/** What the path is called. It shows on the canvas and in the run. */
|
|
1386
|
+
name: string;
|
|
1387
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
1388
|
+
match?: "all" | "any";
|
|
1389
|
+
/** The tests a run has to pass to take this path, as on a `condition` step. */
|
|
1390
|
+
conditions?: Array<{
|
|
1391
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
1392
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
1393
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
1394
|
+
field?: string;
|
|
1395
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
1396
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
1397
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
1398
|
+
value?: string | number | boolean;
|
|
1399
|
+
/** For `email`: the id of the step that sent it. */
|
|
1400
|
+
step?: string;
|
|
1401
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
1402
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
1403
|
+
/** For `event` and `waited`: the name of the event. */
|
|
1404
|
+
event?: string;
|
|
1405
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
1406
|
+
withinDays?: number;
|
|
1407
|
+
/** For `audience`: the id of the audience. */
|
|
1408
|
+
audienceId?: string;
|
|
1409
|
+
/** `true` turns the test around. */
|
|
1410
|
+
not?: boolean;
|
|
1411
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
1412
|
+
match?: "all" | "any";
|
|
1413
|
+
/** For `group`: the tests inside it. */
|
|
1414
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
1415
|
+
}>;
|
|
1416
|
+
/** The id of the step that follows when this path is taken. `null` ends the run. */
|
|
1417
|
+
to?: string | null;
|
|
1418
|
+
}>;
|
|
1419
|
+
/** For `split`: the share of people, in percent, who take the `yes` path. */
|
|
1420
|
+
percent?: number;
|
|
1421
|
+
/** For `update_contact`: a new first name. */
|
|
1422
|
+
firstName?: string;
|
|
1423
|
+
/** For `update_contact`: a new last name. */
|
|
1424
|
+
lastName?: string;
|
|
1425
|
+
/** For `update_contact`: properties to set, by name. `null` removes one. Text can hold `{{name}}` slots. */
|
|
1426
|
+
properties?: {
|
|
1427
|
+
[key: string]: string | number | boolean | null;
|
|
1428
|
+
};
|
|
1429
|
+
/** For `update_contact`: `subscribed` or `unsubscribed`. */
|
|
1430
|
+
subscription?: "subscribed" | "unsubscribed";
|
|
1431
|
+
/** For `add_to_audience` and `remove_from_audience`: the id of the audience. */
|
|
1432
|
+
audienceId?: string;
|
|
1433
|
+
/** For `webhook`: the id of the webhook that gets an `automation.step` event. */
|
|
1434
|
+
webhookId?: string;
|
|
1435
|
+
/** For `send_event`: values that go with the event, by name. Text can hold `{{name}}` slots. */
|
|
1436
|
+
data?: {
|
|
1437
|
+
[key: string]: string | number | boolean;
|
|
1438
|
+
};
|
|
1439
|
+
}>;
|
|
1440
|
+
/** The rules of the automation. What you leave out keeps its default. */
|
|
1441
|
+
settings?: AutomationsCreateInputSettings;
|
|
1442
|
+
};
|
|
1443
|
+
/** Update automation. Changes the copy you edit: the name, what starts it, its steps or its rules. What is running stays as it was until you publish. */
|
|
1444
|
+
update: {
|
|
1445
|
+
/** The id of the item. */
|
|
1446
|
+
id: string;
|
|
1447
|
+
/** A new name. */
|
|
1448
|
+
name?: string;
|
|
1449
|
+
/** A new sentence about what it is for. */
|
|
1450
|
+
description?: string;
|
|
1451
|
+
/** What starts a run, as it should be saved. */
|
|
1452
|
+
trigger?: {
|
|
1453
|
+
/** What starts a run: `event` (an event you send, or a built-in one), `schedule` (a time that repeats, for everyone in an audience), `date` (a date on each contact) or `manual` (only when you enrol someone). */
|
|
1454
|
+
kind: "event" | "schedule" | "date" | "manual";
|
|
1455
|
+
/** For `event`: the name of the event, such as `order.paid`. The built-in names are `contact.created`, `contact.updated`, `contact.subscribed`, `contact.unsubscribed`, `email.delivered`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained` and `email.received`. */
|
|
1456
|
+
event?: string;
|
|
1457
|
+
/** The audience the automation is for. Needed for `schedule` and `date`. For `event` it limits the automation to contacts of that audience. */
|
|
1458
|
+
audienceId?: string;
|
|
1459
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
1460
|
+
match?: "all" | "any";
|
|
1461
|
+
/** For `event`: tests the event and the person have to pass to start a run. */
|
|
1462
|
+
conditions?: Array<{
|
|
1463
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
1464
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
1465
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
1466
|
+
field?: string;
|
|
1467
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
1468
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
1469
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
1470
|
+
value?: string | number | boolean;
|
|
1471
|
+
/** For `email`: the id of the step that sent it. */
|
|
1472
|
+
step?: string;
|
|
1473
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
1474
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
1475
|
+
/** For `event` and `waited`: the name of the event. */
|
|
1476
|
+
event?: string;
|
|
1477
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
1478
|
+
withinDays?: number;
|
|
1479
|
+
/** For `audience`: the id of the audience. */
|
|
1480
|
+
audienceId?: string;
|
|
1481
|
+
/** `true` turns the test around. */
|
|
1482
|
+
not?: boolean;
|
|
1483
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
1484
|
+
match?: "all" | "any";
|
|
1485
|
+
/** For `group`: the tests inside it. */
|
|
1486
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
1487
|
+
}>;
|
|
1488
|
+
/** For `schedule`: how often it repeats: `day`, `week` or `month`. */
|
|
1489
|
+
every?: "day" | "week" | "month";
|
|
1490
|
+
/** For `schedule` and `date`: the time of day it starts, as `HH:MM` in the time zone of the automation. */
|
|
1491
|
+
time?: string;
|
|
1492
|
+
/** For a weekly `schedule`: the days it runs on, such as `["mon", "thu"]`. */
|
|
1493
|
+
days?: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
1494
|
+
/** For a monthly `schedule`: the day of the month, from 1 to 28. */
|
|
1495
|
+
dayOfMonth?: number;
|
|
1496
|
+
/** For `date`: the contact property that holds the date, such as `trial_ends_at`. */
|
|
1497
|
+
property?: string;
|
|
1498
|
+
/** For `date`: how many days after the date to start. A negative number starts before it. */
|
|
1499
|
+
offsetDays?: number;
|
|
1500
|
+
/** For `date`: `true` to start every year on that day, as for a birthday. */
|
|
1501
|
+
yearly?: boolean;
|
|
1502
|
+
};
|
|
1503
|
+
/** Every step of the flow, as it should be saved. The first one is where a run starts. */
|
|
1504
|
+
steps?: Array<{
|
|
1505
|
+
/** An id for the step, unique in the flow: letters, digits and underscores, starting with a letter. */
|
|
1506
|
+
id: string;
|
|
1507
|
+
/** What the step does: `send_email`, `delay`, `wait_until`, `wait_for_event`, `condition`, `branch`, `split`, `update_contact`, `delete_contact`, `add_to_audience`, `remove_from_audience`, `webhook`, `send_event` or `exit`. */
|
|
1508
|
+
kind: "send_email" | "delay" | "wait_until" | "wait_for_event" | "condition" | "branch" | "split" | "update_contact" | "delete_contact" | "add_to_audience" | "remove_from_audience" | "webhook" | "send_event" | "exit";
|
|
1509
|
+
/** A name of your own for the step. */
|
|
1510
|
+
name?: string;
|
|
1511
|
+
/** The id of the step that follows, or `null` to end the run here. Without it the step after this one in the list follows. */
|
|
1512
|
+
next?: string | null;
|
|
1513
|
+
/** For `condition`, `split` and `wait_for_event`: the step that follows when the condition holds, the person lands in the first share, or the event arrives. `null` ends the run. */
|
|
1514
|
+
yes?: string | null;
|
|
1515
|
+
/** For `condition`, `split` and `wait_for_event`: the step that follows otherwise. For `branch`: the step that follows when no path holds. `null` ends the run. */
|
|
1516
|
+
no?: string | null;
|
|
1517
|
+
/** For `send_email`: the sender, on a verified domain, such as `Acme <hello@mail.example.com>`. With a template that has a sender it can be left out. */
|
|
1518
|
+
from?: string;
|
|
1519
|
+
/** For `send_email`: another recipient than the person of the run, such as a team address. */
|
|
1520
|
+
to?: string;
|
|
1521
|
+
/** For `send_email`: the address replies go to. Without it, the one of the template when it has one, then the default of the workspace. */
|
|
1522
|
+
replyTo?: string;
|
|
1523
|
+
/** For `send_email`: the subject line. `{{name}}` slots are filled in. */
|
|
1524
|
+
subject?: string;
|
|
1525
|
+
/** For `send_email`: the message as HTML. `{{name}}` slots are filled in. */
|
|
1526
|
+
html?: string;
|
|
1527
|
+
/** For `send_email`: the message as plain text. With a template it replaces the plain text of the template. */
|
|
1528
|
+
text?: string;
|
|
1529
|
+
/** For `send_email`: the id or the alias of a published template, in place of `subject`, `html` and `text`. */
|
|
1530
|
+
template?: string;
|
|
1531
|
+
/** For `send_email`: values for `{{name}}` slots, by name. A value can hold slots of its own. A slot with no value takes the default of the template. */
|
|
1532
|
+
variables?: {
|
|
1533
|
+
[key: string]: string;
|
|
1534
|
+
};
|
|
1535
|
+
/** For `delay`: how long to wait. For `wait_for_event`: how long to wait for the event before the `no` path is taken. For `wait_until` with a `date`: how long before or after the date to go on. */
|
|
1536
|
+
amount?: number;
|
|
1537
|
+
/** The unit of `amount`: `minutes`, `hours`, `days` or `weeks`. */
|
|
1538
|
+
unit?: "minutes" | "hours" | "days" | "weeks";
|
|
1539
|
+
/** For `wait_until`: the time of day to go on at, as `HH:MM` in the time zone of the automation. With a `date` that has no time, the time on that day. */
|
|
1540
|
+
time?: string;
|
|
1541
|
+
/** For `wait_until`: a date to wait for, in place of a time of day. An ISO 8601 date or time such as `2026-12-24` or `2026-12-24T18:00:00Z`, a Unix time, or a slot that holds one, such as `{{starts_at}}`. A date that has passed lets the run go on at once. */
|
|
1542
|
+
date?: string;
|
|
1543
|
+
/** For `wait_until` with a `date` and an `amount`: `true` to go on that long before the date, such as a day before. Without it, that long after. */
|
|
1544
|
+
before?: boolean;
|
|
1545
|
+
/** For `wait_until`: the days of the week it may go on, such as `["mon", "tue"]`. Without it, any day. */
|
|
1546
|
+
days?: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
1547
|
+
/** For `wait_for_event`: the name of the event to wait for. For `send_event`: the name of the event to send, one of your own. */
|
|
1548
|
+
event?: string;
|
|
1549
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
1550
|
+
match?: "all" | "any";
|
|
1551
|
+
/** For `condition`: the tests. For `wait_for_event`: tests the event has to pass, where `data` reads the event that arrives. */
|
|
1552
|
+
conditions?: Array<{
|
|
1553
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
1554
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
1555
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
1556
|
+
field?: string;
|
|
1557
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
1558
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
1559
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
1560
|
+
value?: string | number | boolean;
|
|
1561
|
+
/** For `email`: the id of the step that sent it. */
|
|
1562
|
+
step?: string;
|
|
1563
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
1564
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
1565
|
+
/** For `event` and `waited`: the name of the event. */
|
|
1566
|
+
event?: string;
|
|
1567
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
1568
|
+
withinDays?: number;
|
|
1569
|
+
/** For `audience`: the id of the audience. */
|
|
1570
|
+
audienceId?: string;
|
|
1571
|
+
/** `true` turns the test around. */
|
|
1572
|
+
not?: boolean;
|
|
1573
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
1574
|
+
match?: "all" | "any";
|
|
1575
|
+
/** For `group`: the tests inside it. */
|
|
1576
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
1577
|
+
}>;
|
|
1578
|
+
/** For `branch`: two to eight paths, tested in order. A run takes the first one whose conditions hold, and the `no` path when none does. */
|
|
1579
|
+
branches?: Array<{
|
|
1580
|
+
/** What the path is called. It shows on the canvas and in the run. */
|
|
1581
|
+
name: string;
|
|
1582
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
1583
|
+
match?: "all" | "any";
|
|
1584
|
+
/** The tests a run has to pass to take this path, as on a `condition` step. */
|
|
1585
|
+
conditions?: Array<{
|
|
1586
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
1587
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
1588
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
1589
|
+
field?: string;
|
|
1590
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
1591
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
1592
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
1593
|
+
value?: string | number | boolean;
|
|
1594
|
+
/** For `email`: the id of the step that sent it. */
|
|
1595
|
+
step?: string;
|
|
1596
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
1597
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
1598
|
+
/** For `event` and `waited`: the name of the event. */
|
|
1599
|
+
event?: string;
|
|
1600
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
1601
|
+
withinDays?: number;
|
|
1602
|
+
/** For `audience`: the id of the audience. */
|
|
1603
|
+
audienceId?: string;
|
|
1604
|
+
/** `true` turns the test around. */
|
|
1605
|
+
not?: boolean;
|
|
1606
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
1607
|
+
match?: "all" | "any";
|
|
1608
|
+
/** For `group`: the tests inside it. */
|
|
1609
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
1610
|
+
}>;
|
|
1611
|
+
/** The id of the step that follows when this path is taken. `null` ends the run. */
|
|
1612
|
+
to?: string | null;
|
|
1613
|
+
}>;
|
|
1614
|
+
/** For `split`: the share of people, in percent, who take the `yes` path. */
|
|
1615
|
+
percent?: number;
|
|
1616
|
+
/** For `update_contact`: a new first name. */
|
|
1617
|
+
firstName?: string;
|
|
1618
|
+
/** For `update_contact`: a new last name. */
|
|
1619
|
+
lastName?: string;
|
|
1620
|
+
/** For `update_contact`: properties to set, by name. `null` removes one. Text can hold `{{name}}` slots. */
|
|
1621
|
+
properties?: {
|
|
1622
|
+
[key: string]: string | number | boolean | null;
|
|
1623
|
+
};
|
|
1624
|
+
/** For `update_contact`: `subscribed` or `unsubscribed`. */
|
|
1625
|
+
subscription?: "subscribed" | "unsubscribed";
|
|
1626
|
+
/** For `add_to_audience` and `remove_from_audience`: the id of the audience. */
|
|
1627
|
+
audienceId?: string;
|
|
1628
|
+
/** For `webhook`: the id of the webhook that gets an `automation.step` event. */
|
|
1629
|
+
webhookId?: string;
|
|
1630
|
+
/** For `send_event`: values that go with the event, by name. Text can hold `{{name}}` slots. */
|
|
1631
|
+
data?: {
|
|
1632
|
+
[key: string]: string | number | boolean;
|
|
1633
|
+
};
|
|
1634
|
+
}>;
|
|
1635
|
+
/** The rules to change. What you leave out stays as it is. */
|
|
1636
|
+
settings?: AutomationsCreateInputSettings;
|
|
1637
|
+
};
|
|
1638
|
+
/** Publish automation. Makes the copy you edit the one that runs, as a new version, and starts a draft. People already in it finish the version they entered on. It is refused while something is missing, and the answer says what. */
|
|
1639
|
+
publish: {
|
|
1640
|
+
/** The id of the item. */
|
|
1641
|
+
id: string;
|
|
1642
|
+
};
|
|
1643
|
+
/** Pause automation. Pauses an active automation, so nobody new enters. The people already in it are held where they are, finish, or are taken out, as you choose. */
|
|
1644
|
+
pause: {
|
|
1645
|
+
/** The id of the item. */
|
|
1646
|
+
id: string;
|
|
1647
|
+
/** What happens to the people already in it: `hold` keeps them where they are until you resume, `finish` lets them go on to the end, `cancel` ends their runs. Without it they are held. */
|
|
1648
|
+
runs?: "hold" | "finish" | "cancel";
|
|
1649
|
+
};
|
|
1650
|
+
/** Resume automation. Starts a paused automation again. The people who were held go on from where they stopped. */
|
|
1651
|
+
resume: {
|
|
1652
|
+
/** The id of the item. */
|
|
1653
|
+
id: string;
|
|
1654
|
+
};
|
|
1655
|
+
/** Test automation. Walks the copy you edit once, now, for one address. Its emails are really sent, with "[Test]" before the subject. Waits are skipped, a wait for an event takes its `no` path, and steps that change contacts or call webhooks are skipped. Nothing is counted. */
|
|
1656
|
+
test: {
|
|
1657
|
+
/** The id of the item. */
|
|
1658
|
+
id: string;
|
|
1659
|
+
/** Where the emails of the test go. */
|
|
1660
|
+
email: string;
|
|
1661
|
+
/** Data to run it with, as an event would carry. */
|
|
1662
|
+
data?: {
|
|
1663
|
+
[key: string]: unknown;
|
|
1664
|
+
};
|
|
1665
|
+
};
|
|
1666
|
+
/** Enrol in automation. Starts a run of an active automation for one person, whatever its trigger is. The rule for entering again still holds. */
|
|
1667
|
+
enroll: {
|
|
1668
|
+
/** The id of the item. */
|
|
1669
|
+
id: string;
|
|
1670
|
+
/** The address of the person. Give this or `contactId`. */
|
|
1671
|
+
email?: string;
|
|
1672
|
+
/** The id of a contact. Give this or `email`. */
|
|
1673
|
+
contactId?: string;
|
|
1674
|
+
/** Data for the run, as an event would carry. Its values fill `{{name}}` slots. */
|
|
1675
|
+
data?: {
|
|
1676
|
+
[key: string]: unknown;
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
/** Duplicate automation. Copies the automation you edit into a new draft, with its trigger, steps and rules. */
|
|
1680
|
+
duplicate: {
|
|
1681
|
+
/** The id of the item. */
|
|
1682
|
+
id: string;
|
|
1683
|
+
/** A name for the copy. Without it the name gets "(copy)" added. */
|
|
1684
|
+
name?: string;
|
|
1685
|
+
};
|
|
1686
|
+
/** Retrieve automation. One automation: the copy you edit with what is missing in it, and what happened at each step. */
|
|
1687
|
+
get: {
|
|
1688
|
+
/** The id of the item. */
|
|
1689
|
+
id: string;
|
|
1690
|
+
};
|
|
1691
|
+
/** List automations. The automations of the workspace, newest first, by status and search, each with what its runs have done. */
|
|
1692
|
+
list: {
|
|
1693
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
1694
|
+
q?: string;
|
|
1695
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1696
|
+
limit?: number;
|
|
1697
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1698
|
+
offset?: number;
|
|
1699
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
1700
|
+
after?: string;
|
|
1701
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
1702
|
+
before?: string;
|
|
1703
|
+
/** Only automations in this state: `draft`, `active` or `paused`. */
|
|
1704
|
+
status?: "draft" | "active" | "paused";
|
|
1705
|
+
};
|
|
1706
|
+
/** Delete automation. Deletes an automation with its versions. The runs still going end at their next step. */
|
|
1707
|
+
remove: {
|
|
1708
|
+
/** The id of the item. */
|
|
1709
|
+
id: string;
|
|
1710
|
+
};
|
|
1711
|
+
};
|
|
1712
|
+
runs: {
|
|
1713
|
+
/** List runs. The runs of one automation, newest first: one for each time a person went through it, by status and address. */
|
|
1714
|
+
list: {
|
|
1715
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
1716
|
+
q?: string;
|
|
1717
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1718
|
+
limit?: number;
|
|
1719
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1720
|
+
offset?: number;
|
|
1721
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
1722
|
+
after?: string;
|
|
1723
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
1724
|
+
before?: string;
|
|
1725
|
+
/** The id of the automation. */
|
|
1726
|
+
automationId: string;
|
|
1727
|
+
/** Only runs in this state: `running`, `waiting`, `completed`, `exited`, `failed` or `canceled`. */
|
|
1728
|
+
status?: "running" | "waiting" | "completed" | "exited" | "failed" | "canceled";
|
|
1729
|
+
};
|
|
1730
|
+
/** Retrieve run. One run with the data that started it and what each step did. */
|
|
1731
|
+
get: {
|
|
1732
|
+
/** The id of the item. */
|
|
1733
|
+
id: string;
|
|
1734
|
+
/** The id of the automation. */
|
|
1735
|
+
automationId: string;
|
|
1736
|
+
};
|
|
1737
|
+
/** Cancel run. Takes one person out of an automation. Emails already sent are not recalled. */
|
|
1738
|
+
cancel: {
|
|
1739
|
+
/** The id of the item. */
|
|
1740
|
+
id: string;
|
|
1741
|
+
/** The id of the automation. */
|
|
1742
|
+
automationId: string;
|
|
1743
|
+
};
|
|
1744
|
+
/** Retry run. Lets a run that failed go on from the step it failed at, on the version it entered with. An email it failed to send is really sent this time. It is refused for a run that did not fail. */
|
|
1745
|
+
retry: {
|
|
1746
|
+
/** The id of the item. */
|
|
1747
|
+
id: string;
|
|
1748
|
+
/** The id of the automation. */
|
|
1749
|
+
automationId: string;
|
|
1750
|
+
};
|
|
1751
|
+
};
|
|
1752
|
+
events: {
|
|
1753
|
+
/** Send event. Tells the workspace that something happened to one person. Every active automation that listens for the event starts a run, runs that wait for it go on, and runs it is an exit for end. The answer says how many of each. */
|
|
1754
|
+
send: {
|
|
1755
|
+
/** The name of the event, such as `order.paid`. A new name is defined as it is sent. */
|
|
1756
|
+
name: string;
|
|
1757
|
+
/** The address of the person it is about. Give this or `contactId`. */
|
|
1758
|
+
email?: string;
|
|
1759
|
+
/** The id of the contact it is about. Give this or `email`. */
|
|
1760
|
+
contactId?: string;
|
|
1761
|
+
/** Values that come with the event, up to 10 KB. They fill `{{name}}` slots in emails and can be tested by conditions. */
|
|
1762
|
+
data?: {
|
|
1763
|
+
[key: string]: unknown;
|
|
1764
|
+
};
|
|
1765
|
+
/** A key of your own that makes a repeat of this request answer with the first result and start nothing. The `Idempotency-Key` header does the same. */
|
|
1766
|
+
idempotencyKey?: string;
|
|
1767
|
+
};
|
|
1768
|
+
/** Define event. Defines an event before it is sent, with the types its data has to carry. An event that is sent without being defined defines itself, with no types. */
|
|
1769
|
+
create: {
|
|
1770
|
+
/** A name for the event, such as `order.paid`: letters, digits, dots, dashes, colons and underscores. */
|
|
1771
|
+
name: string;
|
|
1772
|
+
/** The type of each value its data has to carry, by name: `string`, `number`, `boolean` or `date`. Without it the event takes any data. */
|
|
1773
|
+
schema?: {
|
|
1774
|
+
[key: string]: "string" | "number" | "boolean" | "date";
|
|
1775
|
+
};
|
|
1776
|
+
};
|
|
1777
|
+
/** List events. The events the workspace knows, newest first, each with how often it was sent and when last. */
|
|
1778
|
+
list: EventsListInput;
|
|
1779
|
+
/** Retrieve event. One event by its id or its name, with the latest times it was sent and what each one set off. */
|
|
1780
|
+
get: {
|
|
1781
|
+
/** The id or the name of the event. */
|
|
1782
|
+
id: string;
|
|
1783
|
+
};
|
|
1784
|
+
/** Update event. Changes the types the data of an event has to carry, or clears them. */
|
|
1785
|
+
update: {
|
|
1786
|
+
/** The id or the name of the event. */
|
|
1787
|
+
id: string;
|
|
1788
|
+
/** The type of each value its data has to carry, by name, or `null` to take any data. */
|
|
1789
|
+
schema: {
|
|
1790
|
+
[key: string]: "string" | "number" | "boolean" | "date";
|
|
1791
|
+
} | null;
|
|
1792
|
+
};
|
|
1793
|
+
/** Delete event. Forgets an event and its types. Automations that listen for its name keep listening, what was received stays listed for ninety days, and sending it again defines it again. */
|
|
1794
|
+
remove: {
|
|
1795
|
+
/** The id or the name of the event. */
|
|
1796
|
+
id: string;
|
|
1797
|
+
};
|
|
1798
|
+
};
|
|
1799
|
+
metrics: {
|
|
1800
|
+
/** Retrieve metrics. Volume, delivery and engagement for a period: totals, rates, one row a day and one row a domain. */
|
|
1801
|
+
get: {
|
|
1802
|
+
/** The period to count: `today`, `week`, `month`, `year`, `all` or `custom`. Without it you get the last month. */
|
|
1803
|
+
range?: "today" | "week" | "month" | "year" | "all" | "custom";
|
|
1804
|
+
/** The first day of a `custom` period, as a date such as `2026-11-01`. */
|
|
1805
|
+
from?: string;
|
|
1806
|
+
/** The last day of a `custom` period, as a date such as `2026-11-30`. */
|
|
1807
|
+
to?: string;
|
|
1808
|
+
/** Only mail sent from this domain. */
|
|
1809
|
+
domain?: string;
|
|
1810
|
+
};
|
|
1811
|
+
};
|
|
1812
|
+
domains: {
|
|
1813
|
+
/** Add domain. Adds a domain to the workspace and returns the DNS records to publish before it can send. */
|
|
1814
|
+
create: {
|
|
1815
|
+
/** The domain to send from, such as `mail.example.com`. A subdomain keeps your main domain apart from your sending. */
|
|
1816
|
+
name: string;
|
|
1817
|
+
/** The region to send from: `us-east-1`, `eu-west-1` or `ap-northeast-1`. Without it the domain is in `us-east-1`. */
|
|
1818
|
+
region?: "us-east-1" | "eu-west-1" | "ap-northeast-1";
|
|
1819
|
+
/** Whether to count opens for mail from this domain. Without it, yes. */
|
|
1820
|
+
openTracking?: boolean;
|
|
1821
|
+
/** Whether to count clicks for mail from this domain. Without it, no. */
|
|
1822
|
+
clickTracking?: boolean;
|
|
1823
|
+
};
|
|
1824
|
+
/** Verify domain. Looks up every DNS record of the domain and marks each one verified or still pending. */
|
|
1825
|
+
verify: {
|
|
1826
|
+
/** The id of the item. */
|
|
1827
|
+
id: string;
|
|
1828
|
+
};
|
|
1829
|
+
/** Retrieve domain. One domain with its DNS records and the history of its checks. */
|
|
1830
|
+
get: {
|
|
1831
|
+
/** The id of the item. */
|
|
1832
|
+
id: string;
|
|
1833
|
+
};
|
|
1834
|
+
/** List domains. The domains of the workspace, newest first, with their status and region. */
|
|
1835
|
+
list: {
|
|
1836
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
1837
|
+
q?: string;
|
|
1838
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1839
|
+
limit?: number;
|
|
1840
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1841
|
+
offset?: number;
|
|
1842
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
1843
|
+
after?: string;
|
|
1844
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
1845
|
+
before?: string;
|
|
1846
|
+
/** Only domains in this state: `pending`, `verified` or `failed`. */
|
|
1847
|
+
status?: "pending" | "verified" | "failed";
|
|
1848
|
+
/** Only domains in this region. */
|
|
1849
|
+
region?: "us-east-1" | "eu-west-1" | "ap-northeast-1";
|
|
1850
|
+
};
|
|
1851
|
+
/** Update domain. Switches open tracking and click tracking on or off for a domain. */
|
|
1852
|
+
update: {
|
|
1853
|
+
/** The id of the item. */
|
|
1854
|
+
id: string;
|
|
1855
|
+
/** Whether to count opens for mail from this domain. */
|
|
1856
|
+
openTracking?: boolean;
|
|
1857
|
+
/** Whether to count clicks for mail from this domain. */
|
|
1858
|
+
clickTracking?: boolean;
|
|
1859
|
+
};
|
|
1860
|
+
/** Delete domain. Removes a domain from the workspace. Mail can no longer be sent from it. */
|
|
1861
|
+
remove: {
|
|
1862
|
+
/** The id of the item. */
|
|
1863
|
+
id: string;
|
|
1864
|
+
};
|
|
1865
|
+
};
|
|
1866
|
+
apiKeys: {
|
|
1867
|
+
/** Create API key. Creates an API key. The token is in this answer and is never shown again, so store it now. A key with sending access can be limited to one domain: it then sends from that domain only. With `mode: test` the key belongs to the sandbox: what it sends is simulated and reaches nobody. */
|
|
1868
|
+
create: {
|
|
1869
|
+
/** A name to recognise the key by, such as the app that uses it. */
|
|
1870
|
+
name: string;
|
|
1871
|
+
/** What the key may do: `full` for everything, `sending` for sending email and nothing else. Without it the key gets `sending`. */
|
|
1872
|
+
access?: "full" | "sending";
|
|
1873
|
+
/** The id of the one domain the key may send from. Only for a key with `sending` access. */
|
|
1874
|
+
domainId?: string;
|
|
1875
|
+
/** `live` for a key that sends real email. `test` for a key of the sandbox: every email it sends is simulated, reaches nobody and needs no verified domain. A test key always has `sending` access. Without it the key is `live`. */
|
|
1876
|
+
mode?: "live" | "test";
|
|
1877
|
+
};
|
|
1878
|
+
/** Enroll existing API key. Makes a key you already use at Resend work here, so a program that holds it only needs a new address. The key is checked with Resend, kept as a hash like any other key, and gets the access it has there unless you narrow it. */
|
|
1879
|
+
enroll: {
|
|
1880
|
+
/** A name to recognise the key by, such as the app that holds it. */
|
|
1881
|
+
name: string;
|
|
1882
|
+
/** The key itself, as Resend gave it. It starts with `re_`. It is checked with Resend, kept as a hash and never shown again. */
|
|
1883
|
+
token: string;
|
|
1884
|
+
/** What the key may do here: `full` or `sending`. Without it the key keeps what it may do at Resend. A key that only sends there cannot be given `full`. */
|
|
1885
|
+
access?: "full" | "sending";
|
|
1886
|
+
/** The id of the one domain the key may send from. Only for a key with `sending` access. */
|
|
1887
|
+
domainId?: string;
|
|
1888
|
+
};
|
|
1889
|
+
/** List API keys. The API keys of the workspace, with what each may do and when it was last used. */
|
|
1890
|
+
list: {
|
|
1891
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
1892
|
+
q?: string;
|
|
1893
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1894
|
+
limit?: number;
|
|
1895
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1896
|
+
offset?: number;
|
|
1897
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
1898
|
+
after?: string;
|
|
1899
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
1900
|
+
before?: string;
|
|
1901
|
+
/** Only keys with this access: `full` or `sending`. */
|
|
1902
|
+
access?: "full" | "sending";
|
|
1903
|
+
/** Only keys in this mode: `live` or `test`. */
|
|
1904
|
+
mode?: "live" | "test";
|
|
1905
|
+
};
|
|
1906
|
+
/** Revoke API key. Revokes an API key at once. Requests that use it are refused from then on. */
|
|
1907
|
+
remove: {
|
|
1908
|
+
/** The id of the item. */
|
|
1909
|
+
id: string;
|
|
1910
|
+
};
|
|
1911
|
+
};
|
|
1912
|
+
webhooks: {
|
|
1913
|
+
/** Add webhook. Adds an endpoint that is told about the events you pick. The signing secret is in this answer and is never shown again. */
|
|
1914
|
+
create: {
|
|
1915
|
+
/** A public `https://` address of yours that takes a POST. */
|
|
1916
|
+
url: string;
|
|
1917
|
+
/** The events to be told about. Without it the webhook gets every event. */
|
|
1918
|
+
events?: Array<"email.sent" | "email.delivered" | "email.delayed" | "email.bounced" | "email.opened" | "email.clicked" | "email.complained" | "email.failed" | "email.received" | "email.scheduled" | "email.canceled" | "automation.entered" | "automation.finished" | "automation.step">;
|
|
1919
|
+
/** How an event is written and signed. `resend` sends the `svix-id`, `svix-timestamp` and `svix-signature` headers and the body an endpoint built for Resend already reads. Without it, `native`. */
|
|
1920
|
+
format?: "native" | "resend";
|
|
1921
|
+
/** The signing secret the endpoint already checks with, as Resend gave it: `whsec_` and Base64. Only for the `resend` format. Without it a new secret is made. */
|
|
1922
|
+
secret?: string;
|
|
1923
|
+
};
|
|
1924
|
+
/** List webhooks. The endpoints of the workspace with the events each one receives. */
|
|
1925
|
+
list: {
|
|
1926
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
1927
|
+
q?: string;
|
|
1928
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1929
|
+
limit?: number;
|
|
1930
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1931
|
+
offset?: number;
|
|
1932
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
1933
|
+
after?: string;
|
|
1934
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
1935
|
+
before?: string;
|
|
1936
|
+
/** Only webhooks in this state: `enabled` or `disabled`. */
|
|
1937
|
+
status?: "enabled" | "disabled";
|
|
1938
|
+
};
|
|
1939
|
+
/** Update webhook. Changes the address, the events or whether an endpoint is switched on. */
|
|
1940
|
+
update: {
|
|
1941
|
+
/** The id of the item. */
|
|
1942
|
+
id: string;
|
|
1943
|
+
/** A new address. */
|
|
1944
|
+
url?: string;
|
|
1945
|
+
/** The events to be told about from now on. */
|
|
1946
|
+
events?: Array<"email.sent" | "email.delivered" | "email.delayed" | "email.bounced" | "email.opened" | "email.clicked" | "email.complained" | "email.failed" | "email.received" | "email.scheduled" | "email.canceled" | "automation.entered" | "automation.finished" | "automation.step">;
|
|
1947
|
+
/** `enabled` to post events, `disabled` to stop. */
|
|
1948
|
+
status?: "enabled" | "disabled";
|
|
1949
|
+
/** `native` or `resend`: how events are written and signed from now on. */
|
|
1950
|
+
format?: "native" | "resend";
|
|
1951
|
+
};
|
|
1952
|
+
/** Delete webhook. Deletes an endpoint. It is told about nothing from then on. */
|
|
1953
|
+
remove: {
|
|
1954
|
+
/** The id of the item. */
|
|
1955
|
+
id: string;
|
|
1956
|
+
};
|
|
1957
|
+
/** Send test event. Posts one signed sample event to an endpoint and answers with what the endpoint said. */
|
|
1958
|
+
test: {
|
|
1959
|
+
/** The id of the item. */
|
|
1960
|
+
id: string;
|
|
1961
|
+
};
|
|
1962
|
+
/** List webhook deliveries. What was posted to an endpoint, newest first, with the answer and the tries. */
|
|
1963
|
+
deliveries: {
|
|
1964
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
1965
|
+
q?: string;
|
|
1966
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
1967
|
+
limit?: number;
|
|
1968
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
1969
|
+
offset?: number;
|
|
1970
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
1971
|
+
after?: string;
|
|
1972
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
1973
|
+
before?: string;
|
|
1974
|
+
/** The id of the item. */
|
|
1975
|
+
id: string;
|
|
1976
|
+
};
|
|
1977
|
+
};
|
|
1978
|
+
imports: {
|
|
1979
|
+
/** Look into another account. Counts what a key can read in a Resend account: domains, contacts, templates, webhooks and the rest, and says which of them an import brings over. It reads and changes nothing, there or here, and the key is not kept. */
|
|
1980
|
+
inspect: {
|
|
1981
|
+
/** The service to read the account from. Without it, `resend`. */
|
|
1982
|
+
source?: "resend";
|
|
1983
|
+
/** A key of the other account with full access. At Resend it starts with `re_`. It is used to read, never to send or to change anything there. */
|
|
1984
|
+
apiKey: string;
|
|
1985
|
+
};
|
|
1986
|
+
/** Start import. Brings a Resend account over: its domains, suppression list, segments as audiences, contacts, templates, draft broadcasts and webhooks, and the names of its API keys. It runs in the background and can be run again: what is already here is left alone. Nothing arrives in a state that sends, and the key is kept sealed only while the import runs. */
|
|
1987
|
+
create: {
|
|
1988
|
+
/** The service to read the account from. Without it, `resend`. */
|
|
1989
|
+
source?: "resend";
|
|
1990
|
+
/** A key of the other account with full access. At Resend it starts with `re_`. It is used to read, never to send or to change anything there. */
|
|
1991
|
+
apiKey: string;
|
|
1992
|
+
/** What to bring over: any of `domains`, `suppressions`, `audiences`, `contacts`, `templates`, `broadcasts`, `webhooks` and `api_keys`. Without it, all of them. */
|
|
1993
|
+
resources?: Array<"domains" | "suppressions" | "audiences" | "contacts" | "templates" | "broadcasts" | "webhooks" | "api_keys" | "topics" | "contact_properties" | "automations" | "events">;
|
|
1994
|
+
};
|
|
1995
|
+
/** Retrieve import. One import with where it stands and its report so far. */
|
|
1996
|
+
get: {
|
|
1997
|
+
/** The id of the item. */
|
|
1998
|
+
id: string;
|
|
1999
|
+
};
|
|
2000
|
+
/** List imports. The imports of the workspace, newest first, each with its report. */
|
|
2001
|
+
list: {
|
|
2002
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
2003
|
+
q?: string;
|
|
2004
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
2005
|
+
limit?: number;
|
|
2006
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
2007
|
+
offset?: number;
|
|
2008
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
2009
|
+
after?: string;
|
|
2010
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
2011
|
+
before?: string;
|
|
2012
|
+
/** Only imports in this state. */
|
|
2013
|
+
status?: "queued" | "running" | "completed" | "failed" | "canceled";
|
|
2014
|
+
};
|
|
2015
|
+
/** Cancel import. Stops an import that is queued or running and wipes its key. What it already brought over stays. */
|
|
2016
|
+
cancel: {
|
|
2017
|
+
/** The id of the item. */
|
|
2018
|
+
id: string;
|
|
2019
|
+
};
|
|
2020
|
+
};
|
|
2021
|
+
images: {
|
|
2022
|
+
/** Add image. Copies the image at an address and answers with where the copy is served. Emails then link the copy in place of that address. The same address twice answers with the copy that is there, and an image that failed is tried again. */
|
|
2023
|
+
add: {
|
|
2024
|
+
/** The public `https://` address of the image: a PNG, JPEG, GIF or WebP file of 5 MB at most. */
|
|
2025
|
+
url: string;
|
|
2026
|
+
};
|
|
2027
|
+
/** Upload image. Stores an image file and answers with the address it is served at, which is the address to write in an email. It takes a PNG, JPEG, GIF or WebP file of 5 MB at most, sent as Base64, and reads the kind from the file itself. The same file twice answers with the image that is there. */
|
|
2028
|
+
upload: {
|
|
2029
|
+
/** The name of the file, such as `logo.png`. The image is listed and found by it. What kind of image it is, is read from the file itself, never from the name. */
|
|
2030
|
+
name: string;
|
|
2031
|
+
/** The file itself, encoded as Base64 with no `data:` prefix: a PNG, JPEG, GIF or WebP image of 5 MB at most. */
|
|
2032
|
+
content: string;
|
|
2033
|
+
};
|
|
2034
|
+
/** List images. The images of the workspace, copied from an address or uploaded, newest first, by status and search. */
|
|
2035
|
+
list: {
|
|
2036
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
2037
|
+
q?: string;
|
|
2038
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
2039
|
+
limit?: number;
|
|
2040
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
2041
|
+
offset?: number;
|
|
2042
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
2043
|
+
after?: string;
|
|
2044
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
2045
|
+
before?: string;
|
|
2046
|
+
/** Only images in this state: `pending`, `ready` or `failed`. */
|
|
2047
|
+
status?: "pending" | "ready" | "failed";
|
|
2048
|
+
};
|
|
2049
|
+
/** Retrieve image. One image: where it came from, whether it is ready and where it is served. */
|
|
2050
|
+
get: {
|
|
2051
|
+
/** The id of the item. */
|
|
2052
|
+
id: string;
|
|
2053
|
+
};
|
|
2054
|
+
/** Delete image. Deletes the stored file and forgets the image. Emails that were already sent stop showing it, because they link that file. A copied image that a template or a broadcast still uses is copied again the next time that one is saved. An uploaded image has no address to copy it from: it comes back, at the same address, when the same file is uploaded again. */
|
|
2055
|
+
remove: {
|
|
2056
|
+
/** The id of the item. */
|
|
2057
|
+
id: string;
|
|
2058
|
+
};
|
|
2059
|
+
};
|
|
2060
|
+
billing: {
|
|
2061
|
+
/** List plans. The plans, what each allows in a month, what it costs by the month and by the year, what emails past a limit cost, and which one the workspace is on. */
|
|
2062
|
+
plans: Record<string, never>;
|
|
2063
|
+
/** Start checkout. Answers with the address of a checkout page for a plan, paid by the month or by the year. The plan changes once it is paid. */
|
|
2064
|
+
checkout: {
|
|
2065
|
+
/** The plan to buy: `pro` or `max`. */
|
|
2066
|
+
planId: "free" | "pro" | "max";
|
|
2067
|
+
/** Pay by the `month` or by the `year`. By the month when left out. */
|
|
2068
|
+
interval?: "month" | "year";
|
|
2069
|
+
};
|
|
2070
|
+
/** Open billing portal. Answers with the address of the page where the card, the plan and past invoices are managed. */
|
|
2071
|
+
portal: Record<string, never>;
|
|
2072
|
+
/** List invoices. What the workspace has been charged, newest first. */
|
|
2073
|
+
invoices: Record<string, never>;
|
|
2074
|
+
};
|
|
2075
|
+
contacts: {
|
|
2076
|
+
/** Add contact. Adds one person to the workspace, and to the audiences you name. They are subscribed unless you say otherwise. An address that is already a contact is refused: add that contact to an audience instead. */
|
|
2077
|
+
create: {
|
|
2078
|
+
/** The address of the contact. A workspace holds an address once. */
|
|
2079
|
+
email: string;
|
|
2080
|
+
/** The first name, used for `{{first_name}}` in broadcasts. */
|
|
2081
|
+
firstName?: string;
|
|
2082
|
+
/** The last name, used for `{{last_name}}` in broadcasts. */
|
|
2083
|
+
lastName?: string;
|
|
2084
|
+
/** `subscribed` or `unsubscribed`. Without it the contact is subscribed. */
|
|
2085
|
+
status?: "subscribed" | "unsubscribed";
|
|
2086
|
+
/** Values of your own, by name, such as `{ "plan": "pro" }`: text, numbers and true or false. Up to 50. */
|
|
2087
|
+
properties?: {
|
|
2088
|
+
[key: string]: string | number | boolean;
|
|
2089
|
+
};
|
|
2090
|
+
/** The ids of the audiences to put the contact in. Without it, in none. */
|
|
2091
|
+
audienceIds?: string[];
|
|
2092
|
+
/** What the contact chose for a topic, by the id of the topic: `opt_in` or `opt_out`. A topic left out follows its own default. */
|
|
2093
|
+
topics?: {
|
|
2094
|
+
[key: string]: "opt_in" | "opt_out";
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
/** List contacts. The people of the workspace, or of one audience, newest first, by address, name and status. */
|
|
2098
|
+
list: {
|
|
2099
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
2100
|
+
q?: string;
|
|
2101
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
2102
|
+
limit?: number;
|
|
2103
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
2104
|
+
offset?: number;
|
|
2105
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
2106
|
+
after?: string;
|
|
2107
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
2108
|
+
before?: string;
|
|
2109
|
+
/** Only the contacts in this audience. Without it, every contact of the workspace. */
|
|
2110
|
+
audienceId?: string;
|
|
2111
|
+
/** Only contacts in this state: `subscribed` or `unsubscribed`. */
|
|
2112
|
+
status?: "subscribed" | "unsubscribed";
|
|
2113
|
+
};
|
|
2114
|
+
/** Retrieve contact. One person, by id or by address, with their properties, the audiences they are in and what they chose for each topic. */
|
|
2115
|
+
get: {
|
|
2116
|
+
/** The id of the contact, or their address. */
|
|
2117
|
+
id: string;
|
|
2118
|
+
};
|
|
2119
|
+
/** Update contact. Changes the name or the properties of a contact, or subscribes and unsubscribes them. It holds in every audience they are in. */
|
|
2120
|
+
update: {
|
|
2121
|
+
/** The id of the contact, or their address. */
|
|
2122
|
+
id: string;
|
|
2123
|
+
/** A new first name. */
|
|
2124
|
+
firstName?: string;
|
|
2125
|
+
/** A new last name. */
|
|
2126
|
+
lastName?: string;
|
|
2127
|
+
/** `subscribed` or `unsubscribed`. */
|
|
2128
|
+
status?: "subscribed" | "unsubscribed";
|
|
2129
|
+
/** Properties to set, by name. `null` removes one. The others stay as they are. */
|
|
2130
|
+
properties?: {
|
|
2131
|
+
[key: string]: string | number | boolean | null;
|
|
2132
|
+
};
|
|
2133
|
+
/** Choices to set, by the id of the topic: `opt_in` or `opt_out`. `null` goes back to the default of the topic. The others stay as they are. */
|
|
2134
|
+
topics?: {
|
|
2135
|
+
[key: string]: "opt_in" | "opt_out" | null;
|
|
2136
|
+
};
|
|
2137
|
+
};
|
|
2138
|
+
/** Delete contact. Removes a person from the workspace and from every audience, for good. */
|
|
2139
|
+
remove: {
|
|
2140
|
+
/** The id of the contact, or their address. */
|
|
2141
|
+
id: string;
|
|
2142
|
+
};
|
|
2143
|
+
};
|
|
2144
|
+
contactProperties: {
|
|
2145
|
+
/** Create contact property. Names a value every contact can hold, with its type and what to use when a contact has none. From then on a value of another type is refused, and a broadcast fills `{{key}}` with the value or the fallback. */
|
|
2146
|
+
create: {
|
|
2147
|
+
/** The name of the property, such as `plan`: letters, digits and underscores. */
|
|
2148
|
+
key: string;
|
|
2149
|
+
/** What its values are: `string`, `number` or `boolean`. Without it, `string`. */
|
|
2150
|
+
type?: "string" | "number" | "boolean";
|
|
2151
|
+
/** What fills `{{key}}` for a contact with no value. Without it, nothing. */
|
|
2152
|
+
fallback?: string | number | boolean | null;
|
|
2153
|
+
};
|
|
2154
|
+
/** List contact properties. The properties of the workspace, newest first, with their types and fallbacks. */
|
|
2155
|
+
list: EventsListInput;
|
|
2156
|
+
/** Retrieve contact property. One property with its type and its fallback. */
|
|
2157
|
+
get: {
|
|
2158
|
+
/** The id of the item. */
|
|
2159
|
+
id: string;
|
|
2160
|
+
};
|
|
2161
|
+
/** Update contact property. Changes the fallback of a property. Its key and its type stay as they are. */
|
|
2162
|
+
update: {
|
|
2163
|
+
/** The id of the item. */
|
|
2164
|
+
id: string;
|
|
2165
|
+
/** The new fallback, or `null` for none. */
|
|
2166
|
+
fallback: string | number | boolean | null;
|
|
2167
|
+
};
|
|
2168
|
+
/** Delete contact property. Deletes a property. The values contacts hold under its key stay on them, with no type and no fallback. */
|
|
2169
|
+
remove: {
|
|
2170
|
+
/** The id of the item. */
|
|
2171
|
+
id: string;
|
|
2172
|
+
};
|
|
2173
|
+
};
|
|
2174
|
+
topics: {
|
|
2175
|
+
/** Create topic. Makes a kind of mail readers can say yes or no to, such as product news. A broadcast sent on a topic only reaches the contacts who get that topic. */
|
|
2176
|
+
create: {
|
|
2177
|
+
/** A name for the topic, such as `Product news`. */
|
|
2178
|
+
name: string;
|
|
2179
|
+
/** A line about what the topic is, shown to readers. */
|
|
2180
|
+
description?: string;
|
|
2181
|
+
/** `opt_in` when contacts get the topic unless they say no, `opt_out` when they only get it after they say yes. Without it, `opt_in`. It cannot be changed later. */
|
|
2182
|
+
defaultSubscription?: "opt_in" | "opt_out";
|
|
2183
|
+
/** `public` or `private`. Without it, `public`. */
|
|
2184
|
+
visibility?: "public" | "private";
|
|
2185
|
+
};
|
|
2186
|
+
/** List topics. The topics of the workspace, newest first. Name a contact to see what that contact gets. */
|
|
2187
|
+
list: {
|
|
2188
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
2189
|
+
q?: string;
|
|
2190
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
2191
|
+
limit?: number;
|
|
2192
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
2193
|
+
offset?: number;
|
|
2194
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
2195
|
+
after?: string;
|
|
2196
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
2197
|
+
before?: string;
|
|
2198
|
+
/** The id of a contact, or their address. Each topic then says in `subscription` whether that contact gets it. */
|
|
2199
|
+
contact?: string;
|
|
2200
|
+
};
|
|
2201
|
+
/** Retrieve topic. One topic with what holds for a contact who never chose. */
|
|
2202
|
+
get: {
|
|
2203
|
+
/** The id of the item. */
|
|
2204
|
+
id: string;
|
|
2205
|
+
};
|
|
2206
|
+
/** Update topic. Changes the name, the description or who sees a topic. What holds for a contact who never chose cannot be changed. */
|
|
2207
|
+
update: {
|
|
2208
|
+
/** The id of the item. */
|
|
2209
|
+
id: string;
|
|
2210
|
+
/** A new name. */
|
|
2211
|
+
name?: string;
|
|
2212
|
+
/** A new description. */
|
|
2213
|
+
description?: string;
|
|
2214
|
+
/** `public` or `private`. */
|
|
2215
|
+
visibility?: "public" | "private";
|
|
2216
|
+
};
|
|
2217
|
+
/** Delete topic. Deletes a topic. It is refused while a broadcast that has not been sent uses it, so nobody who opted out gets that mail. */
|
|
2218
|
+
remove: {
|
|
2219
|
+
/** The id of the item. */
|
|
2220
|
+
id: string;
|
|
2221
|
+
};
|
|
2222
|
+
};
|
|
2223
|
+
suppressions: {
|
|
2224
|
+
/** Suppress an address. Adds an address to the suppression list, so nothing is sent to it any more. */
|
|
2225
|
+
create: {
|
|
2226
|
+
/** The address to stop sending to. */
|
|
2227
|
+
email: string;
|
|
2228
|
+
};
|
|
2229
|
+
/** List suppressed addresses. The addresses the workspace does not send to: the ones that bounced, the ones that complained and the ones added by hand. Newest first, a page at a time: pass next as cursor for the following page. */
|
|
2230
|
+
list: {
|
|
2231
|
+
/** Only addresses that contain this text. */
|
|
2232
|
+
q?: string;
|
|
2233
|
+
/** Only entries with this reason: `bounce`, `complaint` or `manual`. */
|
|
2234
|
+
reason?: "bounce" | "complaint" | "manual";
|
|
2235
|
+
/** How many entries to return, from 1 to 100. Without it you get 25. */
|
|
2236
|
+
limit?: number;
|
|
2237
|
+
/** The `next` value of the page before, to read the page after it. */
|
|
2238
|
+
cursor?: string;
|
|
2239
|
+
};
|
|
2240
|
+
/** Remove a suppressed address. Takes an address off the suppression list, so it can be sent to again. One that complained may not be removable. */
|
|
2241
|
+
remove: {
|
|
2242
|
+
/** The id of the item. */
|
|
2243
|
+
id: string;
|
|
2244
|
+
};
|
|
2245
|
+
};
|
|
2246
|
+
inbound: {
|
|
2247
|
+
/** List received emails. The mail that arrived at the domains of the workspace, newest first. A test key may not read it. */
|
|
2248
|
+
list: {
|
|
2249
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
2250
|
+
q?: string;
|
|
2251
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
2252
|
+
limit?: number;
|
|
2253
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
2254
|
+
offset?: number;
|
|
2255
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
2256
|
+
after?: string;
|
|
2257
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
2258
|
+
before?: string;
|
|
2259
|
+
/** The period to look at: `today`, `week`, `month`, `year`, `all` or `custom`. Without it there is no limit in time. */
|
|
2260
|
+
range?: "today" | "week" | "month" | "year" | "all" | "custom";
|
|
2261
|
+
/** The first day of a `custom` period, as a date such as `2026-11-01`. */
|
|
2262
|
+
from?: string;
|
|
2263
|
+
/** The last day of a `custom` period, as a date such as `2026-11-30`. */
|
|
2264
|
+
to?: string;
|
|
2265
|
+
/** Only mail received on this domain. */
|
|
2266
|
+
domain?: string;
|
|
2267
|
+
};
|
|
2268
|
+
/** Retrieve received email. One received email with its text, its HTML and the names of its attachments. A test key may not read it. */
|
|
2269
|
+
get: {
|
|
2270
|
+
/** The id of the item. */
|
|
2271
|
+
id: string;
|
|
2272
|
+
};
|
|
2273
|
+
};
|
|
2274
|
+
logs: {
|
|
2275
|
+
/** List logs. Every request an API key has made, newest first, by method, outcome and time. */
|
|
2276
|
+
list: {
|
|
2277
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
2278
|
+
q?: string;
|
|
2279
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
2280
|
+
limit?: number;
|
|
2281
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
2282
|
+
offset?: number;
|
|
2283
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
2284
|
+
after?: string;
|
|
2285
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
2286
|
+
before?: string;
|
|
2287
|
+
/** The period to look at: `today`, `week`, `month`, `year`, `all` or `custom`. Without it there is no limit in time. */
|
|
2288
|
+
range?: "today" | "week" | "month" | "year" | "all" | "custom";
|
|
2289
|
+
/** The first day of a `custom` period, as a date such as `2026-11-01`. */
|
|
2290
|
+
from?: string;
|
|
2291
|
+
/** The last day of a `custom` period, as a date such as `2026-11-30`. */
|
|
2292
|
+
to?: string;
|
|
2293
|
+
/** Only requests with this HTTP verb. */
|
|
2294
|
+
method?: "GET" | "POST" | "PATCH" | "DELETE";
|
|
2295
|
+
/** Only requests that ended this way: `success`, `client_error` or `server_error`. */
|
|
2296
|
+
outcome?: "success" | "client_error" | "server_error";
|
|
2297
|
+
/** Only requests made with this API key. */
|
|
2298
|
+
keyId?: string;
|
|
2299
|
+
/** Only requests that made or changed the thing with this id, such as an email. */
|
|
2300
|
+
resourceId?: string;
|
|
2301
|
+
/** Only MCP requests that called this tool. */
|
|
2302
|
+
tool?: string;
|
|
2303
|
+
};
|
|
2304
|
+
/** Retrieve log. One request: what was asked, what was answered and how long it took. */
|
|
2305
|
+
get: {
|
|
2306
|
+
/** The id of the item. */
|
|
2307
|
+
id: string;
|
|
2308
|
+
};
|
|
2309
|
+
};
|
|
2310
|
+
workspace: {
|
|
2311
|
+
/** Retrieve workspace. The workspace this credential acts for: its plan, every limit with what is used, and who is asking. */
|
|
2312
|
+
get: Record<string, never>;
|
|
2313
|
+
/** Update workspace. Renames the workspace, sets where invoices go, sets the reply address its messages get by default, switches image hosting on or off, or replaces the page a recipient sees after they unsubscribe. */
|
|
2314
|
+
update: {
|
|
2315
|
+
/** A new name for the workspace. */
|
|
2316
|
+
name?: string;
|
|
2317
|
+
/** How the unsubscribe page should look. Send every field of it. */
|
|
2318
|
+
unsubscribePage?: WorkspaceGetOutputUnsubscribePage;
|
|
2319
|
+
/** Where invoices and billing notices should go. */
|
|
2320
|
+
billingEmail?: string;
|
|
2321
|
+
/** The address replies go to when a message names none and its template has none: every email, broadcast and automation step of the workspace. Empty to have none. */
|
|
2322
|
+
replyTo?: "" | string;
|
|
2323
|
+
/** `true` to keep a copy of every image of your templates and broadcasts and link the copy in outgoing mail, `false` to link each image where it is. Turning it off is not recommended: an image that moves or goes away on its own site then stops loading in mail that was already sent. */
|
|
2324
|
+
hostImages?: boolean;
|
|
2325
|
+
};
|
|
2326
|
+
};
|
|
2327
|
+
members: {
|
|
2328
|
+
/** Invite member. Invites a person to the workspace by email, with the role they will hold. */
|
|
2329
|
+
invite: {
|
|
2330
|
+
/** The address to invite. */
|
|
2331
|
+
email: string;
|
|
2332
|
+
/** The name of the person, shown until they sign in. */
|
|
2333
|
+
name?: string;
|
|
2334
|
+
/** What they may do: `admin`, `member` or `viewer`. Without it they join as a member. */
|
|
2335
|
+
role?: "admin" | "member" | "viewer";
|
|
2336
|
+
};
|
|
2337
|
+
/** List members. The people in the workspace and the invitations still waiting for an answer. */
|
|
2338
|
+
list: {
|
|
2339
|
+
/** Text to search for. Only items that contain it are returned. */
|
|
2340
|
+
q?: string;
|
|
2341
|
+
/** How many items to return, from 1 to 100. Without it you get 25. */
|
|
2342
|
+
limit?: number;
|
|
2343
|
+
/** How many items to skip. Use it with `limit` to read the next page. */
|
|
2344
|
+
offset?: number;
|
|
2345
|
+
/** The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. */
|
|
2346
|
+
after?: string;
|
|
2347
|
+
/** The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. */
|
|
2348
|
+
before?: string;
|
|
2349
|
+
/** Only members with this role. */
|
|
2350
|
+
role?: "owner" | "admin" | "member" | "viewer";
|
|
2351
|
+
/** Only members in this state: `active` or `invited`. */
|
|
2352
|
+
status?: "active" | "invited";
|
|
2353
|
+
};
|
|
2354
|
+
/** Update member. Changes the role of a person, or sends an invitation again. */
|
|
2355
|
+
update: {
|
|
2356
|
+
/** The id of the item. */
|
|
2357
|
+
id: string;
|
|
2358
|
+
/** A new role: `admin`, `member` or `viewer`. */
|
|
2359
|
+
role?: "admin" | "member" | "viewer";
|
|
2360
|
+
/** Send the invitation again. Only for someone who has not joined yet. */
|
|
2361
|
+
resend?: boolean;
|
|
2362
|
+
};
|
|
2363
|
+
/** Remove member. Removes a person, or withdraws an invitation, from the workspace. */
|
|
2364
|
+
remove: {
|
|
2365
|
+
/** The id of the item. */
|
|
2366
|
+
id: string;
|
|
2367
|
+
};
|
|
2368
|
+
};
|
|
2369
|
+
server: {
|
|
2370
|
+
/** Retrieve server settings. The settings of a server a team hosts itself: whether anybody may sign up, and what each workspace on it may use. */
|
|
2371
|
+
get: Record<string, never>;
|
|
2372
|
+
};
|
|
2373
|
+
account: {
|
|
2374
|
+
/** Retrieve account. Who is asking and every workspace they can open. For a person it also joins any workspace they were invited to. */
|
|
2375
|
+
get: Record<string, never>;
|
|
2376
|
+
};
|
|
2377
|
+
methods: {
|
|
2378
|
+
/** List methods. Everything this API can do: each method with its route, its tool name, the scope it needs and a sample input. */
|
|
2379
|
+
list: {
|
|
2380
|
+
/** Only the methods of this group. */
|
|
2381
|
+
namespace?: "emails" | "broadcasts" | "audiences" | "templates" | "automations" | "metrics" | "domains" | "apiKeys" | "webhooks" | "logs" | "workspace" | "members" | "methods" | "account" | "inbound" | "contacts" | "billing" | "ask" | "suppressions" | "runs" | "events" | "imports" | "topics" | "contactProperties" | "images" | "server";
|
|
2382
|
+
};
|
|
2383
|
+
};
|
|
2384
|
+
ask: {
|
|
2385
|
+
/** Ask the assistant. Answers a question about the workspace by looking it up with the methods of this API. A change is never carried out by asking: the answer holds the change it proposes, and sending that back as run carries it out. */
|
|
2386
|
+
send: {
|
|
2387
|
+
/** The conversation so far, oldest first. The last message is the question. */
|
|
2388
|
+
messages: Array<{
|
|
2389
|
+
/** Who said it: `user` or `assistant`. */
|
|
2390
|
+
role: "user" | "assistant";
|
|
2391
|
+
/** What was said. */
|
|
2392
|
+
text: string;
|
|
2393
|
+
}>;
|
|
2394
|
+
/** The screen the person is on, so the answer can be about it. */
|
|
2395
|
+
page?: string;
|
|
2396
|
+
/** A change the assistant proposed and the person confirmed. With it the change is made and no model is asked. */
|
|
2397
|
+
run?: {
|
|
2398
|
+
/** The name of the method to run, such as `domains.create`. */
|
|
2399
|
+
call: string;
|
|
2400
|
+
/** The input for that method. */
|
|
2401
|
+
input: {
|
|
2402
|
+
[key: string]: unknown;
|
|
2403
|
+
};
|
|
2404
|
+
};
|
|
2405
|
+
};
|
|
2406
|
+
};
|
|
2407
|
+
}
|
|
2408
|
+
export interface OpenSendOutputs {
|
|
2409
|
+
emails: {
|
|
2410
|
+
/** Send email. Sends one email to up to fifty addresses, from an address on a verified domain of the workspace. It takes cc, bcc, a reply address, headers, tags, attachments, a published template with its variables and a time to send at. With an idempotency key (the field, or the Idempotency-Key header) a repeat within a day answers with the first email. Sent with a test key, or to test addresses only, the email belongs to the sandbox: its `mode` is `test`, it reaches nobody and what happens to it is simulated. */
|
|
2411
|
+
send: {
|
|
2412
|
+
object: "email";
|
|
2413
|
+
/** The id of the email. */
|
|
2414
|
+
id: string;
|
|
2415
|
+
/** The sender. */
|
|
2416
|
+
from: string;
|
|
2417
|
+
/** Who the email is for. */
|
|
2418
|
+
to: string[];
|
|
2419
|
+
/** The subject line. */
|
|
2420
|
+
subject: string;
|
|
2421
|
+
/** Where the email is: `scheduled`, `queued`, `sent`, `delivered`, `delayed`, `bounced`, `complained`, `failed` or `canceled`, and `opened` or `clicked` once the recipient acts. */
|
|
2422
|
+
status: "queued" | "sent" | "delivered" | "delayed" | "bounced" | "opened" | "clicked" | "complained" | "failed" | "scheduled" | "canceled";
|
|
2423
|
+
/** `live` for a real email. `test` for an email of the sandbox: it was sent with a test key or to test addresses, nothing left the service and what happened to it is simulated. */
|
|
2424
|
+
mode: "live" | "test";
|
|
2425
|
+
/** The domain it was sent from. */
|
|
2426
|
+
domain: string;
|
|
2427
|
+
/** Who got a copy. */
|
|
2428
|
+
cc: string[];
|
|
2429
|
+
/** Who got a copy without the others seeing. */
|
|
2430
|
+
bcc: string[];
|
|
2431
|
+
/** The address replies go to, or `null`. */
|
|
2432
|
+
replyTo: string | null;
|
|
2433
|
+
/** When it is due to be sent, or `null` for an email sent at once. */
|
|
2434
|
+
scheduledAt: string | null;
|
|
2435
|
+
/** When the API accepted the email. */
|
|
2436
|
+
createdAt: string;
|
|
2437
|
+
/** The message as HTML, or `null`. */
|
|
2438
|
+
html: string | null;
|
|
2439
|
+
/** The message as plain text, or `null`. */
|
|
2440
|
+
text: string | null;
|
|
2441
|
+
/** The extra headers you sent, by name. */
|
|
2442
|
+
headers: {
|
|
2443
|
+
[key: string]: string;
|
|
2444
|
+
};
|
|
2445
|
+
/** The tags you sent, by name. */
|
|
2446
|
+
tags: {
|
|
2447
|
+
[key: string]: string;
|
|
2448
|
+
};
|
|
2449
|
+
/** The files that were attached. Their content is not kept. */
|
|
2450
|
+
attachments: Array<{
|
|
2451
|
+
/** The name of the file. */
|
|
2452
|
+
filename: string;
|
|
2453
|
+
/** The media type of the file, or `null` when none was given. */
|
|
2454
|
+
contentType: string | null;
|
|
2455
|
+
/** The size of the file in bytes, or `null` when it was given by address. */
|
|
2456
|
+
size: number | null;
|
|
2457
|
+
}>;
|
|
2458
|
+
/** The id of the template it was built from, or `null`. */
|
|
2459
|
+
templateId: string | null;
|
|
2460
|
+
/** The automation run that sent it, or `null` for an email you sent yourself. */
|
|
2461
|
+
automation: {
|
|
2462
|
+
/** The id of the automation. */
|
|
2463
|
+
id: string;
|
|
2464
|
+
/** The id of the run. */
|
|
2465
|
+
runId: string;
|
|
2466
|
+
/** The id of the step that sent it. */
|
|
2467
|
+
stepId: string;
|
|
2468
|
+
} | null;
|
|
2469
|
+
/** What has happened to the email, oldest first. */
|
|
2470
|
+
events: EmailsSendOutputEvents[];
|
|
2471
|
+
};
|
|
2472
|
+
/** Send emails in a batch. Sends up to a hundred emails in one request. Every email is checked first and one that is refused refuses the whole batch, unless `validation` is `permissive`: then the rest are sent and the refused one is listed with its reason. After that each email is accepted or refused by itself, and the answer says which. */
|
|
2473
|
+
batch: {
|
|
2474
|
+
object: "list";
|
|
2475
|
+
/** One entry for each email you sent, in the same order. */
|
|
2476
|
+
data: Array<{
|
|
2477
|
+
/** The position of this email in the list you sent, from 0. */
|
|
2478
|
+
index: number;
|
|
2479
|
+
/** The id of the email, or `null` when it was refused. */
|
|
2480
|
+
id: string | null;
|
|
2481
|
+
/** The status of the email, or `null` when it was refused. */
|
|
2482
|
+
status: "queued" | "sent" | "delivered" | "delayed" | "bounced" | "opened" | "clicked" | "complained" | "failed" | "scheduled" | "canceled" | null;
|
|
2483
|
+
/** `live` for a real email, `test` for an email of the sandbox, or `null` when it was refused. */
|
|
2484
|
+
mode: "live" | "test" | null;
|
|
2485
|
+
/** Why it was refused, or `null`. */
|
|
2486
|
+
error: {
|
|
2487
|
+
/** The code of the refusal. */
|
|
2488
|
+
code: string;
|
|
2489
|
+
/** The refusal in words. */
|
|
2490
|
+
message: string;
|
|
2491
|
+
} | null;
|
|
2492
|
+
}>;
|
|
2493
|
+
/** How many were accepted. */
|
|
2494
|
+
sent: number;
|
|
2495
|
+
/** How many were refused. */
|
|
2496
|
+
failed: number;
|
|
2497
|
+
};
|
|
2498
|
+
/** Reschedule email. Moves an email that is still scheduled to another time, at most 30 days ahead. */
|
|
2499
|
+
update: OpenSendOutputs["emails"]["send"];
|
|
2500
|
+
/** Cancel email. Cancels an email that is still scheduled, so it is never sent. */
|
|
2501
|
+
cancel: OpenSendOutputs["emails"]["send"];
|
|
2502
|
+
/** Retrieve email. One email with its body and every event that has happened to it. */
|
|
2503
|
+
get: OpenSendOutputs["emails"]["send"];
|
|
2504
|
+
/** List emails. The emails the workspace has sent, newest first, by status, time and search. */
|
|
2505
|
+
list: {
|
|
2506
|
+
object: "list";
|
|
2507
|
+
/** The items on this page. */
|
|
2508
|
+
data: Array<{
|
|
2509
|
+
object: "email";
|
|
2510
|
+
/** The id of the email. */
|
|
2511
|
+
id: string;
|
|
2512
|
+
/** The sender. */
|
|
2513
|
+
from: string;
|
|
2514
|
+
/** Who the email is for. */
|
|
2515
|
+
to: string[];
|
|
2516
|
+
/** The subject line. */
|
|
2517
|
+
subject: string;
|
|
2518
|
+
/** Where the email is: `scheduled`, `queued`, `sent`, `delivered`, `delayed`, `bounced`, `complained`, `failed` or `canceled`, and `opened` or `clicked` once the recipient acts. */
|
|
2519
|
+
status: "queued" | "sent" | "delivered" | "delayed" | "bounced" | "opened" | "clicked" | "complained" | "failed" | "scheduled" | "canceled";
|
|
2520
|
+
/** `live` for a real email. `test` for an email of the sandbox: it was sent with a test key or to test addresses, nothing left the service and what happened to it is simulated. */
|
|
2521
|
+
mode: "live" | "test";
|
|
2522
|
+
/** The domain it was sent from. */
|
|
2523
|
+
domain: string;
|
|
2524
|
+
/** Who got a copy. */
|
|
2525
|
+
cc: string[];
|
|
2526
|
+
/** Who got a copy without the others seeing. */
|
|
2527
|
+
bcc: string[];
|
|
2528
|
+
/** The address replies go to, or `null`. */
|
|
2529
|
+
replyTo: string | null;
|
|
2530
|
+
/** When it is due to be sent, or `null` for an email sent at once. */
|
|
2531
|
+
scheduledAt: string | null;
|
|
2532
|
+
/** When the API accepted the email. */
|
|
2533
|
+
createdAt: string;
|
|
2534
|
+
}>;
|
|
2535
|
+
/** How many items match in all, on every page together. */
|
|
2536
|
+
total: number;
|
|
2537
|
+
/** Whether more items follow this page. */
|
|
2538
|
+
hasMore: boolean;
|
|
2539
|
+
};
|
|
2540
|
+
};
|
|
2541
|
+
broadcasts: {
|
|
2542
|
+
/** Create broadcast. Creates a draft broadcast for one audience. Nothing is sent until you send it. */
|
|
2543
|
+
create: {
|
|
2544
|
+
object: "broadcast";
|
|
2545
|
+
/** The id of the broadcast. */
|
|
2546
|
+
id: string;
|
|
2547
|
+
/** The name of the broadcast. Recipients never see it. */
|
|
2548
|
+
name: string;
|
|
2549
|
+
/** The subject line. */
|
|
2550
|
+
subject: string;
|
|
2551
|
+
/** The id of the audience it goes to. */
|
|
2552
|
+
audienceId: string;
|
|
2553
|
+
/** The name of that audience. */
|
|
2554
|
+
audienceName: string;
|
|
2555
|
+
/** The id of the topic it is sent on, or `null`. On a topic it only reaches the contacts who get that topic. */
|
|
2556
|
+
topicId: string | null;
|
|
2557
|
+
/** `draft` until it is sent or scheduled, `scheduled` until its time, `sending` while it goes out, `sent` after that. */
|
|
2558
|
+
status: "draft" | "scheduled" | "sent" | "sending";
|
|
2559
|
+
/** When it starts sending, or `null` when no time is set. */
|
|
2560
|
+
scheduledAt: string | null;
|
|
2561
|
+
/** When the last message was handed over, or `null`. */
|
|
2562
|
+
sentAt: string | null;
|
|
2563
|
+
/** How many people are subscribed to its audience. */
|
|
2564
|
+
recipients: number;
|
|
2565
|
+
/** How many messages were delivered. */
|
|
2566
|
+
delivered: number;
|
|
2567
|
+
/** How many could not be sent. */
|
|
2568
|
+
failed: number;
|
|
2569
|
+
/** The sender, such as `Acme <news@mail.example.com>`. */
|
|
2570
|
+
from: string;
|
|
2571
|
+
/** The address replies go to. Empty when it is the default of the workspace, or the sender when there is none. */
|
|
2572
|
+
replyTo: string;
|
|
2573
|
+
/** The HTML of the message, or `null`. */
|
|
2574
|
+
html: string | null;
|
|
2575
|
+
/** The plain text of the message, or `null`. */
|
|
2576
|
+
text: string | null;
|
|
2577
|
+
/** The blocks the broadcast is built from, or `null` for a broadcast written as HTML. When it is set, `html` and `text` are made from it. */
|
|
2578
|
+
design: {
|
|
2579
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
2580
|
+
preview?: string;
|
|
2581
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
2582
|
+
style?: {
|
|
2583
|
+
[key: string]: string | number;
|
|
2584
|
+
};
|
|
2585
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
2586
|
+
dark?: {
|
|
2587
|
+
[key: string]: string | number;
|
|
2588
|
+
};
|
|
2589
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
2590
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
2591
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
2592
|
+
css?: string;
|
|
2593
|
+
/** The blocks of the message, from top to bottom. */
|
|
2594
|
+
body: BroadcastsCreateOutputDesignBody[];
|
|
2595
|
+
} | null;
|
|
2596
|
+
/** When the broadcast was made. */
|
|
2597
|
+
createdAt: string;
|
|
2598
|
+
};
|
|
2599
|
+
/** Update broadcast. Changes the name, audience, subject, sender, reply address or message of a broadcast that has not started sending. */
|
|
2600
|
+
update: OpenSendOutputs["broadcasts"]["create"];
|
|
2601
|
+
/** Send broadcast. Schedules a broadcast for now, or for a later time, to everyone subscribed to its audience. */
|
|
2602
|
+
send: OpenSendOutputs["broadcasts"]["create"];
|
|
2603
|
+
/** Send test of broadcast. Sends the broadcast as it is saved now to the addresses you give, with "[Test]" before the subject, and leaves the broadcast as it is. It needs a sender, a subject and a message. It is a real email and counts as one. A test key may send it to test addresses only, and the email is then simulated. */
|
|
2604
|
+
test: OpenSendOutputs["emails"]["send"];
|
|
2605
|
+
/** Duplicate broadcast. Copies a broadcast into a new draft: its audience, sender, subject and message. It works on one that was already sent, and the copy is not scheduled. */
|
|
2606
|
+
duplicate: OpenSendOutputs["broadcasts"]["create"];
|
|
2607
|
+
/** Retrieve broadcast. One broadcast with its audience, its schedule and how many it reached. */
|
|
2608
|
+
get: OpenSendOutputs["broadcasts"]["create"];
|
|
2609
|
+
/** List broadcasts. The broadcasts of the workspace, newest first, by status and audience. */
|
|
2610
|
+
list: {
|
|
2611
|
+
object: "list";
|
|
2612
|
+
/** The items on this page. */
|
|
2613
|
+
data: Array<{
|
|
2614
|
+
object: "broadcast";
|
|
2615
|
+
/** The id of the broadcast. */
|
|
2616
|
+
id: string;
|
|
2617
|
+
/** The name of the broadcast. Recipients never see it. */
|
|
2618
|
+
name: string;
|
|
2619
|
+
/** The subject line. */
|
|
2620
|
+
subject: string;
|
|
2621
|
+
/** The id of the audience it goes to. */
|
|
2622
|
+
audienceId: string;
|
|
2623
|
+
/** The name of that audience. */
|
|
2624
|
+
audienceName: string;
|
|
2625
|
+
/** The id of the topic it is sent on, or `null`. On a topic it only reaches the contacts who get that topic. */
|
|
2626
|
+
topicId: string | null;
|
|
2627
|
+
/** `draft` until it is sent or scheduled, `scheduled` until its time, `sending` while it goes out, `sent` after that. */
|
|
2628
|
+
status: "draft" | "scheduled" | "sent" | "sending";
|
|
2629
|
+
/** When it starts sending, or `null` when no time is set. */
|
|
2630
|
+
scheduledAt: string | null;
|
|
2631
|
+
/** When the last message was handed over, or `null`. */
|
|
2632
|
+
sentAt: string | null;
|
|
2633
|
+
/** How many people are subscribed to its audience. */
|
|
2634
|
+
recipients: number;
|
|
2635
|
+
/** How many messages were delivered. */
|
|
2636
|
+
delivered: number;
|
|
2637
|
+
/** How many could not be sent. */
|
|
2638
|
+
failed: number;
|
|
2639
|
+
/** The sender, such as `Acme <news@mail.example.com>`. */
|
|
2640
|
+
from: string;
|
|
2641
|
+
/** The address replies go to. Empty when it is the default of the workspace, or the sender when there is none. */
|
|
2642
|
+
replyTo: string;
|
|
2643
|
+
/** The HTML of the message, or `null`. */
|
|
2644
|
+
html: string | null;
|
|
2645
|
+
/** The plain text of the message, or `null`. */
|
|
2646
|
+
text: string | null;
|
|
2647
|
+
/** The blocks the broadcast is built from, or `null` for a broadcast written as HTML. When it is set, `html` and `text` are made from it. */
|
|
2648
|
+
design: {
|
|
2649
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
2650
|
+
preview?: string;
|
|
2651
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
2652
|
+
style?: {
|
|
2653
|
+
[key: string]: string | number;
|
|
2654
|
+
};
|
|
2655
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
2656
|
+
dark?: {
|
|
2657
|
+
[key: string]: string | number;
|
|
2658
|
+
};
|
|
2659
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
2660
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
2661
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
2662
|
+
css?: string;
|
|
2663
|
+
/** The blocks of the message, from top to bottom. */
|
|
2664
|
+
body: BroadcastsCreateOutputDesignBody[];
|
|
2665
|
+
} | null;
|
|
2666
|
+
/** When the broadcast was made. */
|
|
2667
|
+
createdAt: string;
|
|
2668
|
+
}>;
|
|
2669
|
+
/** How many items match in all, on every page together. */
|
|
2670
|
+
total: number;
|
|
2671
|
+
/** Whether more items follow this page. */
|
|
2672
|
+
hasMore: boolean;
|
|
2673
|
+
};
|
|
2674
|
+
/** Delete broadcast. Deletes a broadcast. A scheduled one is never sent. */
|
|
2675
|
+
remove: BroadcastsRemoveOutput;
|
|
2676
|
+
};
|
|
2677
|
+
audiences: {
|
|
2678
|
+
/** Create audience. Creates an empty audience that contacts can join and broadcasts can be sent to. */
|
|
2679
|
+
create: AudiencesCreateOutput;
|
|
2680
|
+
/** List audiences. The audiences of the workspace with how many contacts each holds. */
|
|
2681
|
+
list: {
|
|
2682
|
+
object: "list";
|
|
2683
|
+
/** The items on this page. */
|
|
2684
|
+
data: AudiencesCreateOutput[];
|
|
2685
|
+
/** How many items match in all, on every page together. */
|
|
2686
|
+
total: number;
|
|
2687
|
+
/** Whether more items follow this page. */
|
|
2688
|
+
hasMore: boolean;
|
|
2689
|
+
};
|
|
2690
|
+
/** Retrieve audience. One audience with how many contacts it holds. */
|
|
2691
|
+
get: AudiencesCreateOutput;
|
|
2692
|
+
/** Rename audience. Gives an audience another name. Its contacts and its broadcasts stay as they are. */
|
|
2693
|
+
update: AudiencesCreateOutput;
|
|
2694
|
+
/** Delete audience. Deletes an audience. Its contacts stay in the workspace and in their other audiences. */
|
|
2695
|
+
remove: BroadcastsRemoveOutput;
|
|
2696
|
+
/** Add contact to audience. Puts a contact of the workspace into an audience. A contact can be in many, and one that is already in it stays as it is. */
|
|
2697
|
+
join: AudiencesJoinOutput;
|
|
2698
|
+
/** Remove contact from audience. Takes a contact out of one audience. The contact stays in the workspace and in their other audiences. */
|
|
2699
|
+
leave: AudiencesJoinOutput;
|
|
2700
|
+
};
|
|
2701
|
+
templates: {
|
|
2702
|
+
/** Create template. Creates a draft template: a subject and HTML, and when you want them a plain text version, a sender, a reply address and defaults for its variables. Give `design` to build it from blocks, or `starter` to begin with a ready-made one. Its alias is made from its name unless you give one. */
|
|
2703
|
+
create: {
|
|
2704
|
+
object: "template";
|
|
2705
|
+
/** The id of the template. */
|
|
2706
|
+
id: string;
|
|
2707
|
+
/** The name of the template. */
|
|
2708
|
+
name: string;
|
|
2709
|
+
/** A short name of your own to send with in place of the id, such as `welcome`. */
|
|
2710
|
+
alias: string;
|
|
2711
|
+
/** `draft` until it is published, `published` after that. */
|
|
2712
|
+
status: "draft" | "published";
|
|
2713
|
+
/** The subject line, as last saved. */
|
|
2714
|
+
subject: string;
|
|
2715
|
+
/** The HTML, as last saved. */
|
|
2716
|
+
html: string;
|
|
2717
|
+
/** The plain text version, as last saved, or `null` when it has none. */
|
|
2718
|
+
text: string | null;
|
|
2719
|
+
/** The sender an email built from it gets when the send names none. Empty for none. */
|
|
2720
|
+
from: string;
|
|
2721
|
+
/** The address replies go to when the send names none. Empty to leave it to the default of the workspace. */
|
|
2722
|
+
replyTo: string;
|
|
2723
|
+
/** A value for a variable, by name, used when a send gives none for it. */
|
|
2724
|
+
defaults: {
|
|
2725
|
+
[key: string]: string;
|
|
2726
|
+
};
|
|
2727
|
+
/** The blocks the template is built from, or `null` for a template written as HTML. When it is set, `html` and `text` are made from it. */
|
|
2728
|
+
design: {
|
|
2729
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
2730
|
+
preview?: string;
|
|
2731
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
2732
|
+
style?: {
|
|
2733
|
+
[key: string]: string | number;
|
|
2734
|
+
};
|
|
2735
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
2736
|
+
dark?: {
|
|
2737
|
+
[key: string]: string | number;
|
|
2738
|
+
};
|
|
2739
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
2740
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
2741
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
2742
|
+
css?: string;
|
|
2743
|
+
/** The blocks of the message, from top to bottom. */
|
|
2744
|
+
body: BroadcastsCreateOutputDesignBody[];
|
|
2745
|
+
} | null;
|
|
2746
|
+
/** How its preview is drawn in the dashboard. */
|
|
2747
|
+
layout: "start" | "center" | "split";
|
|
2748
|
+
/** The names of the `{{NAME}}` variables in the subject, the HTML and the plain text. */
|
|
2749
|
+
variables: string[];
|
|
2750
|
+
/** How many times it was published. 0 for a template that never was. */
|
|
2751
|
+
version: number;
|
|
2752
|
+
/** When it was last published, or `null`. */
|
|
2753
|
+
publishedAt: string | null;
|
|
2754
|
+
/** Whether it was saved after it was last published. Emails use the published version until you publish again. */
|
|
2755
|
+
changed: boolean;
|
|
2756
|
+
/** When it was last saved. */
|
|
2757
|
+
updatedAt: string;
|
|
2758
|
+
/** When the template was made. */
|
|
2759
|
+
createdAt: string;
|
|
2760
|
+
};
|
|
2761
|
+
/** Get template. One template with its subject, HTML, plain text, sender and defaults. */
|
|
2762
|
+
get: OpenSendOutputs["templates"]["create"];
|
|
2763
|
+
/** List templates. The templates of the workspace, newest first, by status and search. */
|
|
2764
|
+
list: {
|
|
2765
|
+
object: "list";
|
|
2766
|
+
/** The items on this page. */
|
|
2767
|
+
data: Array<{
|
|
2768
|
+
object: "template";
|
|
2769
|
+
/** The id of the template. */
|
|
2770
|
+
id: string;
|
|
2771
|
+
/** The name of the template. */
|
|
2772
|
+
name: string;
|
|
2773
|
+
/** A short name of your own to send with in place of the id, such as `welcome`. */
|
|
2774
|
+
alias: string;
|
|
2775
|
+
/** `draft` until it is published, `published` after that. */
|
|
2776
|
+
status: "draft" | "published";
|
|
2777
|
+
/** The subject line, as last saved. */
|
|
2778
|
+
subject: string;
|
|
2779
|
+
/** The HTML, as last saved. */
|
|
2780
|
+
html: string;
|
|
2781
|
+
/** The plain text version, as last saved, or `null` when it has none. */
|
|
2782
|
+
text: string | null;
|
|
2783
|
+
/** The sender an email built from it gets when the send names none. Empty for none. */
|
|
2784
|
+
from: string;
|
|
2785
|
+
/** The address replies go to when the send names none. Empty to leave it to the default of the workspace. */
|
|
2786
|
+
replyTo: string;
|
|
2787
|
+
/** A value for a variable, by name, used when a send gives none for it. */
|
|
2788
|
+
defaults: {
|
|
2789
|
+
[key: string]: string;
|
|
2790
|
+
};
|
|
2791
|
+
/** The blocks the template is built from, or `null` for a template written as HTML. When it is set, `html` and `text` are made from it. */
|
|
2792
|
+
design: {
|
|
2793
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
2794
|
+
preview?: string;
|
|
2795
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
2796
|
+
style?: {
|
|
2797
|
+
[key: string]: string | number;
|
|
2798
|
+
};
|
|
2799
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
2800
|
+
dark?: {
|
|
2801
|
+
[key: string]: string | number;
|
|
2802
|
+
};
|
|
2803
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
2804
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
2805
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
2806
|
+
css?: string;
|
|
2807
|
+
/** The blocks of the message, from top to bottom. */
|
|
2808
|
+
body: BroadcastsCreateOutputDesignBody[];
|
|
2809
|
+
} | null;
|
|
2810
|
+
/** How its preview is drawn in the dashboard. */
|
|
2811
|
+
layout: "start" | "center" | "split";
|
|
2812
|
+
/** The names of the `{{NAME}}` variables in the subject, the HTML and the plain text. */
|
|
2813
|
+
variables: string[];
|
|
2814
|
+
/** How many times it was published. 0 for a template that never was. */
|
|
2815
|
+
version: number;
|
|
2816
|
+
/** When it was last published, or `null`. */
|
|
2817
|
+
publishedAt: string | null;
|
|
2818
|
+
/** Whether it was saved after it was last published. Emails use the published version until you publish again. */
|
|
2819
|
+
changed: boolean;
|
|
2820
|
+
/** When it was last saved. */
|
|
2821
|
+
updatedAt: string;
|
|
2822
|
+
/** When the template was made. */
|
|
2823
|
+
createdAt: string;
|
|
2824
|
+
}>;
|
|
2825
|
+
/** How many items match in all, on every page together. */
|
|
2826
|
+
total: number;
|
|
2827
|
+
/** Whether more items follow this page. */
|
|
2828
|
+
hasMore: boolean;
|
|
2829
|
+
};
|
|
2830
|
+
/** Update template. Changes a template: its name, alias, subject, HTML, plain text, sender, reply address or the defaults of its variables. What was published keeps being sent until the template is published again. */
|
|
2831
|
+
update: OpenSendOutputs["templates"]["create"];
|
|
2832
|
+
/** Edit template design. Changes single blocks of a template built from blocks, in place of sending its whole design: add a block, change its fields, its style, its phone style or its dark mode colours, move it, take it out or copy it, or change the style, the dark mode colours, the preview, the fonts or the CSS of the whole message. The operations run in order, and when one is refused nothing is saved. The HTML and the plain text are made from the design again. */
|
|
2833
|
+
edit: OpenSendOutputs["templates"]["create"];
|
|
2834
|
+
/** Publish template. Publishes a template as it is now, so emails can use it. Later edits are not sent until it is published again. */
|
|
2835
|
+
publish: OpenSendOutputs["templates"]["create"];
|
|
2836
|
+
/** Send test of template. Sends the template as it is saved now, published or not, to the addresses you give, with "[Test]" before the subject. It needs a subject and a message. It is a real email and counts as one. A test key may send it to test addresses only, and the email is then simulated. */
|
|
2837
|
+
test: OpenSendOutputs["emails"]["send"];
|
|
2838
|
+
/** Render template design. Turns a design, the blocks a template can be built from, into the HTML and the plain text an email gets from it. Nothing is saved and nothing is sent. Give values for variables to see the message filled in. */
|
|
2839
|
+
render: {
|
|
2840
|
+
/** The HTML the design makes, as a whole document. */
|
|
2841
|
+
html: string;
|
|
2842
|
+
/** The same message as plain text. */
|
|
2843
|
+
text: string;
|
|
2844
|
+
};
|
|
2845
|
+
/** Duplicate template. Copies a template as it is saved now into a new draft, with a free alias. The copy is not published. */
|
|
2846
|
+
duplicate: OpenSendOutputs["templates"]["create"];
|
|
2847
|
+
/** List template versions. The versions of one template, newest first. Every publish that changes something makes one, and the last 50 are kept. */
|
|
2848
|
+
versions: {
|
|
2849
|
+
object: "list";
|
|
2850
|
+
/** The items on this page. */
|
|
2851
|
+
data: Array<{
|
|
2852
|
+
object: "template_version";
|
|
2853
|
+
/** The id of the template it is a version of. */
|
|
2854
|
+
templateId: string;
|
|
2855
|
+
/** The number of the version. The first publish is 1. */
|
|
2856
|
+
version: number;
|
|
2857
|
+
/** The subject line of that version. */
|
|
2858
|
+
subject: string;
|
|
2859
|
+
/** When that version was published. */
|
|
2860
|
+
publishedAt: string;
|
|
2861
|
+
/** `true` for the version emails are built from now. */
|
|
2862
|
+
live: boolean;
|
|
2863
|
+
}>;
|
|
2864
|
+
/** How many items match in all, on every page together. */
|
|
2865
|
+
total: number;
|
|
2866
|
+
/** Whether more items follow this page. */
|
|
2867
|
+
hasMore: boolean;
|
|
2868
|
+
};
|
|
2869
|
+
/** Get template version. One version of a template with everything it holds: the subject, the HTML, the plain text, the sender, the reply address and the defaults. */
|
|
2870
|
+
version: {
|
|
2871
|
+
object: "template_version";
|
|
2872
|
+
/** The id of the template it is a version of. */
|
|
2873
|
+
templateId: string;
|
|
2874
|
+
/** The number of the version. The first publish is 1. */
|
|
2875
|
+
version: number;
|
|
2876
|
+
/** The subject line of that version. */
|
|
2877
|
+
subject: string;
|
|
2878
|
+
/** When that version was published. */
|
|
2879
|
+
publishedAt: string;
|
|
2880
|
+
/** `true` for the version emails are built from now. */
|
|
2881
|
+
live: boolean;
|
|
2882
|
+
/** The HTML of that version. */
|
|
2883
|
+
html: string;
|
|
2884
|
+
/** The plain text of that version, or `null`. */
|
|
2885
|
+
text: string | null;
|
|
2886
|
+
/** The sender that version gives an email. Empty for none. */
|
|
2887
|
+
from: string;
|
|
2888
|
+
/** The reply address of that version. Empty for none. */
|
|
2889
|
+
replyTo: string;
|
|
2890
|
+
/** The default of each variable in that version, by name. */
|
|
2891
|
+
defaults: {
|
|
2892
|
+
[key: string]: string;
|
|
2893
|
+
};
|
|
2894
|
+
/** The blocks of that version, or `null` when it was written as HTML. */
|
|
2895
|
+
design: {
|
|
2896
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
2897
|
+
preview?: string;
|
|
2898
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
2899
|
+
style?: {
|
|
2900
|
+
[key: string]: string | number;
|
|
2901
|
+
};
|
|
2902
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
2903
|
+
dark?: {
|
|
2904
|
+
[key: string]: string | number;
|
|
2905
|
+
};
|
|
2906
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
2907
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
2908
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
2909
|
+
css?: string;
|
|
2910
|
+
/** The blocks of the message, from top to bottom. */
|
|
2911
|
+
body: BroadcastsCreateOutputDesignBody[];
|
|
2912
|
+
} | null;
|
|
2913
|
+
};
|
|
2914
|
+
/** Restore template version. Copies a version back into the template as the copy you edit. What is published keeps being sent until you publish again. */
|
|
2915
|
+
restore: OpenSendOutputs["templates"]["create"];
|
|
2916
|
+
/** Delete template. Deletes a template. Emails already sent with it keep their content. */
|
|
2917
|
+
remove: BroadcastsRemoveOutput;
|
|
2918
|
+
/** List template starters. The ready-made templates a new template can start from, by kind and search. Each has a name, what it is for, the subject it starts with and the looks it can be drawn in. Its variables and its message come with `templates.starter`. */
|
|
2919
|
+
starters: {
|
|
2920
|
+
object: "list";
|
|
2921
|
+
/** The items on this page. */
|
|
2922
|
+
data: Array<{
|
|
2923
|
+
object: "template_starter";
|
|
2924
|
+
/** The id of the starter. Pass it as `starter` to `templates.create`. */
|
|
2925
|
+
id: string;
|
|
2926
|
+
/** The name of the starter. */
|
|
2927
|
+
name: string;
|
|
2928
|
+
/** What the message is for and what it holds. */
|
|
2929
|
+
description: string;
|
|
2930
|
+
/** The kind of mail it is, such as `account` or `commerce`. */
|
|
2931
|
+
category: "account" | "commerce" | "notify" | "marketing" | "events" | "hospitality" | "health" | "education" | "real-estate" | "nonprofit" | "travel" | "recruiting" | "community";
|
|
2932
|
+
/** The subject line a template made from it starts with. `{{name}}` marks a variable. */
|
|
2933
|
+
subject: string;
|
|
2934
|
+
/** The looks it can be drawn in. */
|
|
2935
|
+
styles: Array<"minimal" | "modern" | "bold" | "classic" | "dark" | "soft">;
|
|
2936
|
+
/** The look it is drawn in when you name none. */
|
|
2937
|
+
defaultStyle: "minimal" | "modern" | "bold" | "classic" | "dark" | "soft";
|
|
2938
|
+
}>;
|
|
2939
|
+
/** How many items match in all, on every page together. */
|
|
2940
|
+
total: number;
|
|
2941
|
+
/** Whether more items follow this page. */
|
|
2942
|
+
hasMore: boolean;
|
|
2943
|
+
};
|
|
2944
|
+
/** Get template starter. One ready-made template drawn in one of its looks: its blocks, the defaults of its variables, and the HTML and the plain text it makes with those defaults filled in. Nothing is saved. To make a template from it, pass its id as `starter` to `templates.create`. */
|
|
2945
|
+
starter: {
|
|
2946
|
+
object: "template_starter";
|
|
2947
|
+
/** The id of the starter. Pass it as `starter` to `templates.create`. */
|
|
2948
|
+
id: string;
|
|
2949
|
+
/** The name of the starter. */
|
|
2950
|
+
name: string;
|
|
2951
|
+
/** What the message is for and what it holds. */
|
|
2952
|
+
description: string;
|
|
2953
|
+
/** The kind of mail it is, such as `account` or `commerce`. */
|
|
2954
|
+
category: "account" | "commerce" | "notify" | "marketing" | "events" | "hospitality" | "health" | "education" | "real-estate" | "nonprofit" | "travel" | "recruiting" | "community";
|
|
2955
|
+
/** The subject line a template made from it starts with. `{{name}}` marks a variable. */
|
|
2956
|
+
subject: string;
|
|
2957
|
+
/** The looks it can be drawn in. */
|
|
2958
|
+
styles: Array<"minimal" | "modern" | "bold" | "classic" | "dark" | "soft">;
|
|
2959
|
+
/** The look it is drawn in when you name none. */
|
|
2960
|
+
defaultStyle: "minimal" | "modern" | "bold" | "classic" | "dark" | "soft";
|
|
2961
|
+
/** The variables of its subject and its message, each with its default. */
|
|
2962
|
+
variables: Array<{
|
|
2963
|
+
/** The name of the variable. It stands in the message as `{{name}}`. */
|
|
2964
|
+
name: string;
|
|
2965
|
+
/** What the variable holds, in a few words. */
|
|
2966
|
+
label: string;
|
|
2967
|
+
/** What it takes: `text`, `url` for a full address or `image` for the address of a picture. */
|
|
2968
|
+
kind: "text" | "url" | "image";
|
|
2969
|
+
/** The value it gets when a send gives none. `null` when it has none: it then stays in the message as `{{name}}` until a send fills it. */
|
|
2970
|
+
default: string | null;
|
|
2971
|
+
}>;
|
|
2972
|
+
/** The look it is drawn in here. */
|
|
2973
|
+
style: "minimal" | "modern" | "bold" | "classic" | "dark" | "soft";
|
|
2974
|
+
/** The blocks of the message in that look, shaped like the `design` of a template. */
|
|
2975
|
+
design: {
|
|
2976
|
+
/** The line a mail app shows beside the subject before the message is opened. `{{NAME}}` marks a variable. */
|
|
2977
|
+
preview?: string;
|
|
2978
|
+
/** CSS for the whole message, by property name. A background colour fills the page, a `maxWidth` centres the content, and `fontFamily`, `fontSize` and `lineHeight` are what text gets unless a block sets its own. */
|
|
2979
|
+
style?: {
|
|
2980
|
+
[key: string]: string | number;
|
|
2981
|
+
};
|
|
2982
|
+
/** Colours for the whole message for a reader in dark mode, by property name: `backgroundColor` fills the page, and `color` and `borderColor` go to the content. It takes: color, backgroundColor, borderColor. */
|
|
2983
|
+
dark?: {
|
|
2984
|
+
[key: string]: string | number;
|
|
2985
|
+
};
|
|
2986
|
+
/** Fonts the message loads from an address of your own, 4 at most. A block or the page uses one by naming its `family` in `fontFamily`, and gets its `fallback` added for the mail apps that load no web fonts. */
|
|
2987
|
+
fonts?: BroadcastsCreateInputDesignFonts[];
|
|
2988
|
+
/** CSS of your own for the whole message, up to 20000 characters. It goes into the head after the rules the design makes, and reaches a block by its `className`. A rule that has to beat the style a block carries needs `!important`. `</style`, `@import`, `expression(`, `javascript:`, `behavior:`, `-moz-binding` are refused. */
|
|
2989
|
+
css?: string;
|
|
2990
|
+
/** The blocks of the message, from top to bottom. */
|
|
2991
|
+
body: BroadcastsCreateOutputDesignBody[];
|
|
2992
|
+
};
|
|
2993
|
+
/** The default of every variable that has one, by name. A template made from the starter gets them. */
|
|
2994
|
+
defaults: {
|
|
2995
|
+
[key: string]: string;
|
|
2996
|
+
};
|
|
2997
|
+
/** The HTML the design makes, with the defaults filled in. A variable with no default stays as `{{name}}`. */
|
|
2998
|
+
html: string;
|
|
2999
|
+
/** The same message as plain text. */
|
|
3000
|
+
text: string;
|
|
3001
|
+
};
|
|
3002
|
+
};
|
|
3003
|
+
automations: {
|
|
3004
|
+
/** Create automation. Creates a draft automation: what starts it, its steps and its rules. Nothing runs until it is published. */
|
|
3005
|
+
create: {
|
|
3006
|
+
object: "automation";
|
|
3007
|
+
/** The id of the automation. */
|
|
3008
|
+
id: string;
|
|
3009
|
+
/** The name of the automation. */
|
|
3010
|
+
name: string;
|
|
3011
|
+
/** A sentence about what it is for. Empty when none was given. */
|
|
3012
|
+
description: string;
|
|
3013
|
+
/** `draft` until it is published, `active` while people can enter, `paused` when it is held. */
|
|
3014
|
+
status: "draft" | "active" | "paused";
|
|
3015
|
+
/** Why it is paused: `manual` when a person paused it, what stopped working (`sender`, `template`, `audience` or `webhook`), or `limit` when the plan has no emails left this month. `null` while it is not paused. */
|
|
3016
|
+
pausedReason: "manual" | "sender" | "template" | "audience" | "webhook" | "limit" | null;
|
|
3017
|
+
/** More about why it is paused. Empty when a person paused it. */
|
|
3018
|
+
pausedDetail: string;
|
|
3019
|
+
/** What starts a run, in the copy you edit. */
|
|
3020
|
+
trigger: {
|
|
3021
|
+
/** What starts a run: `event` (an event you send, or a built-in one), `schedule` (a time that repeats, for everyone in an audience), `date` (a date on each contact) or `manual` (only when you enrol someone). */
|
|
3022
|
+
kind: "event" | "schedule" | "date" | "manual";
|
|
3023
|
+
/** For `event`: the name of the event, such as `order.paid`. The built-in names are `contact.created`, `contact.updated`, `contact.subscribed`, `contact.unsubscribed`, `email.delivered`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained` and `email.received`. */
|
|
3024
|
+
event?: string;
|
|
3025
|
+
/** The audience the automation is for. Needed for `schedule` and `date`. For `event` it limits the automation to contacts of that audience. */
|
|
3026
|
+
audienceId?: string;
|
|
3027
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
3028
|
+
match?: "all" | "any";
|
|
3029
|
+
/** For `event`: tests the event and the person have to pass to start a run. */
|
|
3030
|
+
conditions?: Array<{
|
|
3031
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
3032
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
3033
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
3034
|
+
field?: string;
|
|
3035
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
3036
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
3037
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
3038
|
+
value?: string | number | boolean;
|
|
3039
|
+
/** For `email`: the id of the step that sent it. */
|
|
3040
|
+
step?: string;
|
|
3041
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
3042
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
3043
|
+
/** For `event` and `waited`: the name of the event. */
|
|
3044
|
+
event?: string;
|
|
3045
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
3046
|
+
withinDays?: number;
|
|
3047
|
+
/** For `audience`: the id of the audience. */
|
|
3048
|
+
audienceId?: string;
|
|
3049
|
+
/** `true` turns the test around. */
|
|
3050
|
+
not?: boolean;
|
|
3051
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
3052
|
+
match?: "all" | "any";
|
|
3053
|
+
/** For `group`: the tests inside it. */
|
|
3054
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
3055
|
+
}>;
|
|
3056
|
+
/** For `schedule`: how often it repeats: `day`, `week` or `month`. */
|
|
3057
|
+
every?: "day" | "week" | "month";
|
|
3058
|
+
/** For `schedule` and `date`: the time of day it starts, as `HH:MM` in the time zone of the automation. */
|
|
3059
|
+
time?: string;
|
|
3060
|
+
/** For a weekly `schedule`: the days it runs on, such as `["mon", "thu"]`. */
|
|
3061
|
+
days?: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
3062
|
+
/** For a monthly `schedule`: the day of the month, from 1 to 28. */
|
|
3063
|
+
dayOfMonth?: number;
|
|
3064
|
+
/** For `date`: the contact property that holds the date, such as `trial_ends_at`. */
|
|
3065
|
+
property?: string;
|
|
3066
|
+
/** For `date`: how many days after the date to start. A negative number starts before it. */
|
|
3067
|
+
offsetDays?: number;
|
|
3068
|
+
/** For `date`: `true` to start every year on that day, as for a birthday. */
|
|
3069
|
+
yearly?: boolean;
|
|
3070
|
+
};
|
|
3071
|
+
/** The rules of the automation, in the copy you edit. */
|
|
3072
|
+
settings: AutomationsCreateOutputSettings;
|
|
3073
|
+
/** How many steps the copy you edit has. */
|
|
3074
|
+
stepCount: number;
|
|
3075
|
+
/** The number of the published version. 0 when it was never published. */
|
|
3076
|
+
version: number;
|
|
3077
|
+
/** When it was last published, or `null`. */
|
|
3078
|
+
publishedAt: string | null;
|
|
3079
|
+
/** `true` when the copy you edit differs from the published one. */
|
|
3080
|
+
changed: boolean;
|
|
3081
|
+
/** What its runs have done so far. */
|
|
3082
|
+
stats: AutomationsCreateOutputStats;
|
|
3083
|
+
/** When the automation was made. */
|
|
3084
|
+
createdAt: string;
|
|
3085
|
+
/** When it was last changed. */
|
|
3086
|
+
updatedAt: string;
|
|
3087
|
+
/** The steps of the copy you edit. The first one is where a run starts. */
|
|
3088
|
+
steps: Array<{
|
|
3089
|
+
/** An id for the step, unique in the flow: letters, digits and underscores, starting with a letter. */
|
|
3090
|
+
id: string;
|
|
3091
|
+
/** What the step does: `send_email`, `delay`, `wait_until`, `wait_for_event`, `condition`, `branch`, `split`, `update_contact`, `delete_contact`, `add_to_audience`, `remove_from_audience`, `webhook`, `send_event` or `exit`. */
|
|
3092
|
+
kind: "send_email" | "delay" | "wait_until" | "wait_for_event" | "condition" | "branch" | "split" | "update_contact" | "delete_contact" | "add_to_audience" | "remove_from_audience" | "webhook" | "send_event" | "exit";
|
|
3093
|
+
/** A name of your own for the step. */
|
|
3094
|
+
name?: string;
|
|
3095
|
+
/** The id of the step that follows, or `null` to end the run here. Without it the step after this one in the list follows. */
|
|
3096
|
+
next?: string | null;
|
|
3097
|
+
/** For `condition`, `split` and `wait_for_event`: the step that follows when the condition holds, the person lands in the first share, or the event arrives. `null` ends the run. */
|
|
3098
|
+
yes?: string | null;
|
|
3099
|
+
/** For `condition`, `split` and `wait_for_event`: the step that follows otherwise. For `branch`: the step that follows when no path holds. `null` ends the run. */
|
|
3100
|
+
no?: string | null;
|
|
3101
|
+
/** For `send_email`: the sender, on a verified domain, such as `Acme <hello@mail.example.com>`. With a template that has a sender it can be left out. */
|
|
3102
|
+
from?: string;
|
|
3103
|
+
/** For `send_email`: another recipient than the person of the run, such as a team address. */
|
|
3104
|
+
to?: string;
|
|
3105
|
+
/** For `send_email`: the address replies go to. Without it, the one of the template when it has one, then the default of the workspace. */
|
|
3106
|
+
replyTo?: string;
|
|
3107
|
+
/** For `send_email`: the subject line. `{{name}}` slots are filled in. */
|
|
3108
|
+
subject?: string;
|
|
3109
|
+
/** For `send_email`: the message as HTML. `{{name}}` slots are filled in. */
|
|
3110
|
+
html?: string;
|
|
3111
|
+
/** For `send_email`: the message as plain text. With a template it replaces the plain text of the template. */
|
|
3112
|
+
text?: string;
|
|
3113
|
+
/** For `send_email`: the id or the alias of a published template, in place of `subject`, `html` and `text`. */
|
|
3114
|
+
template?: string;
|
|
3115
|
+
/** For `send_email`: values for `{{name}}` slots, by name. A value can hold slots of its own. A slot with no value takes the default of the template. */
|
|
3116
|
+
variables?: {
|
|
3117
|
+
[key: string]: string;
|
|
3118
|
+
};
|
|
3119
|
+
/** For `delay`: how long to wait. For `wait_for_event`: how long to wait for the event before the `no` path is taken. For `wait_until` with a `date`: how long before or after the date to go on. */
|
|
3120
|
+
amount?: number;
|
|
3121
|
+
/** The unit of `amount`: `minutes`, `hours`, `days` or `weeks`. */
|
|
3122
|
+
unit?: "minutes" | "hours" | "days" | "weeks";
|
|
3123
|
+
/** For `wait_until`: the time of day to go on at, as `HH:MM` in the time zone of the automation. With a `date` that has no time, the time on that day. */
|
|
3124
|
+
time?: string;
|
|
3125
|
+
/** For `wait_until`: a date to wait for, in place of a time of day. An ISO 8601 date or time such as `2026-12-24` or `2026-12-24T18:00:00Z`, a Unix time, or a slot that holds one, such as `{{starts_at}}`. A date that has passed lets the run go on at once. */
|
|
3126
|
+
date?: string;
|
|
3127
|
+
/** For `wait_until` with a `date` and an `amount`: `true` to go on that long before the date, such as a day before. Without it, that long after. */
|
|
3128
|
+
before?: boolean;
|
|
3129
|
+
/** For `wait_until`: the days of the week it may go on, such as `["mon", "tue"]`. Without it, any day. */
|
|
3130
|
+
days?: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
3131
|
+
/** For `wait_for_event`: the name of the event to wait for. For `send_event`: the name of the event to send, one of your own. */
|
|
3132
|
+
event?: string;
|
|
3133
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
3134
|
+
match?: "all" | "any";
|
|
3135
|
+
/** For `condition`: the tests. For `wait_for_event`: tests the event has to pass, where `data` reads the event that arrives. */
|
|
3136
|
+
conditions?: Array<{
|
|
3137
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
3138
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
3139
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
3140
|
+
field?: string;
|
|
3141
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
3142
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
3143
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
3144
|
+
value?: string | number | boolean;
|
|
3145
|
+
/** For `email`: the id of the step that sent it. */
|
|
3146
|
+
step?: string;
|
|
3147
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
3148
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
3149
|
+
/** For `event` and `waited`: the name of the event. */
|
|
3150
|
+
event?: string;
|
|
3151
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
3152
|
+
withinDays?: number;
|
|
3153
|
+
/** For `audience`: the id of the audience. */
|
|
3154
|
+
audienceId?: string;
|
|
3155
|
+
/** `true` turns the test around. */
|
|
3156
|
+
not?: boolean;
|
|
3157
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
3158
|
+
match?: "all" | "any";
|
|
3159
|
+
/** For `group`: the tests inside it. */
|
|
3160
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
3161
|
+
}>;
|
|
3162
|
+
/** For `branch`: two to eight paths, tested in order. A run takes the first one whose conditions hold, and the `no` path when none does. */
|
|
3163
|
+
branches?: Array<{
|
|
3164
|
+
/** What the path is called. It shows on the canvas and in the run. */
|
|
3165
|
+
name: string;
|
|
3166
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
3167
|
+
match?: "all" | "any";
|
|
3168
|
+
/** The tests a run has to pass to take this path, as on a `condition` step. */
|
|
3169
|
+
conditions?: Array<{
|
|
3170
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
3171
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
3172
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
3173
|
+
field?: string;
|
|
3174
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
3175
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
3176
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
3177
|
+
value?: string | number | boolean;
|
|
3178
|
+
/** For `email`: the id of the step that sent it. */
|
|
3179
|
+
step?: string;
|
|
3180
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
3181
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
3182
|
+
/** For `event` and `waited`: the name of the event. */
|
|
3183
|
+
event?: string;
|
|
3184
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
3185
|
+
withinDays?: number;
|
|
3186
|
+
/** For `audience`: the id of the audience. */
|
|
3187
|
+
audienceId?: string;
|
|
3188
|
+
/** `true` turns the test around. */
|
|
3189
|
+
not?: boolean;
|
|
3190
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
3191
|
+
match?: "all" | "any";
|
|
3192
|
+
/** For `group`: the tests inside it. */
|
|
3193
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
3194
|
+
}>;
|
|
3195
|
+
/** The id of the step that follows when this path is taken. `null` ends the run. */
|
|
3196
|
+
to?: string | null;
|
|
3197
|
+
}>;
|
|
3198
|
+
/** For `split`: the share of people, in percent, who take the `yes` path. */
|
|
3199
|
+
percent?: number;
|
|
3200
|
+
/** For `update_contact`: a new first name. */
|
|
3201
|
+
firstName?: string;
|
|
3202
|
+
/** For `update_contact`: a new last name. */
|
|
3203
|
+
lastName?: string;
|
|
3204
|
+
/** For `update_contact`: properties to set, by name. `null` removes one. Text can hold `{{name}}` slots. */
|
|
3205
|
+
properties?: {
|
|
3206
|
+
[key: string]: string | number | boolean | null;
|
|
3207
|
+
};
|
|
3208
|
+
/** For `update_contact`: `subscribed` or `unsubscribed`. */
|
|
3209
|
+
subscription?: "subscribed" | "unsubscribed";
|
|
3210
|
+
/** For `add_to_audience` and `remove_from_audience`: the id of the audience. */
|
|
3211
|
+
audienceId?: string;
|
|
3212
|
+
/** For `webhook`: the id of the webhook that gets an `automation.step` event. */
|
|
3213
|
+
webhookId?: string;
|
|
3214
|
+
/** For `send_event`: values that go with the event, by name. Text can hold `{{name}}` slots. */
|
|
3215
|
+
data?: {
|
|
3216
|
+
[key: string]: string | number | boolean;
|
|
3217
|
+
};
|
|
3218
|
+
}>;
|
|
3219
|
+
/** What is missing or wrong in the copy you edit. */
|
|
3220
|
+
problems: AutomationsCreateOutputProblems[];
|
|
3221
|
+
/** What happened at each step, by step id. */
|
|
3222
|
+
stepStats: AutomationsCreateOutputStepStats[];
|
|
3223
|
+
};
|
|
3224
|
+
/** Update automation. Changes the copy you edit: the name, what starts it, its steps or its rules. What is running stays as it was until you publish. */
|
|
3225
|
+
update: OpenSendOutputs["automations"]["create"];
|
|
3226
|
+
/** Publish automation. Makes the copy you edit the one that runs, as a new version, and starts a draft. People already in it finish the version they entered on. It is refused while something is missing, and the answer says what. */
|
|
3227
|
+
publish: OpenSendOutputs["automations"]["create"];
|
|
3228
|
+
/** Pause automation. Pauses an active automation, so nobody new enters. The people already in it are held where they are, finish, or are taken out, as you choose. */
|
|
3229
|
+
pause: OpenSendOutputs["automations"]["create"];
|
|
3230
|
+
/** Resume automation. Starts a paused automation again. The people who were held go on from where they stopped. */
|
|
3231
|
+
resume: OpenSendOutputs["automations"]["create"];
|
|
3232
|
+
/** Test automation. Walks the copy you edit once, now, for one address. Its emails are really sent, with "[Test]" before the subject. Waits are skipped, a wait for an event takes its `no` path, and steps that change contacts or call webhooks are skipped. Nothing is counted. */
|
|
3233
|
+
test: {
|
|
3234
|
+
object: "automation_run";
|
|
3235
|
+
/** The id of the run. */
|
|
3236
|
+
id: string;
|
|
3237
|
+
/** The id of the automation. */
|
|
3238
|
+
automationId: string;
|
|
3239
|
+
/** The version of the automation the run follows. */
|
|
3240
|
+
version: number;
|
|
3241
|
+
/** The address of the person. */
|
|
3242
|
+
email: string;
|
|
3243
|
+
/** The id of their contact, or `null` for a bare address. */
|
|
3244
|
+
contactId: string | null;
|
|
3245
|
+
/** Where the run stands: `running`, `waiting`, `completed`, `exited`, `failed` or `canceled`. */
|
|
3246
|
+
status: "running" | "waiting" | "completed" | "exited" | "failed" | "canceled";
|
|
3247
|
+
/** The id of the step it is at, or `null` once it has ended. */
|
|
3248
|
+
stepId: string | null;
|
|
3249
|
+
/** What started it: the name of the event, or `schedule`, `date`, `manual` or `test`. */
|
|
3250
|
+
source: string;
|
|
3251
|
+
/** `true` for a test run. */
|
|
3252
|
+
test: boolean;
|
|
3253
|
+
/** Why it ended before the end of its path, or `null`. */
|
|
3254
|
+
reason: "exit_step" | "goal" | "unsubscribed" | "contact_deleted" | "automation_deleted" | "automation_stopped" | "missing_variable" | "send_refused" | "step_failed" | "canceled" | null;
|
|
3255
|
+
/** More about how it ended. Empty while it is going on. */
|
|
3256
|
+
detail: string;
|
|
3257
|
+
/** When a waiting run goes on, or `null`. */
|
|
3258
|
+
wakeAt: string | null;
|
|
3259
|
+
/** When the run started. */
|
|
3260
|
+
startedAt: string;
|
|
3261
|
+
/** When it ended, or `null`. */
|
|
3262
|
+
finishedAt: string | null;
|
|
3263
|
+
/** The data of what started it. */
|
|
3264
|
+
data: {
|
|
3265
|
+
[key: string]: unknown;
|
|
3266
|
+
};
|
|
3267
|
+
/** What each step did, oldest first. */
|
|
3268
|
+
steps: AutomationsTestOutputSteps[];
|
|
3269
|
+
};
|
|
3270
|
+
/** Enrol in automation. Starts a run of an active automation for one person, whatever its trigger is. The rule for entering again still holds. */
|
|
3271
|
+
enroll: OpenSendOutputs["automations"]["test"];
|
|
3272
|
+
/** Duplicate automation. Copies the automation you edit into a new draft, with its trigger, steps and rules. */
|
|
3273
|
+
duplicate: OpenSendOutputs["automations"]["create"];
|
|
3274
|
+
/** Retrieve automation. One automation: the copy you edit with what is missing in it, and what happened at each step. */
|
|
3275
|
+
get: OpenSendOutputs["automations"]["create"];
|
|
3276
|
+
/** List automations. The automations of the workspace, newest first, by status and search, each with what its runs have done. */
|
|
3277
|
+
list: {
|
|
3278
|
+
object: "list";
|
|
3279
|
+
/** The items on this page. */
|
|
3280
|
+
data: Array<{
|
|
3281
|
+
object: "automation";
|
|
3282
|
+
/** The id of the automation. */
|
|
3283
|
+
id: string;
|
|
3284
|
+
/** The name of the automation. */
|
|
3285
|
+
name: string;
|
|
3286
|
+
/** A sentence about what it is for. Empty when none was given. */
|
|
3287
|
+
description: string;
|
|
3288
|
+
/** `draft` until it is published, `active` while people can enter, `paused` when it is held. */
|
|
3289
|
+
status: "draft" | "active" | "paused";
|
|
3290
|
+
/** Why it is paused: `manual` when a person paused it, what stopped working (`sender`, `template`, `audience` or `webhook`), or `limit` when the plan has no emails left this month. `null` while it is not paused. */
|
|
3291
|
+
pausedReason: "manual" | "sender" | "template" | "audience" | "webhook" | "limit" | null;
|
|
3292
|
+
/** More about why it is paused. Empty when a person paused it. */
|
|
3293
|
+
pausedDetail: string;
|
|
3294
|
+
/** What starts a run, in the copy you edit. */
|
|
3295
|
+
trigger: {
|
|
3296
|
+
/** What starts a run: `event` (an event you send, or a built-in one), `schedule` (a time that repeats, for everyone in an audience), `date` (a date on each contact) or `manual` (only when you enrol someone). */
|
|
3297
|
+
kind: "event" | "schedule" | "date" | "manual";
|
|
3298
|
+
/** For `event`: the name of the event, such as `order.paid`. The built-in names are `contact.created`, `contact.updated`, `contact.subscribed`, `contact.unsubscribed`, `email.delivered`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained` and `email.received`. */
|
|
3299
|
+
event?: string;
|
|
3300
|
+
/** The audience the automation is for. Needed for `schedule` and `date`. For `event` it limits the automation to contacts of that audience. */
|
|
3301
|
+
audienceId?: string;
|
|
3302
|
+
/** `all` when every condition has to hold, `any` when one is enough. Without it, all. */
|
|
3303
|
+
match?: "all" | "any";
|
|
3304
|
+
/** For `event`: tests the event and the person have to pass to start a run. */
|
|
3305
|
+
conditions?: Array<{
|
|
3306
|
+
/** What is tested: `data` (a value in what started the run), `waited` (a value in an event a wait step received), `contact` (a field or a property of the contact), `email` (what happened to an email this run sent), `event` (whether the person sent an event), `audience` (whether they are in an audience), `subscribed` (whether the contact is subscribed) or `group` (several tests as one). */
|
|
3307
|
+
kind: "data" | "waited" | "contact" | "email" | "event" | "audience" | "subscribed" | "group";
|
|
3308
|
+
/** For `data`, `waited` and `contact`: the name of the value, such as `plan` or `order.total`. A contact has `email`, `first_name`, `last_name`, `status` and its properties. */
|
|
3309
|
+
field?: string;
|
|
3310
|
+
/** For `data`, `waited` and `contact`: how the value is compared. `exists` and `is_empty` take no `value`. */
|
|
3311
|
+
operator?: "equals" | "not_equals" | "greater_than" | "greater_or_equal" | "less_than" | "less_or_equal" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists" | "is_empty";
|
|
3312
|
+
/** What the value is compared with. Text can hold `{{name}}` slots, filled from what started the run. */
|
|
3313
|
+
value?: string | number | boolean;
|
|
3314
|
+
/** For `email`: the id of the step that sent it. */
|
|
3315
|
+
step?: string;
|
|
3316
|
+
/** For `email`: what has to have happened to it: `delivered`, `opened`, `clicked`, `bounced` or `complained`. */
|
|
3317
|
+
status?: "delivered" | "opened" | "clicked" | "bounced" | "complained";
|
|
3318
|
+
/** For `event` and `waited`: the name of the event. */
|
|
3319
|
+
event?: string;
|
|
3320
|
+
/** For `event`: how many days back to look. Without it, since the run started. */
|
|
3321
|
+
withinDays?: number;
|
|
3322
|
+
/** For `audience`: the id of the audience. */
|
|
3323
|
+
audienceId?: string;
|
|
3324
|
+
/** `true` turns the test around. */
|
|
3325
|
+
not?: boolean;
|
|
3326
|
+
/** For `group`: `all` when every test inside has to hold, `any` when one is enough. */
|
|
3327
|
+
match?: "all" | "any";
|
|
3328
|
+
/** For `group`: the tests inside it. */
|
|
3329
|
+
conditions?: AutomationsCreateInputTriggerConditionsConditions[];
|
|
3330
|
+
}>;
|
|
3331
|
+
/** For `schedule`: how often it repeats: `day`, `week` or `month`. */
|
|
3332
|
+
every?: "day" | "week" | "month";
|
|
3333
|
+
/** For `schedule` and `date`: the time of day it starts, as `HH:MM` in the time zone of the automation. */
|
|
3334
|
+
time?: string;
|
|
3335
|
+
/** For a weekly `schedule`: the days it runs on, such as `["mon", "thu"]`. */
|
|
3336
|
+
days?: Array<"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat">;
|
|
3337
|
+
/** For a monthly `schedule`: the day of the month, from 1 to 28. */
|
|
3338
|
+
dayOfMonth?: number;
|
|
3339
|
+
/** For `date`: the contact property that holds the date, such as `trial_ends_at`. */
|
|
3340
|
+
property?: string;
|
|
3341
|
+
/** For `date`: how many days after the date to start. A negative number starts before it. */
|
|
3342
|
+
offsetDays?: number;
|
|
3343
|
+
/** For `date`: `true` to start every year on that day, as for a birthday. */
|
|
3344
|
+
yearly?: boolean;
|
|
3345
|
+
};
|
|
3346
|
+
/** The rules of the automation, in the copy you edit. */
|
|
3347
|
+
settings: AutomationsCreateOutputSettings;
|
|
3348
|
+
/** How many steps the copy you edit has. */
|
|
3349
|
+
stepCount: number;
|
|
3350
|
+
/** The number of the published version. 0 when it was never published. */
|
|
3351
|
+
version: number;
|
|
3352
|
+
/** When it was last published, or `null`. */
|
|
3353
|
+
publishedAt: string | null;
|
|
3354
|
+
/** `true` when the copy you edit differs from the published one. */
|
|
3355
|
+
changed: boolean;
|
|
3356
|
+
/** What its runs have done so far. */
|
|
3357
|
+
stats: AutomationsCreateOutputStats;
|
|
3358
|
+
/** When the automation was made. */
|
|
3359
|
+
createdAt: string;
|
|
3360
|
+
/** When it was last changed. */
|
|
3361
|
+
updatedAt: string;
|
|
3362
|
+
}>;
|
|
3363
|
+
/** How many items match in all, on every page together. */
|
|
3364
|
+
total: number;
|
|
3365
|
+
/** Whether more items follow this page. */
|
|
3366
|
+
hasMore: boolean;
|
|
3367
|
+
};
|
|
3368
|
+
/** Delete automation. Deletes an automation with its versions. The runs still going end at their next step. */
|
|
3369
|
+
remove: BroadcastsRemoveOutput;
|
|
3370
|
+
};
|
|
3371
|
+
runs: {
|
|
3372
|
+
/** List runs. The runs of one automation, newest first: one for each time a person went through it, by status and address. */
|
|
3373
|
+
list: {
|
|
3374
|
+
object: "list";
|
|
3375
|
+
/** The items on this page. */
|
|
3376
|
+
data: Array<{
|
|
3377
|
+
object: "automation_run";
|
|
3378
|
+
/** The id of the run. */
|
|
3379
|
+
id: string;
|
|
3380
|
+
/** The id of the automation. */
|
|
3381
|
+
automationId: string;
|
|
3382
|
+
/** The version of the automation the run follows. */
|
|
3383
|
+
version: number;
|
|
3384
|
+
/** The address of the person. */
|
|
3385
|
+
email: string;
|
|
3386
|
+
/** The id of their contact, or `null` for a bare address. */
|
|
3387
|
+
contactId: string | null;
|
|
3388
|
+
/** Where the run stands: `running`, `waiting`, `completed`, `exited`, `failed` or `canceled`. */
|
|
3389
|
+
status: "running" | "waiting" | "completed" | "exited" | "failed" | "canceled";
|
|
3390
|
+
/** The id of the step it is at, or `null` once it has ended. */
|
|
3391
|
+
stepId: string | null;
|
|
3392
|
+
/** What started it: the name of the event, or `schedule`, `date`, `manual` or `test`. */
|
|
3393
|
+
source: string;
|
|
3394
|
+
/** `true` for a test run. */
|
|
3395
|
+
test: boolean;
|
|
3396
|
+
/** Why it ended before the end of its path, or `null`. */
|
|
3397
|
+
reason: "exit_step" | "goal" | "unsubscribed" | "contact_deleted" | "automation_deleted" | "automation_stopped" | "missing_variable" | "send_refused" | "step_failed" | "canceled" | null;
|
|
3398
|
+
/** More about how it ended. Empty while it is going on. */
|
|
3399
|
+
detail: string;
|
|
3400
|
+
/** When a waiting run goes on, or `null`. */
|
|
3401
|
+
wakeAt: string | null;
|
|
3402
|
+
/** When the run started. */
|
|
3403
|
+
startedAt: string;
|
|
3404
|
+
/** When it ended, or `null`. */
|
|
3405
|
+
finishedAt: string | null;
|
|
3406
|
+
}>;
|
|
3407
|
+
/** How many items match in all, on every page together. */
|
|
3408
|
+
total: number;
|
|
3409
|
+
/** Whether more items follow this page. */
|
|
3410
|
+
hasMore: boolean;
|
|
3411
|
+
};
|
|
3412
|
+
/** Retrieve run. One run with the data that started it and what each step did. */
|
|
3413
|
+
get: OpenSendOutputs["automations"]["test"];
|
|
3414
|
+
/** Cancel run. Takes one person out of an automation. Emails already sent are not recalled. */
|
|
3415
|
+
cancel: OpenSendOutputs["automations"]["test"];
|
|
3416
|
+
/** Retry run. Lets a run that failed go on from the step it failed at, on the version it entered with. An email it failed to send is really sent this time. It is refused for a run that did not fail. */
|
|
3417
|
+
retry: OpenSendOutputs["automations"]["test"];
|
|
3418
|
+
};
|
|
3419
|
+
events: {
|
|
3420
|
+
/** Send event. Tells the workspace that something happened to one person. Every active automation that listens for the event starts a run, runs that wait for it go on, and runs it is an exit for end. The answer says how many of each. */
|
|
3421
|
+
send: EventsSendOutput;
|
|
3422
|
+
/** Define event. Defines an event before it is sent, with the types its data has to carry. An event that is sent without being defined defines itself, with no types. */
|
|
3423
|
+
create: EventsCreateOutput;
|
|
3424
|
+
/** List events. The events the workspace knows, newest first, each with how often it was sent and when last. */
|
|
3425
|
+
list: {
|
|
3426
|
+
object: "list";
|
|
3427
|
+
/** The items on this page. */
|
|
3428
|
+
data: EventsCreateOutput[];
|
|
3429
|
+
/** How many items match in all, on every page together. */
|
|
3430
|
+
total: number;
|
|
3431
|
+
/** Whether more items follow this page. */
|
|
3432
|
+
hasMore: boolean;
|
|
3433
|
+
};
|
|
3434
|
+
/** Retrieve event. One event by its id or its name, with the latest times it was sent and what each one set off. */
|
|
3435
|
+
get: {
|
|
3436
|
+
object: "event";
|
|
3437
|
+
/** The id of the event. */
|
|
3438
|
+
id: string;
|
|
3439
|
+
/** The name of the event, such as `order.paid`. */
|
|
3440
|
+
name: string;
|
|
3441
|
+
/** The type of each value its data has to carry: `string`, `number`, `boolean` or `date`. `null` takes any data. */
|
|
3442
|
+
schema: {
|
|
3443
|
+
[key: string]: "string" | "number" | "boolean" | "date";
|
|
3444
|
+
} | null;
|
|
3445
|
+
/** How many times it has been sent. */
|
|
3446
|
+
received: number;
|
|
3447
|
+
/** When it was last sent, or `null`. */
|
|
3448
|
+
lastReceivedAt: string | null;
|
|
3449
|
+
/** When the event was first defined or sent. */
|
|
3450
|
+
createdAt: string;
|
|
3451
|
+
/** The latest times it was sent, newest first, with what each one set off. */
|
|
3452
|
+
recent: EventsSendOutput[];
|
|
3453
|
+
};
|
|
3454
|
+
/** Update event. Changes the types the data of an event has to carry, or clears them. */
|
|
3455
|
+
update: EventsCreateOutput;
|
|
3456
|
+
/** Delete event. Forgets an event and its types. Automations that listen for its name keep listening, what was received stays listed for ninety days, and sending it again defines it again. */
|
|
3457
|
+
remove: BroadcastsRemoveOutput;
|
|
3458
|
+
};
|
|
3459
|
+
metrics: {
|
|
3460
|
+
/** Retrieve metrics. Volume, delivery and engagement for a period: totals, rates, one row a day and one row a domain. */
|
|
3461
|
+
get: {
|
|
3462
|
+
object: "metrics";
|
|
3463
|
+
/** The start of the period, or `null` when it has no start. */
|
|
3464
|
+
from: string | null;
|
|
3465
|
+
/** The end of the period. */
|
|
3466
|
+
to: string;
|
|
3467
|
+
/** The counts for the whole period. */
|
|
3468
|
+
totals: {
|
|
3469
|
+
/** How many emails were sent. */
|
|
3470
|
+
sent: number;
|
|
3471
|
+
/** How many were delivered. */
|
|
3472
|
+
delivered: number;
|
|
3473
|
+
/** How many were opened. */
|
|
3474
|
+
opened: number;
|
|
3475
|
+
/** How many had a link clicked. */
|
|
3476
|
+
clicked: number;
|
|
3477
|
+
/** How many bounced. */
|
|
3478
|
+
bounced: number;
|
|
3479
|
+
/** How many were marked as spam by the recipient. */
|
|
3480
|
+
complained: number;
|
|
3481
|
+
};
|
|
3482
|
+
/** The same counts as fractions, from 0 to 1. */
|
|
3483
|
+
rates: {
|
|
3484
|
+
/** Delivered, as a fraction of what was sent. */
|
|
3485
|
+
delivered: number;
|
|
3486
|
+
/** Opened, as a fraction of what was delivered. */
|
|
3487
|
+
opened: number;
|
|
3488
|
+
/** Clicked, as a fraction of what was delivered. */
|
|
3489
|
+
clicked: number;
|
|
3490
|
+
/** Bounced, as a fraction of what was sent. */
|
|
3491
|
+
bounced: number;
|
|
3492
|
+
/** Complaints, as a fraction of what was sent. */
|
|
3493
|
+
complained: number;
|
|
3494
|
+
};
|
|
3495
|
+
/** One entry for each day of the period, oldest first. */
|
|
3496
|
+
days: Array<{
|
|
3497
|
+
/** How many emails were sent. */
|
|
3498
|
+
sent: number;
|
|
3499
|
+
/** How many were delivered. */
|
|
3500
|
+
delivered: number;
|
|
3501
|
+
/** How many were opened. */
|
|
3502
|
+
opened: number;
|
|
3503
|
+
/** How many had a link clicked. */
|
|
3504
|
+
clicked: number;
|
|
3505
|
+
/** How many bounced. */
|
|
3506
|
+
bounced: number;
|
|
3507
|
+
/** How many were marked as spam by the recipient. */
|
|
3508
|
+
complained: number;
|
|
3509
|
+
/** The day, as `YYYY-MM-DD` in UTC. */
|
|
3510
|
+
day: string;
|
|
3511
|
+
}>;
|
|
3512
|
+
/** One entry for each sending domain. */
|
|
3513
|
+
domains: Array<{
|
|
3514
|
+
/** How many emails were sent. */
|
|
3515
|
+
sent: number;
|
|
3516
|
+
/** How many were delivered. */
|
|
3517
|
+
delivered: number;
|
|
3518
|
+
/** How many were opened. */
|
|
3519
|
+
opened: number;
|
|
3520
|
+
/** How many had a link clicked. */
|
|
3521
|
+
clicked: number;
|
|
3522
|
+
/** How many bounced. */
|
|
3523
|
+
bounced: number;
|
|
3524
|
+
/** How many were marked as spam by the recipient. */
|
|
3525
|
+
complained: number;
|
|
3526
|
+
/** The sending domain. */
|
|
3527
|
+
domain: string;
|
|
3528
|
+
}>;
|
|
3529
|
+
};
|
|
3530
|
+
};
|
|
3531
|
+
domains: {
|
|
3532
|
+
/** Add domain. Adds a domain to the workspace and returns the DNS records to publish before it can send. */
|
|
3533
|
+
create: {
|
|
3534
|
+
object: "domain";
|
|
3535
|
+
/** The id of the domain. */
|
|
3536
|
+
id: string;
|
|
3537
|
+
/** The domain name, such as `mail.example.com`. */
|
|
3538
|
+
name: string;
|
|
3539
|
+
/** Where verification stands: `pending` until every record is found, `verified` after that, `failed` when a record is wrong. */
|
|
3540
|
+
status: "pending" | "verified" | "failed";
|
|
3541
|
+
/** The region mail from this domain is sent from. */
|
|
3542
|
+
region: "us-east-1" | "eu-west-1" | "ap-northeast-1";
|
|
3543
|
+
/** Whether opens are counted for mail from this domain. */
|
|
3544
|
+
openTracking: boolean;
|
|
3545
|
+
/** Whether clicks are counted for mail from this domain. */
|
|
3546
|
+
clickTracking: boolean;
|
|
3547
|
+
/** The DNS records to publish, each with whether it was found. */
|
|
3548
|
+
records: DomainsCreateOutputRecords[];
|
|
3549
|
+
/** What has happened to the domain since it was added. */
|
|
3550
|
+
events: Array<{
|
|
3551
|
+
/** The id of the event. */
|
|
3552
|
+
id: string;
|
|
3553
|
+
/** What happened, in a few words. */
|
|
3554
|
+
title: string;
|
|
3555
|
+
/** When it happened. */
|
|
3556
|
+
at: string;
|
|
3557
|
+
/** Where verification stood after it. */
|
|
3558
|
+
status: "pending" | "verified" | "failed";
|
|
3559
|
+
/** More about what happened. */
|
|
3560
|
+
detail: string;
|
|
3561
|
+
}>;
|
|
3562
|
+
/** When the domain was added. */
|
|
3563
|
+
createdAt: string;
|
|
3564
|
+
};
|
|
3565
|
+
/** Verify domain. Looks up every DNS record of the domain and marks each one verified or still pending. */
|
|
3566
|
+
verify: OpenSendOutputs["domains"]["create"];
|
|
3567
|
+
/** Retrieve domain. One domain with its DNS records and the history of its checks. */
|
|
3568
|
+
get: OpenSendOutputs["domains"]["create"];
|
|
3569
|
+
/** List domains. The domains of the workspace, newest first, with their status and region. */
|
|
3570
|
+
list: {
|
|
3571
|
+
object: "list";
|
|
3572
|
+
/** The items on this page. */
|
|
3573
|
+
data: Array<{
|
|
3574
|
+
object: "domain";
|
|
3575
|
+
/** The id of the domain. */
|
|
3576
|
+
id: string;
|
|
3577
|
+
/** The domain name, such as `mail.example.com`. */
|
|
3578
|
+
name: string;
|
|
3579
|
+
/** Where verification stands: `pending` until every record is found, `verified` after that, `failed` when a record is wrong. */
|
|
3580
|
+
status: "pending" | "verified" | "failed";
|
|
3581
|
+
/** The region mail from this domain is sent from. */
|
|
3582
|
+
region: "us-east-1" | "eu-west-1" | "ap-northeast-1";
|
|
3583
|
+
/** Whether opens are counted for mail from this domain. */
|
|
3584
|
+
openTracking: boolean;
|
|
3585
|
+
/** Whether clicks are counted for mail from this domain. */
|
|
3586
|
+
clickTracking: boolean;
|
|
3587
|
+
/** The DNS records to publish, each with whether it was found. */
|
|
3588
|
+
records: DomainsCreateOutputRecords[];
|
|
3589
|
+
/** What has happened to the domain since it was added. */
|
|
3590
|
+
events: Array<{
|
|
3591
|
+
/** The id of the event. */
|
|
3592
|
+
id: string;
|
|
3593
|
+
/** What happened, in a few words. */
|
|
3594
|
+
title: string;
|
|
3595
|
+
/** When it happened. */
|
|
3596
|
+
at: string;
|
|
3597
|
+
/** Where verification stood after it. */
|
|
3598
|
+
status: "pending" | "verified" | "failed";
|
|
3599
|
+
/** More about what happened. */
|
|
3600
|
+
detail: string;
|
|
3601
|
+
}>;
|
|
3602
|
+
/** When the domain was added. */
|
|
3603
|
+
createdAt: string;
|
|
3604
|
+
}>;
|
|
3605
|
+
/** How many items match in all, on every page together. */
|
|
3606
|
+
total: number;
|
|
3607
|
+
/** Whether more items follow this page. */
|
|
3608
|
+
hasMore: boolean;
|
|
3609
|
+
};
|
|
3610
|
+
/** Update domain. Switches open tracking and click tracking on or off for a domain. */
|
|
3611
|
+
update: OpenSendOutputs["domains"]["create"];
|
|
3612
|
+
/** Delete domain. Removes a domain from the workspace. Mail can no longer be sent from it. */
|
|
3613
|
+
remove: BroadcastsRemoveOutput;
|
|
3614
|
+
};
|
|
3615
|
+
apiKeys: {
|
|
3616
|
+
/** Create API key. Creates an API key. The token is in this answer and is never shown again, so store it now. A key with sending access can be limited to one domain: it then sends from that domain only. With `mode: test` the key belongs to the sandbox: what it sends is simulated and reaches nobody. */
|
|
3617
|
+
create: {
|
|
3618
|
+
object: "api_key";
|
|
3619
|
+
/** The id of the key. */
|
|
3620
|
+
id: string;
|
|
3621
|
+
/** The name you gave the key. */
|
|
3622
|
+
name: string;
|
|
3623
|
+
/** What the key may do: `full` for everything, `sending` for sending email and nothing else. */
|
|
3624
|
+
access: "full" | "sending";
|
|
3625
|
+
/** `live` for a key that sends real email, `test` for a key whose emails are simulated and reach nobody. */
|
|
3626
|
+
mode: "live" | "test";
|
|
3627
|
+
/** The start of the key, enough to recognise it. */
|
|
3628
|
+
preview: string;
|
|
3629
|
+
/** The id of the one domain a sending key may send from, or `null` when it may send from any. */
|
|
3630
|
+
domainId: string | null;
|
|
3631
|
+
/** The name of that domain, or `null`. */
|
|
3632
|
+
domain: string | null;
|
|
3633
|
+
/** When the key last made a request, or `null` if it never has. */
|
|
3634
|
+
lastUsedAt: string | null;
|
|
3635
|
+
/** When the key was made. */
|
|
3636
|
+
createdAt: string;
|
|
3637
|
+
/** The key itself. It is shown this once and cannot be read again. */
|
|
3638
|
+
token: string;
|
|
3639
|
+
};
|
|
3640
|
+
/** Enroll existing API key. Makes a key you already use at Resend work here, so a program that holds it only needs a new address. The key is checked with Resend, kept as a hash like any other key, and gets the access it has there unless you narrow it. */
|
|
3641
|
+
enroll: ApiKeysEnrollOutput;
|
|
3642
|
+
/** List API keys. The API keys of the workspace, with what each may do and when it was last used. */
|
|
3643
|
+
list: {
|
|
3644
|
+
object: "list";
|
|
3645
|
+
/** The items on this page. */
|
|
3646
|
+
data: ApiKeysEnrollOutput[];
|
|
3647
|
+
/** How many items match in all, on every page together. */
|
|
3648
|
+
total: number;
|
|
3649
|
+
/** Whether more items follow this page. */
|
|
3650
|
+
hasMore: boolean;
|
|
3651
|
+
};
|
|
3652
|
+
/** Revoke API key. Revokes an API key at once. Requests that use it are refused from then on. */
|
|
3653
|
+
remove: BroadcastsRemoveOutput;
|
|
3654
|
+
};
|
|
3655
|
+
webhooks: {
|
|
3656
|
+
/** Add webhook. Adds an endpoint that is told about the events you pick. The signing secret is in this answer and is never shown again. */
|
|
3657
|
+
create: {
|
|
3658
|
+
object: "webhook";
|
|
3659
|
+
/** The id of the webhook. */
|
|
3660
|
+
id: string;
|
|
3661
|
+
/** The address events are posted to. */
|
|
3662
|
+
url: string;
|
|
3663
|
+
/** The events it is told about. */
|
|
3664
|
+
events: Array<"email.sent" | "email.delivered" | "email.delayed" | "email.bounced" | "email.opened" | "email.clicked" | "email.complained" | "email.failed" | "email.received" | "email.scheduled" | "email.canceled" | "automation.entered" | "automation.finished" | "automation.step">;
|
|
3665
|
+
/** `enabled` while events are posted to it, `disabled` when it is switched off. */
|
|
3666
|
+
status: "enabled" | "disabled";
|
|
3667
|
+
/** How an event is written and signed: `native` is this API, `resend` is the headers, signature and body an endpoint built for Resend expects. */
|
|
3668
|
+
format: "native" | "resend";
|
|
3669
|
+
/** When an event was last posted to it, or `null`. */
|
|
3670
|
+
lastDeliveryAt: string | null;
|
|
3671
|
+
/** The HTTP status your address answered with last time, or `null`. */
|
|
3672
|
+
lastStatus: number | null;
|
|
3673
|
+
/** When the webhook was added. */
|
|
3674
|
+
createdAt: string;
|
|
3675
|
+
/** The secret to check signatures with. It is shown this once and cannot be read again. */
|
|
3676
|
+
secret: string;
|
|
3677
|
+
};
|
|
3678
|
+
/** List webhooks. The endpoints of the workspace with the events each one receives. */
|
|
3679
|
+
list: {
|
|
3680
|
+
object: "list";
|
|
3681
|
+
/** The items on this page. */
|
|
3682
|
+
data: WebhooksListOutputData[];
|
|
3683
|
+
/** How many items match in all, on every page together. */
|
|
3684
|
+
total: number;
|
|
3685
|
+
/** Whether more items follow this page. */
|
|
3686
|
+
hasMore: boolean;
|
|
3687
|
+
};
|
|
3688
|
+
/** Update webhook. Changes the address, the events or whether an endpoint is switched on. */
|
|
3689
|
+
update: WebhooksListOutputData;
|
|
3690
|
+
/** Delete webhook. Deletes an endpoint. It is told about nothing from then on. */
|
|
3691
|
+
remove: BroadcastsRemoveOutput;
|
|
3692
|
+
/** Send test event. Posts one signed sample event to an endpoint and answers with what the endpoint said. */
|
|
3693
|
+
test: WebhooksTestOutput;
|
|
3694
|
+
/** List webhook deliveries. What was posted to an endpoint, newest first, with the answer and the tries. */
|
|
3695
|
+
deliveries: {
|
|
3696
|
+
object: "list";
|
|
3697
|
+
/** The items on this page. */
|
|
3698
|
+
data: WebhooksTestOutput[];
|
|
3699
|
+
/** How many items match in all, on every page together. */
|
|
3700
|
+
total: number;
|
|
3701
|
+
/** Whether more items follow this page. */
|
|
3702
|
+
hasMore: boolean;
|
|
3703
|
+
};
|
|
3704
|
+
};
|
|
3705
|
+
imports: {
|
|
3706
|
+
/** Look into another account. Counts what a key can read in a Resend account: domains, contacts, templates, webhooks and the rest, and says which of them an import brings over. It reads and changes nothing, there or here, and the key is not kept. */
|
|
3707
|
+
inspect: {
|
|
3708
|
+
object: "import_inventory";
|
|
3709
|
+
/** The service whose account was looked into: `resend`. */
|
|
3710
|
+
source: "resend";
|
|
3711
|
+
/** Everything the key can read there, with how much of it there is. */
|
|
3712
|
+
resources: Array<{
|
|
3713
|
+
/** What was counted. */
|
|
3714
|
+
resource: "domains" | "suppressions" | "audiences" | "contacts" | "templates" | "broadcasts" | "webhooks" | "api_keys" | "topics" | "contact_properties" | "automations" | "events";
|
|
3715
|
+
/** How many the first page holds, up to 100. */
|
|
3716
|
+
count: number;
|
|
3717
|
+
/** Whether there are more than that. */
|
|
3718
|
+
more: boolean;
|
|
3719
|
+
/** Whether an import brings it over. */
|
|
3720
|
+
importable: boolean;
|
|
3721
|
+
/** What to know before bringing it over: why it stays behind when it does, or how it arrives. Empty when there is nothing to add. */
|
|
3722
|
+
note: string;
|
|
3723
|
+
}>;
|
|
3724
|
+
};
|
|
3725
|
+
/** Start import. Brings a Resend account over: its domains, suppression list, segments as audiences, contacts, templates, draft broadcasts and webhooks, and the names of its API keys. It runs in the background and can be run again: what is already here is left alone. Nothing arrives in a state that sends, and the key is kept sealed only while the import runs. */
|
|
3726
|
+
create: {
|
|
3727
|
+
object: "import";
|
|
3728
|
+
/** The id of the import. */
|
|
3729
|
+
id: string;
|
|
3730
|
+
/** The service it reads the account from: `resend`. */
|
|
3731
|
+
source: "resend";
|
|
3732
|
+
/** Where it stands: `queued` before it starts, `running` while it reads, then `completed`, `failed` or `canceled`. */
|
|
3733
|
+
status: "queued" | "running" | "completed" | "failed" | "canceled";
|
|
3734
|
+
/** What was asked for, in the order it is done. */
|
|
3735
|
+
resources: Array<"domains" | "suppressions" | "audiences" | "contacts" | "templates" | "broadcasts" | "webhooks" | "api_keys" | "topics" | "contact_properties" | "automations" | "events">;
|
|
3736
|
+
/** What is being read right now, or `null`. */
|
|
3737
|
+
step: "domains" | "suppressions" | "audiences" | "contacts" | "templates" | "broadcasts" | "webhooks" | "api_keys" | "topics" | "contact_properties" | "automations" | "events" | null;
|
|
3738
|
+
/** One entry for each thing that was asked for, with what came over and what did not. */
|
|
3739
|
+
report: ImportsCreateOutputReport[];
|
|
3740
|
+
/** Why it failed, or what it is waiting on before it tries again. `null` otherwise. */
|
|
3741
|
+
error: string | null;
|
|
3742
|
+
/** When the import was started. */
|
|
3743
|
+
createdAt: string;
|
|
3744
|
+
/** When it ended, or `null` while it runs. */
|
|
3745
|
+
finishedAt: string | null;
|
|
3746
|
+
};
|
|
3747
|
+
/** Retrieve import. One import with where it stands and its report so far. */
|
|
3748
|
+
get: OpenSendOutputs["imports"]["create"];
|
|
3749
|
+
/** List imports. The imports of the workspace, newest first, each with its report. */
|
|
3750
|
+
list: {
|
|
3751
|
+
object: "list";
|
|
3752
|
+
/** The items on this page. */
|
|
3753
|
+
data: Array<{
|
|
3754
|
+
object: "import";
|
|
3755
|
+
/** The id of the import. */
|
|
3756
|
+
id: string;
|
|
3757
|
+
/** The service it reads the account from: `resend`. */
|
|
3758
|
+
source: "resend";
|
|
3759
|
+
/** Where it stands: `queued` before it starts, `running` while it reads, then `completed`, `failed` or `canceled`. */
|
|
3760
|
+
status: "queued" | "running" | "completed" | "failed" | "canceled";
|
|
3761
|
+
/** What was asked for, in the order it is done. */
|
|
3762
|
+
resources: Array<"domains" | "suppressions" | "audiences" | "contacts" | "templates" | "broadcasts" | "webhooks" | "api_keys" | "topics" | "contact_properties" | "automations" | "events">;
|
|
3763
|
+
/** What is being read right now, or `null`. */
|
|
3764
|
+
step: "domains" | "suppressions" | "audiences" | "contacts" | "templates" | "broadcasts" | "webhooks" | "api_keys" | "topics" | "contact_properties" | "automations" | "events" | null;
|
|
3765
|
+
/** One entry for each thing that was asked for, with what came over and what did not. */
|
|
3766
|
+
report: ImportsCreateOutputReport[];
|
|
3767
|
+
/** Why it failed, or what it is waiting on before it tries again. `null` otherwise. */
|
|
3768
|
+
error: string | null;
|
|
3769
|
+
/** When the import was started. */
|
|
3770
|
+
createdAt: string;
|
|
3771
|
+
/** When it ended, or `null` while it runs. */
|
|
3772
|
+
finishedAt: string | null;
|
|
3773
|
+
}>;
|
|
3774
|
+
/** How many items match in all, on every page together. */
|
|
3775
|
+
total: number;
|
|
3776
|
+
/** Whether more items follow this page. */
|
|
3777
|
+
hasMore: boolean;
|
|
3778
|
+
};
|
|
3779
|
+
/** Cancel import. Stops an import that is queued or running and wipes its key. What it already brought over stays. */
|
|
3780
|
+
cancel: OpenSendOutputs["imports"]["create"];
|
|
3781
|
+
};
|
|
3782
|
+
images: {
|
|
3783
|
+
/** Add image. Copies the image at an address and answers with where the copy is served. Emails then link the copy in place of that address. The same address twice answers with the copy that is there, and an image that failed is tried again. */
|
|
3784
|
+
add: ImagesAddOutput;
|
|
3785
|
+
/** Upload image. Stores an image file and answers with the address it is served at, which is the address to write in an email. It takes a PNG, JPEG, GIF or WebP file of 5 MB at most, sent as Base64, and reads the kind from the file itself. The same file twice answers with the image that is there. */
|
|
3786
|
+
upload: ImagesAddOutput;
|
|
3787
|
+
/** List images. The images of the workspace, copied from an address or uploaded, newest first, by status and search. */
|
|
3788
|
+
list: {
|
|
3789
|
+
object: "list";
|
|
3790
|
+
/** The items on this page. */
|
|
3791
|
+
data: ImagesAddOutput[];
|
|
3792
|
+
/** How many items match in all, on every page together. */
|
|
3793
|
+
total: number;
|
|
3794
|
+
/** Whether more items follow this page. */
|
|
3795
|
+
hasMore: boolean;
|
|
3796
|
+
};
|
|
3797
|
+
/** Retrieve image. One image: where it came from, whether it is ready and where it is served. */
|
|
3798
|
+
get: ImagesAddOutput;
|
|
3799
|
+
/** Delete image. Deletes the stored file and forgets the image. Emails that were already sent stop showing it, because they link that file. A copied image that a template or a broadcast still uses is copied again the next time that one is saved. An uploaded image has no address to copy it from: it comes back, at the same address, when the same file is uploaded again. */
|
|
3800
|
+
remove: BroadcastsRemoveOutput;
|
|
3801
|
+
};
|
|
3802
|
+
billing: {
|
|
3803
|
+
/** List plans. The plans, what each allows in a month, what it costs by the month and by the year, what emails past a limit cost, and which one the workspace is on. */
|
|
3804
|
+
plans: {
|
|
3805
|
+
object: "list";
|
|
3806
|
+
/** Every plan, cheapest first. */
|
|
3807
|
+
data: Array<{
|
|
3808
|
+
object: "plan";
|
|
3809
|
+
/** The id of the plan: `free`, `pro` or `max`. */
|
|
3810
|
+
id: "free" | "pro" | "max";
|
|
3811
|
+
/** The name of the plan. */
|
|
3812
|
+
name: string;
|
|
3813
|
+
/** What it costs a month, in cents of a US dollar. */
|
|
3814
|
+
priceCents: number;
|
|
3815
|
+
/** What a year costs when it is paid by the year, in cents of a US dollar. */
|
|
3816
|
+
yearlyPriceCents: number;
|
|
3817
|
+
/** What every 1,000 emails past a limit cost, in cents of a US dollar. `null` when sending stops at the limit instead. */
|
|
3818
|
+
extraEmailCents: number | null;
|
|
3819
|
+
/** What the plan allows in a month, by limit id. */
|
|
3820
|
+
limits: {
|
|
3821
|
+
[key: string]: number;
|
|
3822
|
+
};
|
|
3823
|
+
/** Whether the workspace is on this plan now. */
|
|
3824
|
+
current: boolean;
|
|
3825
|
+
/** Whether this installation sells the plan by the month, so a checkout can be opened. */
|
|
3826
|
+
sold: boolean;
|
|
3827
|
+
/** Whether this installation sells the plan by the year. */
|
|
3828
|
+
soldYearly: boolean;
|
|
3829
|
+
}>;
|
|
3830
|
+
/** Whether a payment provider is connected. Without one no plan can be bought. */
|
|
3831
|
+
connected: boolean;
|
|
3832
|
+
/** How the current plan is paid: by the `month` or by the `year`. `null` when nobody pays for it. */
|
|
3833
|
+
interval: "month" | "year" | null;
|
|
3834
|
+
};
|
|
3835
|
+
/** Start checkout. Answers with the address of a checkout page for a plan, paid by the month or by the year. The plan changes once it is paid. */
|
|
3836
|
+
checkout: {
|
|
3837
|
+
object: "checkout";
|
|
3838
|
+
/** The address of the page to send the person to. */
|
|
3839
|
+
url: string;
|
|
3840
|
+
};
|
|
3841
|
+
/** Open billing portal. Answers with the address of the page where the card, the plan and past invoices are managed. */
|
|
3842
|
+
portal: {
|
|
3843
|
+
object: "checkout";
|
|
3844
|
+
/** The address of the page to send the person to. */
|
|
3845
|
+
url: string;
|
|
3846
|
+
};
|
|
3847
|
+
/** List invoices. What the workspace has been charged, newest first. */
|
|
3848
|
+
invoices: {
|
|
3849
|
+
object: "list";
|
|
3850
|
+
/** The invoices of the workspace, newest first. */
|
|
3851
|
+
data: Array<{
|
|
3852
|
+
object: "invoice";
|
|
3853
|
+
/** The id of the invoice. */
|
|
3854
|
+
id: string;
|
|
3855
|
+
/** The number printed on the invoice. */
|
|
3856
|
+
number: string;
|
|
3857
|
+
/** When the invoice was issued. */
|
|
3858
|
+
createdAt: string;
|
|
3859
|
+
/** The amount, in cents. */
|
|
3860
|
+
amountCents: number;
|
|
3861
|
+
/** The currency of the amount. */
|
|
3862
|
+
currency: string;
|
|
3863
|
+
/** Whether it has been paid. */
|
|
3864
|
+
paid: boolean;
|
|
3865
|
+
/** What the invoice is for. */
|
|
3866
|
+
product: string;
|
|
3867
|
+
}>;
|
|
3868
|
+
};
|
|
3869
|
+
};
|
|
3870
|
+
contacts: {
|
|
3871
|
+
/** Add contact. Adds one person to the workspace, and to the audiences you name. They are subscribed unless you say otherwise. An address that is already a contact is refused: add that contact to an audience instead. */
|
|
3872
|
+
create: AudiencesJoinOutput;
|
|
3873
|
+
/** List contacts. The people of the workspace, or of one audience, newest first, by address, name and status. */
|
|
3874
|
+
list: {
|
|
3875
|
+
object: "list";
|
|
3876
|
+
/** The items on this page. */
|
|
3877
|
+
data: AudiencesJoinOutput[];
|
|
3878
|
+
/** How many items match in all, on every page together. */
|
|
3879
|
+
total: number;
|
|
3880
|
+
/** Whether more items follow this page. */
|
|
3881
|
+
hasMore: boolean;
|
|
3882
|
+
};
|
|
3883
|
+
/** Retrieve contact. One person, by id or by address, with their properties, the audiences they are in and what they chose for each topic. */
|
|
3884
|
+
get: AudiencesJoinOutput;
|
|
3885
|
+
/** Update contact. Changes the name or the properties of a contact, or subscribes and unsubscribes them. It holds in every audience they are in. */
|
|
3886
|
+
update: AudiencesJoinOutput;
|
|
3887
|
+
/** Delete contact. Removes a person from the workspace and from every audience, for good. */
|
|
3888
|
+
remove: BroadcastsRemoveOutput;
|
|
3889
|
+
};
|
|
3890
|
+
contactProperties: {
|
|
3891
|
+
/** Create contact property. Names a value every contact can hold, with its type and what to use when a contact has none. From then on a value of another type is refused, and a broadcast fills `{{key}}` with the value or the fallback. */
|
|
3892
|
+
create: ContactPropertiesCreateOutput;
|
|
3893
|
+
/** List contact properties. The properties of the workspace, newest first, with their types and fallbacks. */
|
|
3894
|
+
list: {
|
|
3895
|
+
object: "list";
|
|
3896
|
+
/** The items on this page. */
|
|
3897
|
+
data: ContactPropertiesCreateOutput[];
|
|
3898
|
+
/** How many items match in all, on every page together. */
|
|
3899
|
+
total: number;
|
|
3900
|
+
/** Whether more items follow this page. */
|
|
3901
|
+
hasMore: boolean;
|
|
3902
|
+
};
|
|
3903
|
+
/** Retrieve contact property. One property with its type and its fallback. */
|
|
3904
|
+
get: ContactPropertiesCreateOutput;
|
|
3905
|
+
/** Update contact property. Changes the fallback of a property. Its key and its type stay as they are. */
|
|
3906
|
+
update: ContactPropertiesCreateOutput;
|
|
3907
|
+
/** Delete contact property. Deletes a property. The values contacts hold under its key stay on them, with no type and no fallback. */
|
|
3908
|
+
remove: BroadcastsRemoveOutput;
|
|
3909
|
+
};
|
|
3910
|
+
topics: {
|
|
3911
|
+
/** Create topic. Makes a kind of mail readers can say yes or no to, such as product news. A broadcast sent on a topic only reaches the contacts who get that topic. */
|
|
3912
|
+
create: TopicsCreateOutput;
|
|
3913
|
+
/** List topics. The topics of the workspace, newest first. Name a contact to see what that contact gets. */
|
|
3914
|
+
list: {
|
|
3915
|
+
object: "list";
|
|
3916
|
+
/** The items on this page. */
|
|
3917
|
+
data: TopicsCreateOutput[];
|
|
3918
|
+
/** How many items match in all, on every page together. */
|
|
3919
|
+
total: number;
|
|
3920
|
+
/** Whether more items follow this page. */
|
|
3921
|
+
hasMore: boolean;
|
|
3922
|
+
};
|
|
3923
|
+
/** Retrieve topic. One topic with what holds for a contact who never chose. */
|
|
3924
|
+
get: TopicsCreateOutput;
|
|
3925
|
+
/** Update topic. Changes the name, the description or who sees a topic. What holds for a contact who never chose cannot be changed. */
|
|
3926
|
+
update: TopicsCreateOutput;
|
|
3927
|
+
/** Delete topic. Deletes a topic. It is refused while a broadcast that has not been sent uses it, so nobody who opted out gets that mail. */
|
|
3928
|
+
remove: BroadcastsRemoveOutput;
|
|
3929
|
+
};
|
|
3930
|
+
suppressions: {
|
|
3931
|
+
/** Suppress an address. Adds an address to the suppression list, so nothing is sent to it any more. */
|
|
3932
|
+
create: SuppressionsCreateOutput;
|
|
3933
|
+
/** List suppressed addresses. The addresses the workspace does not send to: the ones that bounced, the ones that complained and the ones added by hand. Newest first, a page at a time: pass next as cursor for the following page. */
|
|
3934
|
+
list: {
|
|
3935
|
+
object: "list";
|
|
3936
|
+
/** The entries on this page, newest first. */
|
|
3937
|
+
data: SuppressionsCreateOutput[];
|
|
3938
|
+
/** Whether more entries follow this page. */
|
|
3939
|
+
hasMore: boolean;
|
|
3940
|
+
/** The value to send as `cursor` for the next page, or `null` at the end. */
|
|
3941
|
+
next: string | null;
|
|
3942
|
+
/** Whether sending is connected. Without it the list is empty. */
|
|
3943
|
+
connected: boolean;
|
|
3944
|
+
};
|
|
3945
|
+
/** Remove a suppressed address. Takes an address off the suppression list, so it can be sent to again. One that complained may not be removable. */
|
|
3946
|
+
remove: BroadcastsRemoveOutput;
|
|
3947
|
+
};
|
|
3948
|
+
inbound: {
|
|
3949
|
+
/** List received emails. The mail that arrived at the domains of the workspace, newest first. A test key may not read it. */
|
|
3950
|
+
list: {
|
|
3951
|
+
object: "list";
|
|
3952
|
+
/** The items on this page. */
|
|
3953
|
+
data: Array<{
|
|
3954
|
+
object: "inbound_email";
|
|
3955
|
+
/** The id of the received email. */
|
|
3956
|
+
id: string;
|
|
3957
|
+
/** The address it came from. */
|
|
3958
|
+
from: string;
|
|
3959
|
+
/** The name of the sender, or `null` when the message gave none. */
|
|
3960
|
+
fromName: string | null;
|
|
3961
|
+
/** The address it was sent to, on one of your domains. */
|
|
3962
|
+
to: string;
|
|
3963
|
+
/** The subject line. */
|
|
3964
|
+
subject: string;
|
|
3965
|
+
/** The domain of yours that received it. */
|
|
3966
|
+
domain: string;
|
|
3967
|
+
/** Whether it was judged to be spam. */
|
|
3968
|
+
spam: boolean;
|
|
3969
|
+
/** The size of the whole message in bytes. */
|
|
3970
|
+
size: number;
|
|
3971
|
+
/** How many files were attached. */
|
|
3972
|
+
attachments: number;
|
|
3973
|
+
/** When it arrived. */
|
|
3974
|
+
createdAt: string;
|
|
3975
|
+
}>;
|
|
3976
|
+
/** How many items match in all, on every page together. */
|
|
3977
|
+
total: number;
|
|
3978
|
+
/** Whether more items follow this page. */
|
|
3979
|
+
hasMore: boolean;
|
|
3980
|
+
};
|
|
3981
|
+
/** Retrieve received email. One received email with its text, its HTML and the names of its attachments. A test key may not read it. */
|
|
3982
|
+
get: {
|
|
3983
|
+
object: "inbound_email";
|
|
3984
|
+
/** The id of the received email. */
|
|
3985
|
+
id: string;
|
|
3986
|
+
/** The address it came from. */
|
|
3987
|
+
from: string;
|
|
3988
|
+
/** The name of the sender, or `null` when the message gave none. */
|
|
3989
|
+
fromName: string | null;
|
|
3990
|
+
/** The address it was sent to, on one of your domains. */
|
|
3991
|
+
to: string;
|
|
3992
|
+
/** The subject line. */
|
|
3993
|
+
subject: string;
|
|
3994
|
+
/** The domain of yours that received it. */
|
|
3995
|
+
domain: string;
|
|
3996
|
+
/** Whether it was judged to be spam. */
|
|
3997
|
+
spam: boolean;
|
|
3998
|
+
/** The size of the whole message in bytes. */
|
|
3999
|
+
size: number;
|
|
4000
|
+
/** How many files were attached. */
|
|
4001
|
+
attachments: number;
|
|
4002
|
+
/** When it arrived. */
|
|
4003
|
+
createdAt: string;
|
|
4004
|
+
/** The message as plain text, or `null`. */
|
|
4005
|
+
text: string | null;
|
|
4006
|
+
/** The message as HTML, or `null`. */
|
|
4007
|
+
html: string | null;
|
|
4008
|
+
/** Whether the message was too long to keep whole. */
|
|
4009
|
+
truncated: boolean;
|
|
4010
|
+
/** The `Message-ID` header of the message. */
|
|
4011
|
+
messageId: string;
|
|
4012
|
+
/** The attached files. Their content is not kept. */
|
|
4013
|
+
files: Array<{
|
|
4014
|
+
/** The name of the file. */
|
|
4015
|
+
filename: string;
|
|
4016
|
+
/** The media type of the file. */
|
|
4017
|
+
mimeType: string;
|
|
4018
|
+
/** The size of the file in bytes. */
|
|
4019
|
+
size: number;
|
|
4020
|
+
}>;
|
|
4021
|
+
};
|
|
4022
|
+
};
|
|
4023
|
+
logs: {
|
|
4024
|
+
/** List logs. Every request an API key has made, newest first, by method, outcome and time. */
|
|
4025
|
+
list: {
|
|
4026
|
+
object: "list";
|
|
4027
|
+
/** The items on this page. */
|
|
4028
|
+
data: LogsListOutputData[];
|
|
4029
|
+
/** How many items match in all, on every page together. */
|
|
4030
|
+
total: number;
|
|
4031
|
+
/** Whether more items follow this page. */
|
|
4032
|
+
hasMore: boolean;
|
|
4033
|
+
};
|
|
4034
|
+
/** Retrieve log. One request: what was asked, what was answered and how long it took. */
|
|
4035
|
+
get: LogsListOutputData;
|
|
4036
|
+
};
|
|
4037
|
+
workspace: {
|
|
4038
|
+
/** Retrieve workspace. The workspace this credential acts for: its plan, every limit with what is used, and who is asking. */
|
|
4039
|
+
get: {
|
|
4040
|
+
object: "workspace";
|
|
4041
|
+
/** The id of the workspace. */
|
|
4042
|
+
id: string;
|
|
4043
|
+
/** The name of the workspace. */
|
|
4044
|
+
name: string;
|
|
4045
|
+
/** The name in lowercase letters, digits and dashes. */
|
|
4046
|
+
slug: string;
|
|
4047
|
+
/** The plan the workspace is on. */
|
|
4048
|
+
plan: WorkspaceGetOutputPlan;
|
|
4049
|
+
/** Every limit of the plan, with how much of it is used. */
|
|
4050
|
+
limits: Array<{
|
|
4051
|
+
/** Which limit this is, such as `domains` or `members`. */
|
|
4052
|
+
id: string;
|
|
4053
|
+
/** How much of it is used in the current period. */
|
|
4054
|
+
used: number;
|
|
4055
|
+
/** How much the plan allows. */
|
|
4056
|
+
limit: number;
|
|
4057
|
+
}>;
|
|
4058
|
+
/** Everything that is counted, whether the plan limits it or not. */
|
|
4059
|
+
usage: Array<{
|
|
4060
|
+
/** What is counted, such as `transactional` or `contacts`. */
|
|
4061
|
+
id: string;
|
|
4062
|
+
/** How much of it is used in the current period. */
|
|
4063
|
+
used: number;
|
|
4064
|
+
}>;
|
|
4065
|
+
/** What this month has used beyond the plan. Zero on a plan that stops at its limits. */
|
|
4066
|
+
extra: {
|
|
4067
|
+
/** How many emails went past the limits of the plan this month. */
|
|
4068
|
+
emails: number;
|
|
4069
|
+
/** What they cost so far, in cents of a US dollar. */
|
|
4070
|
+
cents: number;
|
|
4071
|
+
};
|
|
4072
|
+
/** Who is asking. */
|
|
4073
|
+
viewer: WorkspaceGetOutputViewer;
|
|
4074
|
+
/** Where the data is kept: `d1` for the database, `memory` when nothing outlives a restart. */
|
|
4075
|
+
storage: "memory" | "d1";
|
|
4076
|
+
/** What the API is connected to, and whether each part works. */
|
|
4077
|
+
services: WorkspaceGetOutputServices[];
|
|
4078
|
+
/** How the unsubscribe page of the workspace looks. */
|
|
4079
|
+
unsubscribePage: WorkspaceGetOutputUnsubscribePage;
|
|
4080
|
+
/** Where invoices and billing notices are sent. */
|
|
4081
|
+
billingEmail: string;
|
|
4082
|
+
/** The address replies go to when a message names none and its template has none. Empty for none. */
|
|
4083
|
+
replyTo: string;
|
|
4084
|
+
/** Whether a copy is kept of every image of your templates and broadcasts, and outgoing mail links the copy. It only happens while the `images` service is `ok`. */
|
|
4085
|
+
hostImages: boolean;
|
|
4086
|
+
/** When the workspace was made. */
|
|
4087
|
+
createdAt: string;
|
|
4088
|
+
};
|
|
4089
|
+
/** Update workspace. Renames the workspace, sets where invoices go, sets the reply address its messages get by default, switches image hosting on or off, or replaces the page a recipient sees after they unsubscribe. */
|
|
4090
|
+
update: OpenSendOutputs["workspace"]["get"];
|
|
4091
|
+
};
|
|
4092
|
+
members: {
|
|
4093
|
+
/** Invite member. Invites a person to the workspace by email, with the role they will hold. */
|
|
4094
|
+
invite: MembersInviteOutput;
|
|
4095
|
+
/** List members. The people in the workspace and the invitations still waiting for an answer. */
|
|
4096
|
+
list: {
|
|
4097
|
+
object: "list";
|
|
4098
|
+
/** The items on this page. */
|
|
4099
|
+
data: MembersInviteOutput[];
|
|
4100
|
+
/** How many items match in all, on every page together. */
|
|
4101
|
+
total: number;
|
|
4102
|
+
/** Whether more items follow this page. */
|
|
4103
|
+
hasMore: boolean;
|
|
4104
|
+
};
|
|
4105
|
+
/** Update member. Changes the role of a person, or sends an invitation again. */
|
|
4106
|
+
update: MembersInviteOutput;
|
|
4107
|
+
/** Remove member. Removes a person, or withdraws an invitation, from the workspace. */
|
|
4108
|
+
remove: BroadcastsRemoveOutput;
|
|
4109
|
+
};
|
|
4110
|
+
server: {
|
|
4111
|
+
/** Retrieve server settings. The settings of a server a team hosts itself: whether anybody may sign up, and what each workspace on it may use. */
|
|
4112
|
+
get: {
|
|
4113
|
+
object: "server";
|
|
4114
|
+
/** Whether a team hosts this server itself. `false` where the product is hosted for you, and nothing here can be changed there. */
|
|
4115
|
+
selfHosted: boolean;
|
|
4116
|
+
/** Whether the signed-in person asking owns the server. `false` for an API key. */
|
|
4117
|
+
owner: boolean;
|
|
4118
|
+
/** `open` when anybody who reaches the address may make an account, `closed` when people come in by invitation only. */
|
|
4119
|
+
signUps: "open" | "closed";
|
|
4120
|
+
/** What each workspace on the server may use, one entry for every limit that can be set. Empty where the product is hosted for you: a workspace takes its limits from its plan there. */
|
|
4121
|
+
limits: Array<{
|
|
4122
|
+
/** Which limit this is: `transactional`, `marketing`, `contacts`, `domains` or `members`. */
|
|
4123
|
+
id: string;
|
|
4124
|
+
/** How much each workspace may use, or `null` where there is no limit. */
|
|
4125
|
+
limit: number | null;
|
|
4126
|
+
}>;
|
|
4127
|
+
};
|
|
4128
|
+
};
|
|
4129
|
+
account: {
|
|
4130
|
+
/** Retrieve account. Who is asking and every workspace they can open. For a person it also joins any workspace they were invited to. */
|
|
4131
|
+
get: {
|
|
4132
|
+
object: "account";
|
|
4133
|
+
/** How the request was signed: `session` for a signed-in person, `key` for an API key. */
|
|
4134
|
+
kind: "session" | "key" | "demo";
|
|
4135
|
+
/** The signed-in person, or `null` when an API key is asking. */
|
|
4136
|
+
user: {
|
|
4137
|
+
/** The id of the person. */
|
|
4138
|
+
id: string;
|
|
4139
|
+
/** The name of the person. */
|
|
4140
|
+
name: string;
|
|
4141
|
+
/** The address of the person. */
|
|
4142
|
+
email: string;
|
|
4143
|
+
/** The address of their picture, or `null`. */
|
|
4144
|
+
image: string | null;
|
|
4145
|
+
} | null;
|
|
4146
|
+
/** The workspaces this credential can act in. */
|
|
4147
|
+
workspaces: Array<{
|
|
4148
|
+
/** The id of the workspace. */
|
|
4149
|
+
id: string;
|
|
4150
|
+
/** The name of the workspace. */
|
|
4151
|
+
name: string;
|
|
4152
|
+
/** The role of the person there, or `null` for an API key. */
|
|
4153
|
+
role: "owner" | "admin" | "member" | "viewer" | null;
|
|
4154
|
+
/** Whether this is the workspace the request acts in. */
|
|
4155
|
+
current: boolean;
|
|
4156
|
+
}>;
|
|
4157
|
+
};
|
|
4158
|
+
};
|
|
4159
|
+
methods: {
|
|
4160
|
+
/** List methods. Everything this API can do: each method with its route, its tool name, the scope it needs and a sample input. */
|
|
4161
|
+
list: {
|
|
4162
|
+
object: "list";
|
|
4163
|
+
/** The items on this page. */
|
|
4164
|
+
data: Array<{
|
|
4165
|
+
object: "method";
|
|
4166
|
+
/** The name of the method, such as `emails.send`. */
|
|
4167
|
+
name: string;
|
|
4168
|
+
/** The group the method belongs to. */
|
|
4169
|
+
namespace: "emails" | "broadcasts" | "audiences" | "templates" | "automations" | "metrics" | "domains" | "apiKeys" | "webhooks" | "logs" | "workspace" | "members" | "methods" | "account" | "inbound" | "contacts" | "billing" | "ask" | "suppressions" | "runs" | "events" | "imports" | "topics" | "contactProperties" | "images" | "server";
|
|
4170
|
+
/** What the method does within its group. */
|
|
4171
|
+
call: "send" | "create" | "get" | "list" | "update" | "remove" | "verify" | "publish" | "pause" | "resume" | "invite" | "test" | "deliveries" | "plans" | "checkout" | "portal" | "close" | "invoices" | "batch" | "cancel" | "retry" | "chats" | "chat" | "save" | "forget" | "duplicate" | "enroll" | "versions" | "version" | "starters" | "starter" | "restore" | "inspect" | "render" | "edit" | "join" | "leave" | "add" | "upload";
|
|
4172
|
+
/** `query` for a method that only reads, `mutation` for one that changes something. */
|
|
4173
|
+
kind: "query" | "mutation";
|
|
4174
|
+
/** The method in a few words. */
|
|
4175
|
+
title: string;
|
|
4176
|
+
/** What the method does. */
|
|
4177
|
+
description: string;
|
|
4178
|
+
/** A sentence a person could say to the assistant to have it use this method. */
|
|
4179
|
+
ask: string;
|
|
4180
|
+
/** What it does to your data: `read`, `write`, `send` or `destroy`. */
|
|
4181
|
+
effect: "read" | "write" | "send" | "destroy";
|
|
4182
|
+
/** The permission a key needs to call it. */
|
|
4183
|
+
scope: "emails:send" | "emails:read" | "broadcasts:read" | "broadcasts:write" | "audiences:read" | "audiences:write" | "templates:read" | "templates:write" | "automations:read" | "automations:write" | "metrics:read" | "domains:read" | "domains:write" | "api_keys:read" | "api_keys:write" | "webhooks:read" | "webhooks:write" | "logs:read" | "workspace:read" | "workspace:write" | "methods:read" | "account:read" | "suppressions:read" | "suppressions:write" | "events:read" | "events:write" | "imports:read" | "imports:write" | "images:read" | "images:write";
|
|
4184
|
+
/** How to call it over HTTP. */
|
|
4185
|
+
http: {
|
|
4186
|
+
/** The HTTP verb. */
|
|
4187
|
+
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
4188
|
+
/** The path, with `{id}` where an id goes. */
|
|
4189
|
+
path: string;
|
|
4190
|
+
};
|
|
4191
|
+
/** The name of the same method as an MCP tool, or null for the few that are not tools. */
|
|
4192
|
+
tool: string | null;
|
|
4193
|
+
/** An input that works, to start from. */
|
|
4194
|
+
sample: {
|
|
4195
|
+
[key: string]: unknown;
|
|
4196
|
+
};
|
|
4197
|
+
}>;
|
|
4198
|
+
/** How many items match in all, on every page together. */
|
|
4199
|
+
total: number;
|
|
4200
|
+
/** Whether more items follow this page. */
|
|
4201
|
+
hasMore: boolean;
|
|
4202
|
+
};
|
|
4203
|
+
};
|
|
4204
|
+
ask: {
|
|
4205
|
+
/** Ask the assistant. Answers a question about the workspace by looking it up with the methods of this API. A change is never carried out by asking: the answer holds the change it proposes, and sending that back as run carries it out. */
|
|
4206
|
+
send: {
|
|
4207
|
+
object: "ask_answer";
|
|
4208
|
+
/** The answer, as plain text. */
|
|
4209
|
+
text: string;
|
|
4210
|
+
/** The methods that were run to find the answer. */
|
|
4211
|
+
steps: Array<{
|
|
4212
|
+
/** The method that was run. */
|
|
4213
|
+
call: string;
|
|
4214
|
+
/** The method in a few words. */
|
|
4215
|
+
title: string;
|
|
4216
|
+
/** Whether it worked. */
|
|
4217
|
+
ok: boolean;
|
|
4218
|
+
}>;
|
|
4219
|
+
/** A change the assistant wants to make and is waiting for a yes on, or `null`. */
|
|
4220
|
+
proposal: {
|
|
4221
|
+
/** The method the assistant wants to run. */
|
|
4222
|
+
call: string;
|
|
4223
|
+
/** The method in a few words. */
|
|
4224
|
+
title: string;
|
|
4225
|
+
/** What running it would do. */
|
|
4226
|
+
description: string;
|
|
4227
|
+
/** What it does to your data: `write`, `send` or `destroy`. */
|
|
4228
|
+
effect: "read" | "write" | "send" | "destroy";
|
|
4229
|
+
/** The input it would be run with. */
|
|
4230
|
+
input: {
|
|
4231
|
+
[key: string]: unknown;
|
|
4232
|
+
};
|
|
4233
|
+
} | null;
|
|
4234
|
+
/** What a confirmed change returned, or `null`. */
|
|
4235
|
+
result: {
|
|
4236
|
+
[key: string]: unknown;
|
|
4237
|
+
} | null;
|
|
4238
|
+
};
|
|
4239
|
+
};
|
|
4240
|
+
}
|
|
4241
|
+
type OpenSendFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
4242
|
+
type OpenSendOptionsOf<Input> = "idempotencyKey" extends keyof Input ? OpenSendRequestOptions : Omit<OpenSendRequestOptions, "idempotencyKey">;
|
|
4243
|
+
type OpenSendCallOf<Input, Output> = Input extends {
|
|
4244
|
+
id: string;
|
|
4245
|
+
} ? keyof Omit<Input, "id"> extends never ? {
|
|
4246
|
+
(id: string, options?: OpenSendOptionsOf<Input>): Promise<Output>;
|
|
4247
|
+
(input: Input, options?: OpenSendOptionsOf<Input>): Promise<Output>;
|
|
4248
|
+
} : Record<never, never> extends Omit<Input, "id"> ? {
|
|
4249
|
+
(id: string, input?: Omit<Input, "id">, options?: OpenSendOptionsOf<Input>): Promise<Output>;
|
|
4250
|
+
(input: Input, options?: OpenSendOptionsOf<Input>): Promise<Output>;
|
|
4251
|
+
} : {
|
|
4252
|
+
(id: string, input: Omit<Input, "id">, options?: OpenSendOptionsOf<Input>): Promise<Output>;
|
|
4253
|
+
(input: Input, options?: OpenSendOptionsOf<Input>): Promise<Output>;
|
|
4254
|
+
} : Record<never, never> extends Input ? (input?: Input, options?: OpenSendOptionsOf<Input>) => Promise<Output> : (input: Input, options?: OpenSendOptionsOf<Input>) => Promise<Output>;
|
|
4255
|
+
export type OpenSendClient = {
|
|
4256
|
+
[Namespace in keyof OpenSendInputs]: {
|
|
4257
|
+
[Call in keyof OpenSendInputs[Namespace]]: OpenSendCallOf<OpenSendInputs[Namespace][Call], OpenSendOutputs[Namespace][Call & keyof OpenSendOutputs[Namespace]]>;
|
|
4258
|
+
};
|
|
4259
|
+
};
|
|
4260
|
+
type OpenSendConstructor = new (apiKey?: string, options?: OpenSendOptions) => OpenSendClient;
|
|
4261
|
+
export interface OpenSendOptions {
|
|
4262
|
+
baseUrl?: string;
|
|
4263
|
+
fetch?: OpenSendFetch;
|
|
4264
|
+
timeoutMs?: number;
|
|
4265
|
+
}
|
|
4266
|
+
export interface OpenSendRequestOptions {
|
|
4267
|
+
idempotencyKey?: string;
|
|
4268
|
+
signal?: AbortSignal;
|
|
4269
|
+
}
|
|
4270
|
+
interface OpenSendErrorDetail {
|
|
4271
|
+
status: number | null;
|
|
4272
|
+
code: string;
|
|
4273
|
+
type: string | null;
|
|
4274
|
+
requestId: string | null;
|
|
4275
|
+
}
|
|
4276
|
+
export interface OpenSendWebhookCheck {
|
|
4277
|
+
payload: string;
|
|
4278
|
+
signature: string | null | undefined;
|
|
4279
|
+
secret: string;
|
|
4280
|
+
toleranceSeconds?: number;
|
|
4281
|
+
now?: number;
|
|
4282
|
+
}
|
|
4283
|
+
export interface OpenSendWebhookEvent {
|
|
4284
|
+
id: string;
|
|
4285
|
+
type: string;
|
|
4286
|
+
createdAt: string;
|
|
4287
|
+
data: Record<string, unknown>;
|
|
4288
|
+
}
|
|
4289
|
+
export declare const createOpenSend: (apiKey?: string, options?: OpenSendOptions) => OpenSendClient;
|
|
4290
|
+
declare const OpenSend_base: OpenSendConstructor;
|
|
4291
|
+
export declare class OpenSend extends OpenSend_base {
|
|
4292
|
+
}
|
|
4293
|
+
export declare class OpenSendError extends Error {
|
|
4294
|
+
readonly status: number | null;
|
|
4295
|
+
readonly code: string;
|
|
4296
|
+
readonly type: string | null;
|
|
4297
|
+
readonly requestId: string | null;
|
|
4298
|
+
constructor(message: string, detail: OpenSendErrorDetail, options?: ErrorOptions);
|
|
4299
|
+
}
|
|
4300
|
+
export declare const verifyWebhook: (check: OpenSendWebhookCheck) => Promise<OpenSendWebhookEvent>;
|
|
4301
|
+
export declare const OPENSEND_SIGNATURE_HEADER: string;
|
|
4302
|
+
|
|
4303
|
+
export {};
|