kani_laser 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2234 @@
1
+ # frozen_string_literal: true
2
+ # Generated by "rake schema:update". DO NOT EDIT!
3
+
4
+ module KaniLaser
5
+ SCHEMA = {"type"=>"object",
6
+ "properties"=>
7
+ {"personalizations"=>
8
+ {"type"=>"array",
9
+ "description"=>
10
+ "An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled.",
11
+ "uniqueItems"=>false,
12
+ "maxItems"=>1000,
13
+ "items"=>
14
+ {"type"=>"object",
15
+ "properties"=>
16
+ {"to"=>
17
+ {"type"=>"array",
18
+ "description"=>
19
+ "An array of recipients. Each object within this array may contain the name, but must always contain the email, of a recipient.",
20
+ "minItems"=>1,
21
+ "maxItems"=>1000,
22
+ "items"=>{"$ref"=>"#/definitions/email_object"}},
23
+ "cc"=>
24
+ {"type"=>"array",
25
+ "description"=>
26
+ "An array of recipients who will receive a copy of your email. Each object within this array may contain the name, but must always contain the email, of a recipient.",
27
+ "maxItems"=>1000,
28
+ "items"=>{"$ref"=>"#/definitions/email_object"}},
29
+ "bcc"=>
30
+ {"type"=>"array",
31
+ "description"=>
32
+ "An array of recipients who will receive a blind carbon copy of your email. Each object within this array may contain the name, but must always contain the email, of a recipient.",
33
+ "maxItems"=>1000,
34
+ "items"=>{"$ref"=>"#/definitions/email_object"}},
35
+ "subject"=>
36
+ {"type"=>"string",
37
+ "description"=>
38
+ "The subject of your email. Char length requirements, according to the RFC - http://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit#answer-1592310",
39
+ "minLength"=>1},
40
+ "headers"=>
41
+ {"type"=>"object",
42
+ "description"=>
43
+ "A collection of JSON key/value pairs allowing you to specify specific handling instructions for your email. You may not overwrite the following headers: x-sg-id, x-sg-eid, received, dkim-signature, Content-Type, Content-Transfer-Encoding, To, From, Subject, Reply-To, CC, BCC"},
44
+ "substitutions"=>
45
+ {"type"=>"object",
46
+ "description"=>
47
+ "A collection of key/value pairs following the pattern \"substitution_tag\":\"value to substitute\". All are assumed to be strings. These substitutions will apply to the text and html content of the body of your email, in addition to the `subject` and `reply-to` parameters.",
48
+ "maxProperties"=>10000},
49
+ "custom_args"=>
50
+ {"type"=>"object",
51
+ "description"=>
52
+ "Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. May not exceed 10,000 bytes."},
53
+ "send_at"=>
54
+ {"type"=>"integer",
55
+ "description"=>
56
+ "A unix timestamp allowing you to specify when you want your email to be delivered. Scheduling more than 72 hours in advance is forbidden."}},
57
+ "required"=>["to"]}},
58
+ "from"=>{"$ref"=>"#/definitions/email_object"},
59
+ "reply_to"=>{"$ref"=>"#/definitions/email_object"},
60
+ "subject"=>
61
+ {"type"=>"string",
62
+ "description"=>
63
+ "The global, or “message level”, subject of your email. This may be overridden by personalizations[x].subject.",
64
+ "minLength"=>1},
65
+ "content"=>
66
+ {"type"=>"array",
67
+ "description"=>
68
+ "An array in which you may specify the content of your email. You can include multiple mime types of content, but you must specify at least one mime type. To include more than one mime type, simply add another object to the array containing the `type` and `value` parameters.",
69
+ "items"=>
70
+ {"type"=>"object",
71
+ "properties"=>
72
+ {"type"=>
73
+ {"type"=>"string",
74
+ "description"=>
75
+ "The mime type of the content you are including in your email. For example, “text/plain” or “text/html”.",
76
+ "minLength"=>1},
77
+ "value"=>
78
+ {"type"=>"string",
79
+ "description"=>
80
+ "The actual content of the specified mime type that you are including in your email.",
81
+ "minLength"=>1}},
82
+ "required"=>["type", "value"]}},
83
+ "attachments"=>
84
+ {"type"=>"array",
85
+ "description"=>
86
+ "An array of objects in which you can specify any attachments you want to include.",
87
+ "items"=>
88
+ {"type"=>"object",
89
+ "properties"=>
90
+ {"content"=>
91
+ {"type"=>"string",
92
+ "description"=>"The Base64 encoded content of the attachment.",
93
+ "minLength"=>1},
94
+ "type"=>
95
+ {"type"=>"string",
96
+ "description"=>
97
+ "The mime type of the content you are attaching. For example, “text/plain” or “text/html”.",
98
+ "minLength"=>1},
99
+ "filename"=>
100
+ {"type"=>"string", "description"=>"The filename of the attachment."},
101
+ "disposition"=>
102
+ {"type"=>"string",
103
+ "default"=>"attachment",
104
+ "description"=>
105
+ "The content-disposition of the attachment specifying how you would like the attachment to be displayed. For example, “inline” results in the attached file being displayed automatically within the message while “attachment” results in the attached file requiring some action to be taken before it is displayed (e.g. opening or downloading the file).",
106
+ "enum"=>["inline", "attachment"]},
107
+ "content_id"=>
108
+ {"type"=>"string",
109
+ "description"=>
110
+ "The content id for the attachment. This is used when the disposition is set to “inline” and the attachment is an image, allowing the file to be displayed within the body of your email."}},
111
+ "required"=>["content", "filename"]}},
112
+ "template_id"=>
113
+ {"type"=>"string",
114
+ "description"=>
115
+ "The id of a template that you would like to use. If you use a template that contains a subject and content (either text or html), you do not need to specify those at the personalizations nor message level. "},
116
+ "sections"=>
117
+ {"type"=>"object",
118
+ "description"=>
119
+ "An object of key/value pairs that define block sections of code to be used as substitutions."},
120
+ "headers"=>
121
+ {"type"=>"object",
122
+ "description"=>
123
+ "An object containing key/value pairs of header names and the value to substitute for them. You must ensure these are properly encoded if they contain unicode characters. Must not be one of the reserved headers."},
124
+ "categories"=>
125
+ {"type"=>"array",
126
+ "description"=>
127
+ "An array of category names for this message. Each category name may not exceed 255 characters. ",
128
+ "uniqueItems"=>true,
129
+ "maxItems"=>10,
130
+ "items"=>{"type"=>"string", "maxLength"=>255}},
131
+ "custom_args"=>
132
+ {"type"=>"object",
133
+ "description"=>
134
+ "Values that are specific to the entire send that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This parameter is overridden by personalizations[x].custom_args if that parameter has been defined. Total custom args size may not exceed 10,000 bytes."},
135
+ "send_at"=>
136
+ {"type"=>"integer",
137
+ "description"=>
138
+ "A unix timestamp allowing you to specify when you want your email to be delivered. This may be overridden by the personalizations[x].send_at parameter. Scheduling more ta 72 hours in advance is forbidden."},
139
+ "batch_id"=>
140
+ {"type"=>"string",
141
+ "description"=>
142
+ "This ID represents a batch of emails to be sent at the same time. Including a batch_id in your request allows you include this email in that batch, and also enables you to cancel or pause the delivery of that batch. For more information, see https://sendgrid.com/docs/API_Reference/Web_API_v3/cancel_schedule_send.html "},
143
+ "asm"=>
144
+ {"type"=>"object",
145
+ "description"=>
146
+ "An object allowing you to specify how to handle unsubscribes.",
147
+ "properties"=>
148
+ {"group_id"=>
149
+ {"type"=>"integer",
150
+ "description"=>"The unsubscribe group to associate with this email."},
151
+ "groups_to_display"=>
152
+ {"type"=>"array",
153
+ "description"=>
154
+ "An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.",
155
+ "maxItems"=>25,
156
+ "items"=>{"type"=>"integer"}}},
157
+ "required"=>["group_id"]},
158
+ "ip_pool_name"=>
159
+ {"type"=>"string",
160
+ "description"=>"The IP Pool that you would like to send this email from.",
161
+ "minLength"=>2,
162
+ "maxLength"=>64},
163
+ "mail_settings"=>
164
+ {"type"=>"object",
165
+ "description"=>
166
+ "A collection of different mail settings that you can use to specify how you would like this email to be handled.",
167
+ "properties"=>
168
+ {"bcc"=>
169
+ {"type"=>"object",
170
+ "description"=>
171
+ "This allows you to have a blind carbon copy automatically sent to the specified email address for every email that is sent.",
172
+ "properties"=>
173
+ {"enable"=>
174
+ {"type"=>"boolean",
175
+ "description"=>"Indicates if this setting is enabled."},
176
+ "email"=>
177
+ {"type"=>"string",
178
+ "description"=>
179
+ "The email address that you would like to receive the BCC.",
180
+ "format"=>"email"}}},
181
+ "bypass_list_management"=>
182
+ {"type"=>"object",
183
+ "description"=>
184
+ "Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email.",
185
+ "properties"=>
186
+ {"enable"=>
187
+ {"type"=>"boolean",
188
+ "description"=>"Indicates if this setting is enabled."}}},
189
+ "footer"=>
190
+ {"type"=>"object",
191
+ "description"=>
192
+ "The default footer that you would like included on every email.",
193
+ "properties"=>
194
+ {"enable"=>
195
+ {"type"=>"boolean",
196
+ "description"=>"Indicates if this setting is enabled."},
197
+ "text"=>
198
+ {"type"=>"string",
199
+ "description"=>"The plain text content of your footer."},
200
+ "html"=>
201
+ {"type"=>"string",
202
+ "description"=>"The HTML content of your footer."}}},
203
+ "sandbox_mode"=>
204
+ {"type"=>"object",
205
+ "description"=>
206
+ "This allows you to send a test email to ensure that your request body is valid and formatted correctly.",
207
+ "properties"=>
208
+ {"enable"=>
209
+ {"type"=>"boolean",
210
+ "description"=>"Indicates if this setting is enabled."}}},
211
+ "spam_check"=>
212
+ {"type"=>"object",
213
+ "description"=>
214
+ "This allows you to test the content of your email for spam.",
215
+ "properties"=>
216
+ {"enable"=>
217
+ {"type"=>"boolean",
218
+ "description"=>"Indicates if this setting is enabled."},
219
+ "threshold"=>
220
+ {"type"=>"integer",
221
+ "description"=>
222
+ "The threshold used to determine if your content qualifies as spam on a scale from 1 to 10, with 10 being most strict, or most likely to be considered as spam.",
223
+ "minimum"=>1,
224
+ "maximum"=>10},
225
+ "post_to_url"=>
226
+ {"type"=>"string",
227
+ "description"=>
228
+ "An Inbound Parse URL that you would like a copy of your email along with the spam report to be sent to."}}}}},
229
+ "tracking_settings"=>
230
+ {"type"=>"object",
231
+ "description"=>
232
+ "Settings to determine how you would like to track the metrics of how your recipients interact with your email.",
233
+ "properties"=>
234
+ {"click_tracking"=>
235
+ {"type"=>"object",
236
+ "description"=>
237
+ "Allows you to track whether a recipient clicked a link in your email.",
238
+ "properties"=>
239
+ {"enable"=>
240
+ {"type"=>"boolean",
241
+ "description"=>"Indicates if this setting is enabled."},
242
+ "enable_text"=>
243
+ {"type"=>"boolean",
244
+ "description"=>
245
+ "Indicates if this setting should be included in the text/plain portion of your email."}}},
246
+ "open_tracking"=>
247
+ {"type"=>"object",
248
+ "description"=>
249
+ "Allows you to track whether the email was opened or not, but including a single pixel image in the body of the content. When the pixel is loaded, we can log that the email was opened.",
250
+ "properties"=>
251
+ {"enable"=>
252
+ {"type"=>"boolean",
253
+ "description"=>"Indicates if this setting is enabled."},
254
+ "substitution_tag"=>
255
+ {"type"=>"string",
256
+ "description"=>
257
+ "Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel."}}},
258
+ "subscription_tracking"=>
259
+ {"type"=>"object",
260
+ "description"=>
261
+ "Allows you to insert a subscription management link at the bottom of the text and html bodies of your email. If you would like to specify the location of the link within your email, you may use the substitution_tag.",
262
+ "properties"=>
263
+ {"enable"=>
264
+ {"type"=>"boolean",
265
+ "description"=>"Indicates if this setting is enabled."},
266
+ "text"=>
267
+ {"type"=>"string",
268
+ "description"=>
269
+ "Text to be appended to the email, with the subscription tracking link. You may control where the link is by using the tag <% %>"},
270
+ "html"=>
271
+ {"type"=>"string",
272
+ "description"=>
273
+ "HTML to be appended to the email, with the subscription tracking link. You may control where the link is by using the tag <% %>"},
274
+ "substitution_tag"=>
275
+ {"type"=>"string",
276
+ "description"=>
277
+ "A tag that will be replaced with the unsubscribe URL. for example: [unsubscribe_url]. If this parameter is used, it will override both the `text` and `html` parameters. The URL of the link will be placed at the substitution tag’s location, with no additional formatting."}}},
278
+ "ganalytics"=>
279
+ {"type"=>"object",
280
+ "description"=>
281
+ "Allows you to enable tracking provided by Google Analytics.",
282
+ "properties"=>
283
+ {"enable"=>
284
+ {"type"=>"boolean",
285
+ "description"=>"Indicates if this setting is enabled."},
286
+ "utm_source"=>
287
+ {"type"=>"string",
288
+ "description"=>
289
+ "Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)"},
290
+ "utm_medium"=>
291
+ {"type"=>"string",
292
+ "description"=>"Name of the marketing medium. (e.g. Email)"},
293
+ "utm_term"=>
294
+ {"type"=>"string",
295
+ "description"=>"Used to identify any paid keywords.\t"},
296
+ "utm_content"=>
297
+ {"type"=>"string",
298
+ "description"=>
299
+ "Used to differentiate your campaign from advertisements.\t"},
300
+ "utm_campaign"=>
301
+ {"type"=>"string",
302
+ "description"=>"The name of the campaign.\t"}}}}}},
303
+ "required"=>["personalizations", "from"],
304
+ "example"=>
305
+ {"personalizations"=>
306
+ [{"to"=>[{"email"=>"john.doe@example.com", "name"=>"John Doe"}],
307
+ "subject"=>"Hello, World!"}],
308
+ "from"=>{"email"=>"sam.smith@example.com", "name"=>"Sam Smith"},
309
+ "reply_to"=>{"email"=>"sam.smith@example.com", "name"=>"Sam Smith"},
310
+ "subject"=>"Hello, World!",
311
+ "content"=>
312
+ [{"type"=>"text/html", "value"=>"<html><p>Hello, world!</p></html>"}]},
313
+ "definitions"=>
314
+ {"mail_settings_spam_check"=>
315
+ {"title"=>"Mail Settings: Spam Check",
316
+ "type"=>"object",
317
+ "properties"=>
318
+ {"enabled"=>
319
+ {"type"=>"boolean",
320
+ "description"=>
321
+ "Indicates if your Spam Checker mail setting is enabled."},
322
+ "max_score"=>
323
+ {"type"=>"integer",
324
+ "default"=>5,
325
+ "description"=>
326
+ "The spam threshold. Can range from 1 to 10. The lower the number, the more strict the filtering.",
327
+ "minimum"=>1,
328
+ "maximum"=>10},
329
+ "url"=>
330
+ {"type"=>"string",
331
+ "description"=>
332
+ "The inbound parse URL where you would like the spam messages to be sent to."}},
333
+ "required"=>["enabled"],
334
+ "example"=>
335
+ {"enabled"=>false, "max_score"=>6, "url"=>"http://example.com"}},
336
+ "suppression_group_unsubscribes"=>
337
+ {"title"=>"Suppressions: Suppression Group with Unsubscribes",
338
+ "allOf"=>
339
+ [{"$ref"=>"#/definitions/suppression_group"},
340
+ {"properties"=>
341
+ {"unsubscribes"=>
342
+ {"type"=>"integer",
343
+ "description"=>"The unsubscribes associated with this group."}},
344
+ "required"=>["unsubscribes"]}],
345
+ "type"=>"object"},
346
+ "partner_settings_new_relic"=>
347
+ {"title"=>"Partner Settings: New Relic",
348
+ "type"=>"object",
349
+ "properties"=>
350
+ {"enable_subuser_statistics"=>
351
+ {"type"=>"boolean",
352
+ "description"=>
353
+ "Indicates if your subuser statistics will be sent to your New Relic Dashboard."},
354
+ "enabled"=>
355
+ {"type"=>"boolean",
356
+ "description"=>"Indicates if this setting is enabled. "},
357
+ "license_key"=>
358
+ {"type"=>"string",
359
+ "description"=>
360
+ "The license key provided with your New Relic account."}},
361
+ "required"=>["enabled", "license_key"]},
362
+ "subscription_tracking_settings"=>
363
+ {"title"=>"Settings: Subscription Tracking",
364
+ "type"=>"object",
365
+ "properties"=>
366
+ {"enabled"=>
367
+ {"type"=>"boolean",
368
+ "description"=>"Indicates if subscription tracking is enabled."},
369
+ "html_content"=>
370
+ {"type"=>"string",
371
+ "description"=>
372
+ "The information and HTML for your unsubscribe link. "},
373
+ "landing"=>
374
+ {"type"=>"string",
375
+ "description"=>
376
+ "The HTML that will be displayed on the page that your customers will see after clicking unsubscribe, hosted on SendGrid’s server."},
377
+ "plain_content"=>
378
+ {"type"=>"string",
379
+ "description"=>
380
+ "The information in plain text for your unsubscribe link. You should have the “<% %>” tag in your content, otherwise the user will have no URL for unsubscribing."},
381
+ "replace"=>
382
+ {"type"=>"string",
383
+ "description"=>
384
+ "Your custom defined replacement tag for your templates. Use this tag to place your unsubscribe content anywhere in your emailtemplate."},
385
+ "url"=>
386
+ {"type"=>"string",
387
+ "description"=>
388
+ "The URL where you would like your users sent to unsubscribe."}}},
389
+ "campaign_response"=>
390
+ {"title"=>"Campaigns Response",
391
+ "allOf"=>
392
+ [{"$ref"=>"#/definitions/campaign_request"},
393
+ {"type"=>"object",
394
+ "properties"=>
395
+ {"status"=>
396
+ {"type"=>"string", "description"=>"The status of your campaign."},
397
+ "id"=>{"type"=>"integer"}},
398
+ "required"=>["status"]}]},
399
+ "contactdb_recipient_response"=>
400
+ {"title"=>"ContactDB: Recipient response",
401
+ "type"=>"object",
402
+ "properties"=>
403
+ {"error_count"=>
404
+ {"type"=>"number",
405
+ "default"=>0,
406
+ "description"=>"The number of errors found while adding recipients."},
407
+ "error_indices"=>
408
+ {"type"=>"array",
409
+ "default"=>[],
410
+ "description"=>
411
+ "The indices of the recipient(s) sent that caused the error. ",
412
+ "items"=>{"type"=>"number"}},
413
+ "new_count"=>
414
+ {"type"=>"number",
415
+ "default"=>0,
416
+ "description"=>"The count of new recipients added to the contactdb."},
417
+ "persisted_recipients"=>
418
+ {"type"=>"array",
419
+ "default"=>[],
420
+ "description"=>
421
+ "The recipient IDs of the recipients that already existed from this request.",
422
+ "items"=>{"type"=>"string"}},
423
+ "updated_count"=>
424
+ {"type"=>"number",
425
+ "default"=>0,
426
+ "description"=>"The recipients who were updated from this request."},
427
+ "errors"=>
428
+ {"type"=>"array",
429
+ "items"=>
430
+ {"type"=>"object",
431
+ "properties"=>
432
+ {"message"=>{"type"=>"string"},
433
+ "error_indices"=>
434
+ {"type"=>"array", "items"=>{"type"=>"number"}}}}}},
435
+ "required"=>
436
+ ["error_count", "new_count", "persisted_recipients", "updated_count"],
437
+ "example"=>
438
+ {"error_count"=>1,
439
+ "error_indices"=>[2],
440
+ "new_count"=>2,
441
+ "persisted_recipients"=>["YUBh", "bWlsbGVyQG1pbGxlci50ZXN0"],
442
+ "updated_count"=>0,
443
+ "errors"=>[{"message"=>"Invalid email.", "error_indices"=>[2]}]}},
444
+ "stats"=>
445
+ {"title"=>"Stats",
446
+ "type"=>"array",
447
+ "items"=>
448
+ {"type"=>"object",
449
+ "properties"=>
450
+ {"date"=>
451
+ {"type"=>"string",
452
+ "description"=>"The date that the statistics were gathered."},
453
+ "stats"=>
454
+ {"type"=>"array",
455
+ "description"=>"The list of statistics.",
456
+ "items"=>
457
+ {"type"=>"object",
458
+ "properties"=>
459
+ {"type"=>
460
+ {"type"=>"string", "description"=>"The type of segmentation."},
461
+ "name"=>
462
+ {"type"=>"string",
463
+ "description"=>"The name of the specific segmentation."},
464
+ "metrics"=>
465
+ {"type"=>"object",
466
+ "description"=>"The individual events and their statistics.",
467
+ "properties"=>
468
+ {"blocks"=>
469
+ {"type"=>"integer",
470
+ "description"=>
471
+ "The number of emails that were not allowed to be delivered by ISPs."},
472
+ "bounce_drops"=>
473
+ {"type"=>"integer",
474
+ "description"=>
475
+ "The number of emails that were dropped because of a bounce."},
476
+ "bounces"=>
477
+ {"type"=>"integer",
478
+ "description"=>
479
+ "The number of emails that bounced instead of being delivered."},
480
+ "clicks"=>
481
+ {"type"=>"integer",
482
+ "description"=>
483
+ "The number of links that were clicked in your emails."},
484
+ "deferred"=>
485
+ {"type"=>"integer",
486
+ "description"=>
487
+ "The number of emails that temporarily could not be delivered. "},
488
+ "delivered"=>
489
+ {"type"=>"integer",
490
+ "description"=>
491
+ "The number of emails SendGrid was able to confirm were actually delivered to a recipient."},
492
+ "invalid_emails"=>
493
+ {"type"=>"integer",
494
+ "description"=>
495
+ "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid."},
496
+ "opens"=>
497
+ {"type"=>"integer",
498
+ "description"=>
499
+ "The total number of times your emails were opened by recipients."},
500
+ "processed"=>
501
+ {"type"=>"integer",
502
+ "description"=>
503
+ "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed."},
504
+ "requests"=>
505
+ {"type"=>"integer",
506
+ "description"=>
507
+ "The number of emails that were requested to be delivered."},
508
+ "spam_report_drops"=>
509
+ {"type"=>"integer",
510
+ "description"=>
511
+ "The number of emails that were dropped due to a recipient previously marking your emails as spam."},
512
+ "spam_reports"=>
513
+ {"type"=>"integer",
514
+ "description"=>
515
+ "The number of recipients who marked your email as spam."},
516
+ "unique_clicks"=>
517
+ {"type"=>"integer",
518
+ "description"=>
519
+ "The number of unique recipients who clicked links in your emails."},
520
+ "unique_opens"=>
521
+ {"type"=>"integer",
522
+ "description"=>
523
+ "The number of unique recipients who opened your emails."},
524
+ "unsubscribe_drops"=>
525
+ {"type"=>"integer",
526
+ "description"=>
527
+ "The number of emails dropped due to a recipient unsubscribing from your emails."},
528
+ "unsubscribes"=>
529
+ {"type"=>"integer",
530
+ "description"=>
531
+ "The number of recipients who unsubscribed from your emails."}}}}}}}}},
532
+ "contactdb_segments_conditions"=>
533
+ {"title"=>"ContactDB: Segments: Conditions",
534
+ "type"=>"object",
535
+ "properties"=>
536
+ {"field"=>{"type"=>"string"},
537
+ "value"=>{"type"=>"string"},
538
+ "operator"=>
539
+ {"type"=>"string", "enum"=>["eq", "ne", "lt", "gt", "contains"]},
540
+ "and_or"=>{"type"=>"string", "enum"=>["and", "or", ""]}},
541
+ "required"=>["field", "value", "operator"]},
542
+ "suppression_bounce"=>
543
+ {"title"=>"Suppression: Bounce",
544
+ "type"=>"object",
545
+ "properties"=>
546
+ {"created"=>
547
+ {"type"=>"number",
548
+ "description"=>
549
+ "The unix timestamp for when the bounce record was created at SendGrid."},
550
+ "email"=>{"type"=>"string"},
551
+ "reason"=>
552
+ {"type"=>"string",
553
+ "description"=>
554
+ "The reason for the bounce. This typically will be a bounce code, an enhanced code, and a description."},
555
+ "status"=>
556
+ {"type"=>"string", "description"=>"Enhanced SMTP bounce response"}},
557
+ "example"=>
558
+ {"created"=>1250337600,
559
+ "email"=>"example@example.com",
560
+ "reason"=>
561
+ "550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596 o186si2389584ioe.63 - gsmtp ",
562
+ "status"=>"5.1.1"}},
563
+ "ip_whitelabel"=>
564
+ {"title"=>"Whitelabel - IPs",
565
+ "type"=>"object",
566
+ "properties"=>
567
+ {"id"=>
568
+ {"type"=>"integer", "description"=>"The id of the IP whitelabel."},
569
+ "ip"=>
570
+ {"type"=>"string",
571
+ "description"=>
572
+ "The IP address that this whitelabel was created for."},
573
+ "rdns"=>
574
+ {"type"=>"string",
575
+ "description"=>
576
+ "The reverse DNS record for the IP address. This points to the IP whitelabel subdomain."},
577
+ "users"=>
578
+ {"type"=>"array",
579
+ "description"=>"The users who are able to send mail from the IP.",
580
+ "items"=>
581
+ {"type"=>"object",
582
+ "properties"=>
583
+ {"username"=>
584
+ {"type"=>"string",
585
+ "description"=>
586
+ "The username of the user who can send mail from this IP."},
587
+ "user_id"=>
588
+ {"type"=>"integer",
589
+ "description"=>
590
+ "The ID of the user who can send mail from this IP."}},
591
+ "required"=>["username", "user_id"]}},
592
+ "subdomain"=>
593
+ {"type"=>"string",
594
+ "description"=>
595
+ "The subdomain created for this IP whitelabel. This is where the rDNS record points."},
596
+ "domain"=>
597
+ {"type"=>"string", "description"=>"The root, or sending, domain."},
598
+ "valid"=>
599
+ {"type"=>"boolean",
600
+ "description"=>"Indicates if this is a valid whitelabel."},
601
+ "legacy"=>
602
+ {"type"=>"boolean",
603
+ "description"=>
604
+ "Indicates if this whitelabel was created using the legacy whitelabel tool."},
605
+ "a_record"=>
606
+ {"type"=>"object",
607
+ "required"=>["valid", "type", "host", "data"],
608
+ "properties"=>
609
+ {"valid"=>
610
+ {"type"=>"boolean",
611
+ "description"=>"Indicates if the a_record is valid."},
612
+ "type"=>
613
+ {"type"=>"string", "description"=>"The type of DNS record."},
614
+ "host"=>
615
+ {"type"=>"string",
616
+ "description"=>
617
+ "This is the web address that will be mapped to the IP address."},
618
+ "data"=>
619
+ {"type"=>"string",
620
+ "description"=>"The IP address being whitelabeled."}}}},
621
+ "required"=>
622
+ ["id",
623
+ "ip",
624
+ "rdns",
625
+ "users",
626
+ "subdomain",
627
+ "domain",
628
+ "valid",
629
+ "legacy",
630
+ "a_record"],
631
+ "example"=>
632
+ {"id"=>1,
633
+ "ip"=>"192.168.1.1",
634
+ "rdns"=>"o1.email.example.com",
635
+ "users"=>
636
+ [{"username"=>"john@example.com", "user_id"=>7},
637
+ {"username"=>"jane@example.com", "user_id"=>8}],
638
+ "subdomain"=>"email",
639
+ "domain"=>"example.com",
640
+ "valid"=>true,
641
+ "legacy"=>false,
642
+ "a_record"=>
643
+ {"valid"=>true,
644
+ "type"=>"a",
645
+ "host"=>"o1.email.example.com",
646
+ "data"=>"192.168.1.1"}}},
647
+ "contacts"=>
648
+ {"title"=>"Contacts",
649
+ "type"=>"object",
650
+ "properties"=>
651
+ {"address"=>{"type"=>"string"},
652
+ "address2"=>{"type"=>"object"},
653
+ "city"=>{"type"=>"string"},
654
+ "company"=>{"type"=>"string"},
655
+ "country"=>{"type"=>"string"},
656
+ "email"=>{"type"=>"string"},
657
+ "first_name"=>{"type"=>"string"},
658
+ "last_name"=>{"type"=>"string"},
659
+ "phone"=>{"type"=>"string"},
660
+ "state"=>{"type"=>"string"},
661
+ "zip"=>{"type"=>"string"}}},
662
+ "senderID"=>
663
+ {"title"=>"Sender ID",
664
+ "type"=>"object",
665
+ "properties"=>
666
+ {"id"=>
667
+ {"type"=>"integer",
668
+ "description"=>"The unique identifier of the sender identity."},
669
+ "nickname"=>
670
+ {"type"=>"string",
671
+ "description"=>
672
+ "A nickname for the sender identity. Not used for sending."},
673
+ "from"=>
674
+ {"type"=>"object",
675
+ "properties"=>
676
+ {"email"=>
677
+ {"type"=>"string",
678
+ "description"=>
679
+ "This is where the email will appear to originate from for your recipient"},
680
+ "name"=>
681
+ {"type"=>"string",
682
+ "description"=>
683
+ "This is the name appended to the from email field. IE - Your name or company name."}},
684
+ "required"=>["email"]},
685
+ "reply_to"=>
686
+ {"type"=>"object",
687
+ "properties"=>
688
+ {"email"=>
689
+ {"type"=>"string",
690
+ "description"=>
691
+ "This is the email that your recipient will reply to."},
692
+ "name"=>
693
+ {"type"=>"string",
694
+ "description"=>
695
+ "This is the name appended to the reply to email field. IE - Your name or company name."}}},
696
+ "address"=>
697
+ {"type"=>"string",
698
+ "description"=>"The physical address of the sender identity."},
699
+ "address_2"=>
700
+ {"type"=>"string",
701
+ "description"=>"Additional sender identity address information."},
702
+ "city"=>
703
+ {"type"=>"string", "description"=>"The city of the sender identity."},
704
+ "state"=>
705
+ {"type"=>"string", "description"=>"The state of the sender identity."},
706
+ "zip"=>
707
+ {"type"=>"string",
708
+ "description"=>"The zipcode of the sender identity."},
709
+ "country"=>
710
+ {"type"=>"string",
711
+ "description"=>"The country of the sender identity."},
712
+ "verified"=>
713
+ {"type"=>"boolean",
714
+ "description"=>
715
+ "If the sender identity is verified or not. Only verified sender identities can be used to send email."},
716
+ "updated_at"=>
717
+ {"type"=>"integer",
718
+ "description"=>"The time the sender identity was last updated."},
719
+ "created_at"=>
720
+ {"type"=>"integer",
721
+ "description"=>"The time the sender identity was created."},
722
+ "locked"=>
723
+ {"type"=>"boolean",
724
+ "description"=>
725
+ "A sender identity is locked when it is associated to a campaign in the Draft, Scheduled, or In Progress status. You cannot update or delete a locked sender identity."}},
726
+ "required"=>["nickname", "address", "city", "country"],
727
+ "example"=>
728
+ {"id"=>1,
729
+ "nickname"=>"My Sender ID",
730
+ "from"=>{"email"=>"from@example.com", "name"=>"Example INC"},
731
+ "reply_to"=>{"email"=>"replyto@example.com", "name"=>"Example INC"},
732
+ "address"=>"123 Elm St.",
733
+ "address_2"=>"Apt. 456",
734
+ "city"=>"Denver",
735
+ "state"=>"Colorado",
736
+ "zip"=>"80202",
737
+ "country"=>"United States",
738
+ "verified"=>true,
739
+ "updated_at"=>1449872165,
740
+ "created_at"=>1449872165,
741
+ "locked"=>false}},
742
+ "global:empty_request"=>
743
+ {"title"=>"Global: Request Empty Body", "type"=>"null"},
744
+ "contactdb_custom_field"=>
745
+ {"title"=>"ContactDB Custom field schema.",
746
+ "type"=>"object",
747
+ "properties"=>
748
+ {"name"=>{"type"=>"string", "description"=>"The name of the field"},
749
+ "type"=>
750
+ {"type"=>"string",
751
+ "description"=>"The type of the field.",
752
+ "enum"=>["date", "text", "number"]}},
753
+ "example"=>{"name"=>"first_name", "type"=>"text"}},
754
+ "whitelabel:domain_spf"=>
755
+ {"title"=>"Whitelabel - Domain",
756
+ "type"=>"object",
757
+ "properties"=>
758
+ {"id"=>
759
+ {"type"=>"integer", "description"=>"The ID of the domain whitelabel."},
760
+ "domain"=>
761
+ {"type"=>"string",
762
+ "description"=>"The domain that this whitelabel was created for."},
763
+ "subdomain"=>
764
+ {"type"=>"string",
765
+ "description"=>
766
+ "The subdomain that was used to create this whitelabel."},
767
+ "username"=>
768
+ {"type"=>"string",
769
+ "description"=>
770
+ "The username of the account that this whitelabel is associated with."},
771
+ "user_id"=>
772
+ {"type"=>"integer",
773
+ "description"=>
774
+ "The user_id of the account that this whitelabel is associated with."},
775
+ "ips"=>
776
+ {"type"=>"array",
777
+ "description"=>
778
+ "The IP addresses that are included in the SPF record for this whitelabel.",
779
+ "items"=>{}},
780
+ "custom_spf"=>
781
+ {"type"=>"boolean",
782
+ "description"=>"Indicates if this whitelabel uses custom SPF."},
783
+ "default"=>
784
+ {"type"=>"boolean",
785
+ "description"=>"Indicates if this is the default whitelabel."},
786
+ "legacy"=>
787
+ {"type"=>"boolean",
788
+ "description"=>
789
+ "Indicates if this whitelabel was created using the legacy whitelabel tool."},
790
+ "automatic_security"=>
791
+ {"type"=>"boolean",
792
+ "description"=>
793
+ "Indicates if this whitelabel uses automated security."},
794
+ "valid"=>
795
+ {"type"=>"boolean",
796
+ "description"=>"Indicates if this is a valid whitelabel."},
797
+ "dns"=>
798
+ {"type"=>"object",
799
+ "description"=>"The DNS records for this whitelabel.",
800
+ "required"=>["mail_server", "subdomain_spf", "domain_spf", "dkim"],
801
+ "properties"=>
802
+ {"mail_server"=>
803
+ {"type"=>"object",
804
+ "description"=>
805
+ "Designates which mail server is responsible for accepting messages from a domain.",
806
+ "required"=>["host", "type", "data", "valid"],
807
+ "properties"=>
808
+ {"host"=>
809
+ {"type"=>"string",
810
+ "description"=>"The domain sending the messages."},
811
+ "type"=>
812
+ {"type"=>"string", "description"=>"They type of DNS record."},
813
+ "data"=>
814
+ {"type"=>"string",
815
+ "description"=>
816
+ "The mail server responsible for accepting messages from the sending domain."},
817
+ "valid"=>
818
+ {"type"=>"boolean",
819
+ "description"=>"Indicates if this is a valid DNS record."}}},
820
+ "subdomain_spf"=>
821
+ {"type"=>"object",
822
+ "description"=>
823
+ "The SPF record for the subdomain used to create this whitelabel.",
824
+ "required"=>["host", "type", "data", "valid"],
825
+ "properties"=>
826
+ {"host"=>
827
+ {"type"=>"string",
828
+ "description"=>
829
+ "The domain that this SPF record will be used to authenticate."},
830
+ "type"=>
831
+ {"type"=>"string",
832
+ "description"=>"The type of data in the SPF record."},
833
+ "data"=>{"type"=>"string", "description"=>"The SPF record."},
834
+ "valid"=>
835
+ {"type"=>"boolean",
836
+ "description"=>"Indicates if this is a valid SPF record."}}},
837
+ "domain_spf"=>
838
+ {"type"=>"object",
839
+ "description"=>"The SPF record for the root domain.",
840
+ "required"=>["host", "type", "data", "valid"],
841
+ "properties"=>
842
+ {"host"=>
843
+ {"type"=>"string",
844
+ "description"=>
845
+ "The root domain that this SPF record will be used to authenticate."},
846
+ "type"=>
847
+ {"type"=>"string",
848
+ "description"=>"The type of data in the SPF record."},
849
+ "data"=>{"type"=>"string", "description"=>"The SPF record."},
850
+ "valid"=>
851
+ {"type"=>"boolean",
852
+ "description"=>"Indicates if the SPF record is valid."}}},
853
+ "dkim"=>
854
+ {"type"=>"object",
855
+ "description"=>
856
+ "The DKIM record for messages sent using this whitelabel.",
857
+ "required"=>["host", "type", "data", "valid"],
858
+ "properties"=>
859
+ {"host"=>
860
+ {"type"=>"string",
861
+ "description"=>"The DNS labels for the DKIM signature."},
862
+ "type"=>
863
+ {"type"=>"string",
864
+ "description"=>"The type of data in the DKIM record."},
865
+ "data"=>{"type"=>"string", "description"=>"The DKIM record."},
866
+ "valid"=>
867
+ {"type"=>"boolean",
868
+ "description"=>"Indicates if the DKIM record is valid."}}}}}},
869
+ "required"=>
870
+ ["id",
871
+ "domain",
872
+ "subdomain",
873
+ "username",
874
+ "user_id",
875
+ "ips",
876
+ "custom_spf",
877
+ "default",
878
+ "legacy",
879
+ "automatic_security",
880
+ "valid",
881
+ "dns"]},
882
+ "subuser"=>
883
+ {"title"=>"List all Subusers for a parent response",
884
+ "type"=>"object",
885
+ "properties"=>
886
+ {"disabled"=>
887
+ {"type"=>"boolean",
888
+ "description"=>"Whether or not the user is enabled or disabled."},
889
+ "id"=>{"type"=>"number", "description"=>"The ID of this subuser."},
890
+ "username"=>
891
+ {"type"=>"string",
892
+ "description"=>"The name by which this subuser will be referred."},
893
+ "email"=>
894
+ {"type"=>"string",
895
+ "description"=>"The email address to contact this subuser.",
896
+ "format"=>"email"}},
897
+ "required"=>["disabled", "id", "username", "email"],
898
+ "example"=>
899
+ {"disabled"=>false,
900
+ "email"=>"example@example.com",
901
+ "id"=>1234,
902
+ "username"=>"example_subuser"}},
903
+ "mail_settings_address_whitelabel"=>
904
+ {"title"=>"Mail Settings: Address Whitelabel",
905
+ "type"=>"object",
906
+ "properties"=>
907
+ {"enabled"=>
908
+ {"type"=>"boolean",
909
+ "description"=>
910
+ "Indicates if you have an email address whitelist enabled. "},
911
+ "list"=>
912
+ {"type"=>"array",
913
+ "description"=>
914
+ "All email address that are currently on the whitelist.",
915
+ "items"=>{"type"=>"string"}}},
916
+ "example"=>
917
+ {"enabled"=>true, "list"=>["email1@example.com", "example.com"]}},
918
+ "link_whitelabel"=>
919
+ {"title"=>"Whitelabel - Links",
920
+ "type"=>"object",
921
+ "properties"=>
922
+ {"id"=>
923
+ {"type"=>"integer", "description"=>"The id of the link whitelabel."},
924
+ "domain"=>
925
+ {"type"=>"string",
926
+ "description"=>"The root domain for this link whitelabel."},
927
+ "subdomain"=>
928
+ {"type"=>"string",
929
+ "description"=>
930
+ "The subdomain used to generate the DNS records for this link whitelabel. This subdomain must be different from the subdomain used for your domain whitelabel."},
931
+ "username"=>
932
+ {"type"=>"string",
933
+ "description"=>
934
+ "The username of the account that this link whitelabel is associated with."},
935
+ "user_id"=>
936
+ {"type"=>"integer",
937
+ "description"=>
938
+ "The id of the user that this whitelabel is associated with."},
939
+ "default"=>
940
+ {"type"=>"boolean",
941
+ "description"=>"Indicates if this is the default link whitelabel.",
942
+ "enum"=>[true, false]},
943
+ "valid"=>
944
+ {"type"=>"boolean",
945
+ "description"=>"Indicates if this link whitelabel is valid.",
946
+ "enum"=>[true, false]},
947
+ "legacy"=>
948
+ {"type"=>"boolean",
949
+ "description"=>
950
+ "Indicates if this link whitelabel was created using the legacy whitelabel tool.",
951
+ "enum"=>[true, false]},
952
+ "dns"=>
953
+ {"type"=>"object",
954
+ "description"=>"The DNS records generated for this link whitelabel.",
955
+ "required"=>["domain_cname"],
956
+ "properties"=>
957
+ {"domain_cname"=>
958
+ {"type"=>"object",
959
+ "description"=>
960
+ "The DNS record generated to point to your link whitelabel subdomain.",
961
+ "required"=>["valid", "type", "host", "data"],
962
+ "properties"=>
963
+ {"valid"=>
964
+ {"type"=>"boolean",
965
+ "description"=>"Indicates if the DNS record is valid.",
966
+ "enum"=>[true, false]},
967
+ "type"=>
968
+ {"type"=>"string",
969
+ "description"=>"The type of DNS record that was generate.",
970
+ "enum"=>["cname", "txt", "mx"]},
971
+ "host"=>
972
+ {"type"=>"string",
973
+ "description"=>
974
+ "The domain that this whitelabel will use when whitelabeling the links in your email."},
975
+ "data"=>
976
+ {"type"=>"string",
977
+ "description"=>"The domain that the DNS record points to."}}},
978
+ "owner_cname"=>
979
+ {"type"=>"object",
980
+ "description"=>
981
+ "The DNS record generated to verify who created the link whitelabel.",
982
+ "properties"=>
983
+ {"valid"=>
984
+ {"type"=>"boolean",
985
+ "description"=>"Indicates if the DNS record is valid.",
986
+ "enum"=>[true, false]},
987
+ "type"=>
988
+ {"type"=>"string",
989
+ "description"=>"The type of DNS record generated.",
990
+ "enum"=>["cname", "txt", "mx"]},
991
+ "host"=>
992
+ {"type"=>"string",
993
+ "description"=>
994
+ "Used to verify the link whitelabel. The subdomain of this domain is the user id of the user who created the link whitelabel."},
995
+ "data"=>
996
+ {"type"=>"string",
997
+ "description"=>"The domain that the DNS record points to."}},
998
+ "required"=>["valid", "host", "data"]}}}},
999
+ "required"=>
1000
+ ["id",
1001
+ "domain",
1002
+ "subdomain",
1003
+ "username",
1004
+ "user_id",
1005
+ "default",
1006
+ "valid",
1007
+ "legacy",
1008
+ "dns"]},
1009
+ "email_object"=>
1010
+ {"title"=>"Email Object",
1011
+ "type"=>"object",
1012
+ "properties"=>
1013
+ {"email"=>{"type"=>"string", "format"=>"email"},
1014
+ "name"=>
1015
+ {"type"=>"string",
1016
+ "description"=>
1017
+ "The name of the person to whom you are sending an email."}},
1018
+ "required"=>["email"]},
1019
+ "api_key_name_id_scopes"=>
1020
+ {"title"=>"API Key Name, ID, and Scopes",
1021
+ "allOf"=>
1022
+ [{"type"=>"object",
1023
+ "properties"=>
1024
+ {"scopes"=>
1025
+ {"type"=>"array",
1026
+ "description"=>"The permissions this API Key has access to.",
1027
+ "items"=>{"type"=>"string"}}}},
1028
+ {"$ref"=>"#/definitions/api_key_name_id"}],
1029
+ "example"=>
1030
+ {"api_key_id"=>"qfTQ6KG0QBiwWdJ0-pCLCA",
1031
+ "name"=>"A New Hope",
1032
+ "scopes"=>["user.profile.read", "user.profile.update"]}},
1033
+ "contactdb_segments"=>
1034
+ {"title"=>"Create a Segment request",
1035
+ "type"=>"object",
1036
+ "properties"=>
1037
+ {"name"=>{"type"=>"string", "description"=>"The name of this segment."},
1038
+ "list_id"=>
1039
+ {"type"=>"integer",
1040
+ "description"=>
1041
+ "The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list."},
1042
+ "conditions"=>
1043
+ {"type"=>"array",
1044
+ "description"=>
1045
+ "The conditions for a recipient to be included in this segment.",
1046
+ "items"=>{"$ref"=>"#/definitions/contactdb_segments_conditions"}},
1047
+ "recipient_count"=>
1048
+ {"type"=>"number",
1049
+ "description"=>
1050
+ "The count of recipients in this list. This is not included on creation of segments."}},
1051
+ "required"=>["name", "conditions"],
1052
+ "example"=>
1053
+ {"name"=>"Last Name Miller",
1054
+ "list_id"=>4,
1055
+ "conditions"=>
1056
+ [{"field"=>"last_name",
1057
+ "value"=>"Miller",
1058
+ "operator"=>"eq",
1059
+ "and_or"=>""},
1060
+ {"field"=>"last_clicked",
1061
+ "value"=>"01/02/2015",
1062
+ "operator"=>"gt",
1063
+ "and_or"=>"and"},
1064
+ {"field"=>"clicks.campaign_identifier",
1065
+ "value"=>"513",
1066
+ "operator"=>"eq",
1067
+ "and_or"=>"or"}],
1068
+ "recipient_count"=>1234}},
1069
+ "api_key_name_id"=>
1070
+ {"title"=>"API Key Name and ID",
1071
+ "type"=>"object",
1072
+ "properties"=>
1073
+ {"api_key_id"=>
1074
+ {"type"=>"string", "description"=>"The ID of your API Key. "},
1075
+ "name"=>{"type"=>"string", "description"=>"The name of your API Key."}},
1076
+ "example"=>
1077
+ {"api_key_id"=>"qfTQ6KG0QBiwWdJ0-pCLCA", "name"=>"A New Hope"}},
1078
+ "advanced_stats_opens"=>
1079
+ {"title"=>"Stats: Advanced Stats with Opens",
1080
+ "type"=>"object",
1081
+ "properties"=>
1082
+ {"date"=>
1083
+ {"type"=>"string",
1084
+ "description"=>"The date that the events occurred."},
1085
+ "stats"=>
1086
+ {"type"=>"array",
1087
+ "description"=>"The statistics of the email events.",
1088
+ "items"=>
1089
+ {"type"=>"object",
1090
+ "properties"=>
1091
+ {"type"=>
1092
+ {"type"=>"string", "description"=>"The type of segmentation."},
1093
+ "name"=>
1094
+ {"type"=>"string",
1095
+ "description"=>"The name of the specific segmentation."},
1096
+ "metrics"=>
1097
+ {"type"=>"object",
1098
+ "description"=>"The individual events and their stats.",
1099
+ "required"=>["opens", "unique_opens"],
1100
+ "properties"=>
1101
+ {"opens"=>
1102
+ {"type"=>"integer",
1103
+ "description"=>
1104
+ "The total number of times your emails were opened by recipients."},
1105
+ "unique_opens"=>
1106
+ {"type"=>"integer",
1107
+ "description"=>
1108
+ "The number of unique recipients who opened your emails."}}}},
1109
+ "required"=>["type", "name", "metrics"]}}},
1110
+ "required"=>["date", "stats"]},
1111
+ "mail_settings_template"=>
1112
+ {"title"=>"Mail Settings: Template",
1113
+ "type"=>"object",
1114
+ "properties"=>
1115
+ {"enabled"=>
1116
+ {"type"=>"boolean",
1117
+ "description"=>
1118
+ "Indicates if the legacy email template setting is enabled."},
1119
+ "html_content"=>
1120
+ {"type"=>"string",
1121
+ "description"=>
1122
+ "The HTML content that you want to use for your legacy email template."}},
1123
+ "example"=>
1124
+ {"enabled"=>false, "html_content"=>"<p><% body %>Example</p>\n"}},
1125
+ "ip_warmup_response"=>
1126
+ {"title"=>"IP Warmup: IP",
1127
+ "type"=>"array",
1128
+ "items"=>
1129
+ {"type"=>"object",
1130
+ "properties"=>
1131
+ {"ip"=>{"type"=>"string", "description"=>"The IP address."},
1132
+ "start_date"=>
1133
+ {"type"=>"integer",
1134
+ "description"=>
1135
+ "A Unix timestamp indicating when the IP address was entered into warmup mode."}},
1136
+ "required"=>["ip", "start_date"]},
1137
+ "example"=>[{"ip"=>"0.0.0.0", "start_date"=>1409616000}]},
1138
+ "advanced_stats_mailbox_provider"=>
1139
+ {"title"=>"Stats: Advanced Stats for Mailbox Provider",
1140
+ "type"=>"object",
1141
+ "properties"=>
1142
+ {"date"=>
1143
+ {"type"=>"string",
1144
+ "description"=>"The date that the events occurred."},
1145
+ "stats"=>
1146
+ {"type"=>"array",
1147
+ "description"=>"The statistics of the email events.",
1148
+ "items"=>
1149
+ {"type"=>"object",
1150
+ "properties"=>
1151
+ {"type"=>
1152
+ {"type"=>"string", "description"=>"The type of segmentation."},
1153
+ "name"=>
1154
+ {"type"=>"string",
1155
+ "description"=>"The name of the specific segmentation."},
1156
+ "metrics"=>
1157
+ {"type"=>"object",
1158
+ "description"=>"The individual events and their stats.",
1159
+ "required"=>
1160
+ ["clicks",
1161
+ "opens",
1162
+ "unique_clicks",
1163
+ "unique_opens",
1164
+ "blocks",
1165
+ "bounces",
1166
+ "deferred",
1167
+ "delivered",
1168
+ "drops",
1169
+ "spam_reports"],
1170
+ "properties"=>
1171
+ {"clicks"=>
1172
+ {"type"=>"integer",
1173
+ "description"=>
1174
+ "The number of links that were clicked in your emails."},
1175
+ "opens"=>
1176
+ {"type"=>"integer",
1177
+ "description"=>
1178
+ "The total number of times your emails were opened by recipients."},
1179
+ "unique_clicks"=>
1180
+ {"type"=>"integer",
1181
+ "description"=>
1182
+ "The number of unique recipients who clicked links in your emails."},
1183
+ "unique_opens"=>
1184
+ {"type"=>"integer",
1185
+ "description"=>
1186
+ "The number of unique recipients who opened your emails."},
1187
+ "blocks"=>
1188
+ {"type"=>"integer",
1189
+ "description"=>
1190
+ "The number of emails that were not allowed to be delivered by ISPs."},
1191
+ "bounces"=>
1192
+ {"type"=>"integer",
1193
+ "description"=>
1194
+ "The number of emails that bounced instead of being delivered."},
1195
+ "deferred"=>
1196
+ {"type"=>"integer",
1197
+ "description"=>
1198
+ "The number of emails that temporarily could not be delivered."},
1199
+ "delivered"=>
1200
+ {"type"=>"integer",
1201
+ "description"=>
1202
+ "The number of emails SendGrid was able to confirm were actually delivered to a recipient."},
1203
+ "drops"=>
1204
+ {"type"=>"integer",
1205
+ "description"=>
1206
+ "The number of emails that were not delivered due to the recipient email address being on a suppression list."},
1207
+ "spam_reports"=>
1208
+ {"type"=>"integer",
1209
+ "description"=>
1210
+ "The number of recipients who marked your email as spam."}}}},
1211
+ "required"=>["type", "name", "metrics"]}}},
1212
+ "required"=>["date", "stats"]},
1213
+ "global:ErrorResponse"=>
1214
+ {"title"=>"Global: Error Response",
1215
+ "type"=>"object",
1216
+ "properties"=>
1217
+ {"errors"=>
1218
+ {"type"=>"array",
1219
+ "items"=>
1220
+ {"type"=>"object",
1221
+ "properties"=>
1222
+ {"field"=>
1223
+ {"type"=>["string", "null"],
1224
+ "description"=>"The field that generated the error."},
1225
+ "message"=>
1226
+ {"type"=>"string", "description"=>"The error message."}},
1227
+ "required"=>["message"]}}},
1228
+ "example"=>
1229
+ {"errors"=>[{"field"=>"field_name", "message"=>"Some message here"}]}},
1230
+ "contactdb_custom_field_with_id"=>
1231
+ {"title"=>"ContactDB Custom field schema with ID.",
1232
+ "allOf"=>
1233
+ [{"$ref"=>"#/definitions/contactdb_custom_field"},
1234
+ {"type"=>"object",
1235
+ "properties"=>
1236
+ {"id"=>
1237
+ {"type"=>"number",
1238
+ "description"=>"The ID of the custom field."}}}]},
1239
+ "monitor"=>
1240
+ {"title"=>"Create monitor settings request",
1241
+ "type"=>"object",
1242
+ "properties"=>
1243
+ {"email"=>
1244
+ {"type"=>"string",
1245
+ "description"=>
1246
+ "The email address to send emails at the frequency specified for monitoring.",
1247
+ "format"=>"email"},
1248
+ "frequency"=>
1249
+ {"type"=>"number",
1250
+ "description"=>
1251
+ "The frequency by which to send the emails. An email will be sent, every time your subuser sends this {frequency} emails. "}},
1252
+ "required"=>["email", "frequency"],
1253
+ "example"=>{"email"=>"example@example.com", "frequency"=>50000}},
1254
+ "errors"=>
1255
+ {"title"=>"Error Schema",
1256
+ "type"=>"object",
1257
+ "properties"=>
1258
+ {"errors"=>
1259
+ {"type"=>"array",
1260
+ "items"=>
1261
+ {"type"=>"object",
1262
+ "properties"=>
1263
+ {"field"=>
1264
+ {"type"=>["null", "string"],
1265
+ "description"=>"The field that has the error."},
1266
+ "message"=>
1267
+ {"type"=>"string",
1268
+ "description"=>"The message the API caller will receive."}}}}}},
1269
+ "ip_pool"=>
1270
+ {"title"=>"IP Pools: Pool",
1271
+ "type"=>"object",
1272
+ "properties"=>
1273
+ {"name"=>
1274
+ {"type"=>"string",
1275
+ "description"=>"The name of the IP pool.",
1276
+ "maxLength"=>64}},
1277
+ "required"=>["name"]},
1278
+ "google_analytics_settings"=>
1279
+ {"title"=>"Settings: Google Analytics",
1280
+ "type"=>"object",
1281
+ "properties"=>
1282
+ {"enabled"=>
1283
+ {"type"=>"boolean",
1284
+ "description"=>"Indicates if Google Analytics is enabled."},
1285
+ "utm_campaign"=>
1286
+ {"type"=>"string", "description"=>"The name of the campaign."},
1287
+ "utm_content"=>
1288
+ {"type"=>"string", "description"=>"Used to differentiate ads"},
1289
+ "utm_medium"=>
1290
+ {"type"=>"string",
1291
+ "description"=>"Name of the marketing medium (e.g. \"Email\")."},
1292
+ "utm_source"=>
1293
+ {"type"=>"string", "description"=>"Name of the referrer source. "},
1294
+ "utm_term"=>{"type"=>"string", "description"=>"Any paid keywords."}},
1295
+ "example"=>
1296
+ {"enabled"=>true,
1297
+ "utm_source"=>"sendgrid.com",
1298
+ "utm_medium"=>"email",
1299
+ "utm_term"=>"",
1300
+ "utm_content"=>"",
1301
+ "utm_campaign"=>"website"}},
1302
+ "event_webhook_settings"=>
1303
+ {"title"=>"Webhooks: Event Webhook Settings",
1304
+ "type"=>"object",
1305
+ "properties"=>
1306
+ {"enabled"=>
1307
+ {"type"=>"boolean",
1308
+ "description"=>"Indicates if the event webhook is enabled."},
1309
+ "url"=>
1310
+ {"type"=>"string",
1311
+ "description"=>"The URL that you want the event webhook to POST to."},
1312
+ "group_resubscribe"=>
1313
+ {"type"=>"boolean",
1314
+ "description"=>
1315
+ "Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event."},
1316
+ "delivered"=>
1317
+ {"type"=>"boolean",
1318
+ "description"=>
1319
+ "Message has been successfully delivered to the receiving server."},
1320
+ "group_unsubscribe"=>
1321
+ {"type"=>"boolean",
1322
+ "description"=>
1323
+ "Recipient unsubscribe from specific group, by either direct link or updating preferences. You need to enable Subscription Tracking for getting this type of event."},
1324
+ "spam_report"=>
1325
+ {"type"=>"boolean",
1326
+ "description"=>"Recipient marked a message as spam."},
1327
+ "bounce"=>
1328
+ {"type"=>"boolean",
1329
+ "description"=>
1330
+ "Receiving server could not or would not accept message."},
1331
+ "deferred"=>
1332
+ {"type"=>"boolean",
1333
+ "description"=>
1334
+ "Recipient's email server temporarily rejected message."},
1335
+ "unsubscribe"=>
1336
+ {"type"=>"boolean",
1337
+ "description"=>
1338
+ "Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event."},
1339
+ "processed"=>
1340
+ {"type"=>"boolean",
1341
+ "description"=>
1342
+ "Message has been received and is ready to be delivered."},
1343
+ "open"=>
1344
+ {"type"=>"boolean",
1345
+ "description"=>
1346
+ "Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event."},
1347
+ "click"=>
1348
+ {"type"=>"boolean",
1349
+ "description"=>
1350
+ "Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event."},
1351
+ "dropped"=>
1352
+ {"type"=>"boolean",
1353
+ "description"=>
1354
+ "You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota"}},
1355
+ "required"=>
1356
+ ["enabled",
1357
+ "url",
1358
+ "group_resubscribe",
1359
+ "delivered",
1360
+ "group_unsubscribe",
1361
+ "spam_report",
1362
+ "bounce",
1363
+ "deferred",
1364
+ "unsubscribe",
1365
+ "processed",
1366
+ "open",
1367
+ "click",
1368
+ "dropped"]},
1369
+ "user_profile"=>
1370
+ {"title"=>"User: Profile",
1371
+ "type"=>"object",
1372
+ "properties"=>
1373
+ {"address"=>
1374
+ {"type"=>"string",
1375
+ "description"=>"The street address for this user profile."},
1376
+ "address2"=>
1377
+ {"type"=>"string",
1378
+ "description"=>
1379
+ "An optional second line for the street address of this user profile."},
1380
+ "city"=>
1381
+ {"type"=>"string", "description"=>"The city for the user profile."},
1382
+ "company"=>
1383
+ {"type"=>"string",
1384
+ "description"=>
1385
+ "That company that this user profile is associated with."},
1386
+ "country"=>
1387
+ {"type"=>"string", "description"=>"Th country of this user profile."},
1388
+ "first_name"=>
1389
+ {"type"=>"string", "description"=>"The first name of the user."},
1390
+ "last_name"=>
1391
+ {"type"=>"string", "description"=>"The last name of the user."},
1392
+ "phone"=>
1393
+ {"type"=>"string", "description"=>"The phone number for the user."},
1394
+ "state"=>{"type"=>"string", "description"=>"The state for this user."},
1395
+ "website"=>
1396
+ {"type"=>"string",
1397
+ "description"=>"The website associated with this user."},
1398
+ "zip"=>
1399
+ {"type"=>"string", "description"=>"The zip code for this user."}},
1400
+ "example"=>
1401
+ {"address"=>"1451 Larimer Street, 3rd floor",
1402
+ "address2"=>"",
1403
+ "city"=>"Denver, CO",
1404
+ "company"=>"SendGrid",
1405
+ "country"=>"US",
1406
+ "first_name"=>"Matthew",
1407
+ "last_name"=>"Bernier",
1408
+ "phone"=>"7208788003",
1409
+ "state"=>"CO",
1410
+ "website"=>"http://sendgrid.com",
1411
+ "zip"=>"80202"}},
1412
+ "mail_settings_footer"=>
1413
+ {"title"=>"Mail Settings: Footer",
1414
+ "type"=>"object",
1415
+ "properties"=>
1416
+ {"enabled"=>
1417
+ {"type"=>"boolean",
1418
+ "description"=>
1419
+ "Indicates if the Footer mail setting is currently enabled."},
1420
+ "html_content"=>
1421
+ {"type"=>"string",
1422
+ "description"=>"The custom HTML content of your email footer."},
1423
+ "plain_content"=>
1424
+ {"type"=>"string",
1425
+ "description"=>"The plain text content of your email footer."}},
1426
+ "example"=>
1427
+ {"enabled"=>true,
1428
+ "html_content"=>"Example HTML content",
1429
+ "plain_content"=>"Example plain content"}},
1430
+ "category_stats"=>
1431
+ {"title"=>"Stats: Category Stats",
1432
+ "type"=>"object",
1433
+ "properties"=>
1434
+ {"date"=>
1435
+ {"type"=>"string",
1436
+ "description"=>"The date the statistics were gathered."},
1437
+ "stats"=>
1438
+ {"type"=>"array",
1439
+ "items"=>
1440
+ {"type"=>"object",
1441
+ "properties"=>
1442
+ {"metrics"=>
1443
+ {"type"=>"object",
1444
+ "properties"=>
1445
+ {"blocks"=>
1446
+ {"type"=>"integer",
1447
+ "description"=>
1448
+ "The number of emails that were not allowed to be delivered by ISPs."},
1449
+ "bounce_drops"=>
1450
+ {"type"=>"integer",
1451
+ "description"=>
1452
+ "The number of emails that were dropped because of a bounce."},
1453
+ "bounces"=>
1454
+ {"type"=>"integer",
1455
+ "description"=>
1456
+ "The number of emails that bounced instead of being delivered."},
1457
+ "clicks"=>
1458
+ {"type"=>"integer",
1459
+ "description"=>"The number of links that were clicked."},
1460
+ "deferred"=>
1461
+ {"type"=>"integer",
1462
+ "description"=>
1463
+ "The number of emails that temporarily could not be delivered."},
1464
+ "delivered"=>
1465
+ {"type"=>"integer",
1466
+ "description"=>
1467
+ "The number of emails SendGrid was able to confirm were actually delivered to a recipient."},
1468
+ "invalid_emails"=>
1469
+ {"type"=>"integer",
1470
+ "description"=>
1471
+ "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid."},
1472
+ "opens"=>
1473
+ {"type"=>"integer",
1474
+ "description"=>
1475
+ "The total number of times your emails were opened by recipients."},
1476
+ "processed"=>
1477
+ {"type"=>"integer",
1478
+ "description"=>
1479
+ "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed."},
1480
+ "requests"=>
1481
+ {"type"=>"integer",
1482
+ "description"=>
1483
+ "The number of emails that were requested to be delivered."},
1484
+ "spam_report_drops"=>
1485
+ {"type"=>"integer",
1486
+ "description"=>
1487
+ "The number of emails that were dropped due to a recipient previously marking your emails as spam."},
1488
+ "spam_reports"=>
1489
+ {"type"=>"integer",
1490
+ "description"=>
1491
+ "The number of recipients who marked your email as spam."},
1492
+ "unique_clicks"=>
1493
+ {"type"=>"integer",
1494
+ "description"=>
1495
+ "The number of unique recipients who clicked links in your emails."},
1496
+ "unique_opens"=>
1497
+ {"type"=>"integer",
1498
+ "description"=>
1499
+ "The number of unique recipients who opened your emails."},
1500
+ "unsubscribe_drops"=>
1501
+ {"type"=>"integer",
1502
+ "description"=>
1503
+ "The number of emails dropped due to a recipient unsubscribing from your emails."},
1504
+ "unsubscribes"=>
1505
+ {"type"=>"integer",
1506
+ "description"=>
1507
+ "The number of recipients who unsubscribed from your emails."}},
1508
+ "required"=>
1509
+ ["blocks",
1510
+ "bounce_drops",
1511
+ "bounces",
1512
+ "clicks",
1513
+ "deferred",
1514
+ "delivered",
1515
+ "invalid_emails",
1516
+ "opens",
1517
+ "processed",
1518
+ "requests",
1519
+ "spam_report_drops",
1520
+ "spam_reports",
1521
+ "unique_clicks",
1522
+ "unique_opens",
1523
+ "unsubscribe_drops",
1524
+ "unsubscribes"]},
1525
+ "name"=>
1526
+ {"type"=>"string", "description"=>"The name of the category."},
1527
+ "type"=>
1528
+ {"type"=>"string",
1529
+ "description"=>"How you are segmenting your statistics."}},
1530
+ "required"=>["type"]}}},
1531
+ "required"=>["date"],
1532
+ "example"=>
1533
+ {"date"=>"2015-01-01",
1534
+ "stats"=>
1535
+ [{"metrics"=>
1536
+ {"blocks"=>0,
1537
+ "bounce_drops"=>0,
1538
+ "bounces"=>0,
1539
+ "clicks"=>0,
1540
+ "deferred"=>0,
1541
+ "delivered"=>0,
1542
+ "invalid_emails"=>0,
1543
+ "opens"=>0,
1544
+ "processed"=>0,
1545
+ "requests"=>0,
1546
+ "spam_report_drops"=>0,
1547
+ "spam_reports"=>0,
1548
+ "unique_clicks"=>0,
1549
+ "unique_opens"=>0,
1550
+ "unsubscribe_drops"=>0,
1551
+ "unsubscribes"=>0},
1552
+ "name"=>"cat1",
1553
+ "type"=>"category"},
1554
+ {"metrics"=>
1555
+ {"blocks"=>0,
1556
+ "bounce_drops"=>0,
1557
+ "bounces"=>0,
1558
+ "clicks"=>0,
1559
+ "deferred"=>0,
1560
+ "delivered"=>0,
1561
+ "invalid_emails"=>0,
1562
+ "opens"=>0,
1563
+ "processed"=>0,
1564
+ "requests"=>0,
1565
+ "spam_report_drops"=>0,
1566
+ "spam_reports"=>0,
1567
+ "unique_clicks"=>0,
1568
+ "unique_opens"=>0,
1569
+ "unsubscribe_drops"=>0,
1570
+ "unsubscribes"=>0},
1571
+ "name"=>"cat2",
1572
+ "type"=>"category"}]}},
1573
+ "transactional_template"=>
1574
+ {"title"=>"Transactional Templates: Template",
1575
+ "type"=>"object",
1576
+ "properties"=>
1577
+ {"id"=>
1578
+ {"type"=>"string",
1579
+ "description"=>"The ID of the transactional template."},
1580
+ "name"=>
1581
+ {"type"=>"string",
1582
+ "description"=>"The name for the transactional template.",
1583
+ "maxLength"=>100},
1584
+ "versions"=>
1585
+ {"type"=>"array",
1586
+ "description"=>
1587
+ "The different versions of this transactional template.",
1588
+ "items"=>{"$ref"=>"#/definitions/transactional_template_version"}}},
1589
+ "required"=>["id", "name"]},
1590
+ "parse-setting"=>
1591
+ {"title"=>"Parse Setting",
1592
+ "type"=>"object",
1593
+ "properties"=>
1594
+ {"url"=>
1595
+ {"type"=>"string",
1596
+ "description"=>
1597
+ "The public URL where you would like SendGrid to POST the data parsed from your email. Any emails sent with the given hostname provided (whose MX records have been updated to point to SendGrid) will be parsed and POSTed to this URL."},
1598
+ "hostname"=>
1599
+ {"type"=>"string",
1600
+ "description"=>
1601
+ "A specific and unique domain or subdomain that you have created to use exclusively to parse your incoming email. For example, parse.yourdomain.com."},
1602
+ "spam_check"=>
1603
+ {"type"=>"boolean",
1604
+ "description"=>
1605
+ "Indicates if you would like SendGrid to check the content parsed from your emails for spam before POSTing them to your domain."},
1606
+ "send_raw"=>
1607
+ {"type"=>"boolean",
1608
+ "description"=>
1609
+ "Indicates if you would like SendGrid to post the original MIME-type content of your parsed email. When this parameter is set to \"false\", SendGrid will send a JSON payload of the content of your email. "}},
1610
+ "example"=>
1611
+ {"url"=>"http://email.myhostname.com",
1612
+ "hostname"=>"myhostname.com",
1613
+ "spam_check"=>false,
1614
+ "send_raw"=>true}},
1615
+ "contactdb_list"=>
1616
+ {"title"=>"ContactDB lists",
1617
+ "type"=>"object",
1618
+ "properties"=>
1619
+ {"id"=>
1620
+ {"type"=>"integer", "description"=>"The reference ID of your list."},
1621
+ "name"=>{"type"=>"string", "description"=>"The name of your list."},
1622
+ "recipient_count"=>
1623
+ {"type"=>"integer",
1624
+ "description"=>"The count of recipients currently in the list."}},
1625
+ "required"=>["id", "name", "recipient_count"],
1626
+ "example"=>{"id"=>1, "name"=>"listname", "recipient_count"=>0}},
1627
+ "suppression_group"=>
1628
+ {"title"=>"Suppressions: Suppression Group",
1629
+ "type"=>"object",
1630
+ "properties"=>
1631
+ {"id"=>
1632
+ {"type"=>"number", "description"=>"The id of the suppression group."},
1633
+ "name"=>
1634
+ {"type"=>"string",
1635
+ "description"=>
1636
+ "The name of the suppression group. Each group created by a user must have a unique name.",
1637
+ "maxLength"=>30},
1638
+ "description"=>
1639
+ {"type"=>"string",
1640
+ "description"=>"A description of the suppression group.",
1641
+ "maxLength"=>100},
1642
+ "last_email_sent_at"=>{"type"=>"null"},
1643
+ "is_default"=>
1644
+ {"type"=>"boolean",
1645
+ "default"=>false,
1646
+ "description"=>
1647
+ "Indicates if this is the default suppression group."}},
1648
+ "required"=>["id", "name", "description"]},
1649
+ "mail_settings_bounce_purge"=>
1650
+ {"title"=>"Mail Settings: Bounce Purge",
1651
+ "type"=>"object",
1652
+ "properties"=>
1653
+ {"enabled"=>
1654
+ {"type"=>"boolean",
1655
+ "description"=>
1656
+ "Indicates if the bounce purge mail setting is enabled."},
1657
+ "soft_bounces"=>
1658
+ {"type"=>["integer", "null"],
1659
+ "description"=>
1660
+ "The number of days, after which SendGrid will purge all contacts from your soft bounces suppression lists."},
1661
+ "hard_bounces"=>
1662
+ {"type"=>["integer", "null"],
1663
+ "description"=>
1664
+ "The number of days, after which SendGrid will purge all contacts from your hard bounces suppression lists."}},
1665
+ "example"=>{"enabled"=>false, "soft_bounces"=>1234, "hard_bounces"=>nil}},
1666
+ "transactional_template_version"=>
1667
+ {"title"=>"Transactional Templates: Version",
1668
+ "type"=>"object",
1669
+ "properties"=>
1670
+ {"template_id"=>
1671
+ {"type"=>"string",
1672
+ "description"=>"The name of the original transactional template."},
1673
+ "active"=>
1674
+ {"type"=>"integer",
1675
+ "description"=>
1676
+ "Set the new version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active.",
1677
+ "enum"=>[0, 1]},
1678
+ "name"=>
1679
+ {"type"=>"string",
1680
+ "description"=>"Name of the new transactional template version."},
1681
+ "html_content"=>
1682
+ {"type"=>"string",
1683
+ "description"=>
1684
+ "The HTML content of the new version. Must include <%body%> tag. Maximum of 1048576 bytes allowed for plain content."},
1685
+ "plain_content"=>
1686
+ {"type"=>"string",
1687
+ "description"=>
1688
+ "Text/plain content of the new transactional template version. Must include <%body%> tag. Maximum of 1048576 bytes allowed for plain content."},
1689
+ "subject"=>
1690
+ {"type"=>"string",
1691
+ "description"=>
1692
+ "Subject of the new transactional template version. Must include <%subject%> tag."}},
1693
+ "required"=>
1694
+ ["template_id",
1695
+ "active",
1696
+ "name",
1697
+ "html_content",
1698
+ "plain_content",
1699
+ "subject"]},
1700
+ "mail_settings_bcc"=>
1701
+ {"title"=>"Mail Settings: BCC",
1702
+ "type"=>"object",
1703
+ "properties"=>
1704
+ {"email"=>
1705
+ {"type"=>"string",
1706
+ "description"=>
1707
+ "The email address that will be sent a blind carbon copy."},
1708
+ "enabled"=>
1709
+ {"type"=>"boolean",
1710
+ "description"=>"Indicates if the BCC setting is enabled."}},
1711
+ "example"=>{"email"=>"example@example.com", "enabled"=>false}},
1712
+ "global:id"=>{"title"=>"Global: ID", "type"=>"integer"},
1713
+ "credentials"=>
1714
+ {"title"=>"Credentials",
1715
+ "type"=>"object",
1716
+ "properties"=>
1717
+ {"permissions"=>
1718
+ {"type"=>"object",
1719
+ "properties"=>
1720
+ {"api"=>{"type"=>"string"},
1721
+ "mail"=>{"type"=>"string"},
1722
+ "web"=>{"type"=>"string"}}},
1723
+ "username"=>{"type"=>"string"}},
1724
+ "example"=>
1725
+ {"address"=>"1234 example street",
1726
+ "address2"=>nil,
1727
+ "city"=>"Denver",
1728
+ "company"=>"Company name",
1729
+ "country"=>"US",
1730
+ "email"=>"example@example.com",
1731
+ "first_name"=>"Example",
1732
+ "last_name"=>"User",
1733
+ "phone"=>"(555) 555-5555",
1734
+ "state"=>"CO",
1735
+ "zip"=>"55555"}},
1736
+ "subuser_stats"=>
1737
+ {"title"=>"subuser_stats",
1738
+ "type"=>"object",
1739
+ "properties"=>
1740
+ {"date"=>
1741
+ {"type"=>"string",
1742
+ "description"=>"The date the statistics were gathered."},
1743
+ "stats"=>
1744
+ {"type"=>"array",
1745
+ "description"=>"The list of statistics.",
1746
+ "items"=>
1747
+ {"type"=>"object",
1748
+ "properties"=>
1749
+ {"first_name"=>
1750
+ {"type"=>"string",
1751
+ "description"=>"The first name of the subuser."},
1752
+ "last_name"=>
1753
+ {"type"=>"string",
1754
+ "description"=>"The last name of the subuser."},
1755
+ "metrics"=>
1756
+ {"type"=>"object",
1757
+ "properties"=>
1758
+ {"blocks"=>
1759
+ {"type"=>"integer",
1760
+ "description"=>
1761
+ "The number of emails that were not allowed to be delivered by ISPs."},
1762
+ "bounce_drops"=>
1763
+ {"type"=>"integer",
1764
+ "description"=>
1765
+ "The number of emails that were dropped because of a bounce."},
1766
+ "bounces"=>
1767
+ {"type"=>"integer",
1768
+ "description"=>
1769
+ "The number of emails that bounced instead of being delivered."},
1770
+ "clicks"=>
1771
+ {"type"=>"integer",
1772
+ "description"=>
1773
+ "The number of links that were clicked in your emails."},
1774
+ "deferred"=>
1775
+ {"type"=>"integer",
1776
+ "description"=>
1777
+ "The number of emails that temporarily could not be delivered."},
1778
+ "delivered"=>
1779
+ {"type"=>"integer",
1780
+ "description"=>
1781
+ "The number of emails SendGrid was able to confirm were actually delivered to a recipient."},
1782
+ "invalid_emails"=>
1783
+ {"type"=>"integer",
1784
+ "description"=>
1785
+ "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid."},
1786
+ "opens"=>
1787
+ {"type"=>"integer",
1788
+ "description"=>
1789
+ "The total number of times your emails were opened by recipients."},
1790
+ "processed"=>
1791
+ {"type"=>"integer",
1792
+ "description"=>
1793
+ "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed."},
1794
+ "requests"=>
1795
+ {"type"=>"integer",
1796
+ "description"=>
1797
+ "The number of emails that were requested to be delivered."},
1798
+ "spam_report_drops"=>
1799
+ {"type"=>"integer",
1800
+ "description"=>
1801
+ "The number of emails that were dropped due to a recipient previously marking your emails as spam."},
1802
+ "spam_reports"=>
1803
+ {"type"=>"integer",
1804
+ "description"=>
1805
+ "The number of recipients who marked your email as spam."},
1806
+ "unique_clicks"=>
1807
+ {"type"=>"integer",
1808
+ "description"=>
1809
+ "The number of unique recipients who clicked links in your emails."},
1810
+ "unique_opens"=>
1811
+ {"type"=>"integer",
1812
+ "description"=>
1813
+ "The number of unique recipients who opened your emails."},
1814
+ "unsubscribe_drops"=>
1815
+ {"type"=>"integer",
1816
+ "description"=>
1817
+ "The number of emails dropped due to a recipient unsubscribing from your emails."},
1818
+ "unsubscribes"=>
1819
+ {"type"=>"integer",
1820
+ "description"=>
1821
+ "The number of recipients who unsubscribed from your emails."}}},
1822
+ "name"=>
1823
+ {"type"=>"string",
1824
+ "description"=>"The username of the subuser."},
1825
+ "type"=>
1826
+ {"type"=>"string", "description"=>"The type of account."}}}}}},
1827
+ "campaign_request"=>
1828
+ {"title"=>"Campaigns Request",
1829
+ "type"=>"object",
1830
+ "properties"=>
1831
+ {"title"=>
1832
+ {"type"=>"string",
1833
+ "description"=>
1834
+ "The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI."},
1835
+ "subject"=>
1836
+ {"type"=>["string", "null"],
1837
+ "description"=>
1838
+ "The subject of your campaign that your recipients will see."},
1839
+ "sender_id"=>
1840
+ {"type"=>["null", "integer"],
1841
+ "description"=>
1842
+ "The ID of the \"sender\" identity that you have created. Your recipients will see this as the \"from\" on your marketing emails."},
1843
+ "list_ids"=>
1844
+ {"type"=>["array", "null"],
1845
+ "description"=>
1846
+ "The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs",
1847
+ "items"=>{"type"=>"integer"}},
1848
+ "segment_ids"=>
1849
+ {"type"=>["array", "null"],
1850
+ "description"=>
1851
+ "The segment IDs that you are sending this list to. You can have both segment IDs and list IDs.",
1852
+ "items"=>{"type"=>"integer"}},
1853
+ "categories"=>
1854
+ {"type"=>["array", "null"],
1855
+ "description"=>
1856
+ "The categories you would like associated to this campaign.",
1857
+ "items"=>{"type"=>"string"}},
1858
+ "suppression_group_id"=>
1859
+ {"type"=>["null", "integer"],
1860
+ "description"=>
1861
+ "The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type."},
1862
+ "custom_unsubscribe_url"=>
1863
+ {"type"=>["string", "null"],
1864
+ "description"=>
1865
+ "This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups."},
1866
+ "ip_pool"=>
1867
+ {"type"=>["string", "null"],
1868
+ "description"=>
1869
+ "The pool of IPs that you would like to send this email from."},
1870
+ "html_content"=>
1871
+ {"type"=>["string", "null"],
1872
+ "description"=>"The HTML of your marketing email."},
1873
+ "plain_content"=>
1874
+ {"type"=>["string", "null"],
1875
+ "description"=>"The plain text content of your emails."}},
1876
+ "required"=>["title"],
1877
+ "example"=>
1878
+ {"id"=>986724,
1879
+ "title"=>"May Newsletter",
1880
+ "subject"=>"New Products for Summer!",
1881
+ "sender_id"=>124451,
1882
+ "list_ids"=>[110, 124],
1883
+ "segment_ids"=>[110],
1884
+ "categories"=>["summer line"],
1885
+ "suppression_group_id"=>42,
1886
+ "custom_unsubscribe_url"=>"",
1887
+ "ip_pool"=>"marketing",
1888
+ "html_content"=>
1889
+ "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
1890
+ "plain_content"=>"Check out our summer line!",
1891
+ "status"=>"Draft"}},
1892
+ "user_scheduled_send_status"=>
1893
+ {"title"=>"User: Scheduled Send status",
1894
+ "allOf"=>
1895
+ [{"$ref"=>"#/definitions/mail_batch_id"},
1896
+ {"type"=>"object",
1897
+ "description"=>"The status of the scheduled send.",
1898
+ "properties"=>
1899
+ {"status"=>
1900
+ {"type"=>"string",
1901
+ "description"=>"The status of the scheduled send.",
1902
+ "enum"=>["cancel", "pause"]}},
1903
+ "required"=>["status"]}]},
1904
+ "mail_settings_forward_spam"=>
1905
+ {"title"=>"Mail Settings: Forward Spam",
1906
+ "type"=>"object",
1907
+ "properties"=>
1908
+ {"email"=>
1909
+ {"type"=>"string",
1910
+ "description"=>
1911
+ "The email address where you would like the spam reports to be forwarded."},
1912
+ "enabled"=>
1913
+ {"type"=>"boolean",
1914
+ "description"=>"Indicates if the Forward Spam setting is enabled."}},
1915
+ "example"=>{"email"=>"", "enabled"=>true}},
1916
+ "contactdb_segments_with_id"=>
1917
+ {"title"=>"ContactDB:: Segments with ID",
1918
+ "allOf"=>
1919
+ [{"type"=>"object",
1920
+ "properties"=>
1921
+ {"id"=>{"type"=>"number", "description"=>"The ID of the segment."}},
1922
+ "required"=>["id"]},
1923
+ {"$ref"=>"#/definitions/contactdb_segments"}]},
1924
+ "advanced_stats_country"=>
1925
+ {"title"=>"Stats: Advanced Stats with Clicks and Opens",
1926
+ "type"=>"object",
1927
+ "properties"=>
1928
+ {"date"=>
1929
+ {"type"=>"string",
1930
+ "description"=>"The date that the events occurred."},
1931
+ "stats"=>
1932
+ {"type"=>"array",
1933
+ "description"=>"The statistics of the email events.",
1934
+ "items"=>
1935
+ {"type"=>"object",
1936
+ "properties"=>
1937
+ {"type"=>
1938
+ {"type"=>"string", "description"=>"The type of segmentation."},
1939
+ "name"=>
1940
+ {"type"=>"string",
1941
+ "description"=>"The name of the specific segmentation."},
1942
+ "metrics"=>
1943
+ {"type"=>"object",
1944
+ "description"=>"The individual events and their stats.",
1945
+ "required"=>
1946
+ ["clicks", "opens", "unique_clicks", "unique_opens"],
1947
+ "properties"=>
1948
+ {"clicks"=>
1949
+ {"type"=>"integer",
1950
+ "description"=>
1951
+ "The number of links that were clicked in your emails."},
1952
+ "opens"=>
1953
+ {"type"=>"integer",
1954
+ "description"=>
1955
+ "The total number of times your emails were opened by recipients."},
1956
+ "unique_clicks"=>
1957
+ {"type"=>"integer",
1958
+ "description"=>
1959
+ "The number of unique recipients who clicked links in your emails."},
1960
+ "unique_opens"=>
1961
+ {"type"=>"integer",
1962
+ "description"=>
1963
+ "The number of unique recipients who opened your emails."}}}},
1964
+ "required"=>["type", "name", "metrics"]}}},
1965
+ "required"=>["date", "stats"]},
1966
+ "advanced_stats_clicks"=>
1967
+ {"title"=>"Stats: Advanced Stats with Clicks",
1968
+ "type"=>"object",
1969
+ "properties"=>
1970
+ {"date"=>
1971
+ {"type"=>"string",
1972
+ "description"=>"The date that the events occurred."},
1973
+ "stats"=>
1974
+ {"type"=>"array",
1975
+ "description"=>"The statistics of the email events.",
1976
+ "items"=>
1977
+ {"type"=>"object",
1978
+ "properties"=>
1979
+ {"type"=>
1980
+ {"type"=>"string", "description"=>"The type of segmentation."},
1981
+ "name"=>
1982
+ {"type"=>"string",
1983
+ "description"=>"The name of the specific segmentation."},
1984
+ "metrics"=>
1985
+ {"type"=>"object",
1986
+ "description"=>"The individual events and their stats.",
1987
+ "required"=>["clicks", "unique_clicks"],
1988
+ "properties"=>
1989
+ {"clicks"=>
1990
+ {"type"=>"integer",
1991
+ "description"=>
1992
+ "The number of links that were clicked in your emails."},
1993
+ "unique_clicks"=>
1994
+ {"type"=>"integer",
1995
+ "description"=>
1996
+ "The number of unique recipients who clicked links in your emails."}}}},
1997
+ "required"=>["type", "name", "metrics"]}}},
1998
+ "required"=>["date", "stats"]},
1999
+ "contactdb_recipient"=>
2000
+ {"title"=>"ContactDB: Recipient",
2001
+ "type"=>"object",
2002
+ "properties"=>
2003
+ {"recipients"=>
2004
+ {"type"=>"array",
2005
+ "items"=>
2006
+ {"type"=>"object",
2007
+ "properties"=>
2008
+ {"id"=>
2009
+ {"type"=>"string", "description"=>"The ID of this recipient."},
2010
+ "created_at"=>
2011
+ {"type"=>"number",
2012
+ "description"=>
2013
+ "The time this record was created in your contactdb, in unixtime."},
2014
+ "custom_fields"=>
2015
+ {"type"=>"array",
2016
+ "description"=>
2017
+ "The custom fields assigned to this recipient and their values.",
2018
+ "items"=>
2019
+ {"$ref"=>
2020
+ "#/definitions/contactdb_custom_field_with_id_value"}},
2021
+ "email"=>
2022
+ {"type"=>"string",
2023
+ "description"=>
2024
+ "The email address of this recipient. This is a default custom field that SendGrid provides.",
2025
+ "format"=>"email"},
2026
+ "first_name"=>
2027
+ {"type"=>["string", "null"],
2028
+ "description"=>
2029
+ "The first name of this recipient. This is a default custom field that SendGrid provides."},
2030
+ "last_name"=>
2031
+ {"type"=>["string", "null"],
2032
+ "description"=>"The last name of the recipient."},
2033
+ "last_clicked"=>
2034
+ {"type"=>["number", "null"],
2035
+ "description"=>
2036
+ "The last time this recipient clicked a link from one of your campaigns, in unixtime."},
2037
+ "last_emailed"=>
2038
+ {"type"=>["number", "null"],
2039
+ "description"=>
2040
+ "The last time this user was emailed by one of your campaigns, in unixtime."},
2041
+ "last_opened"=>
2042
+ {"type"=>["number", "null"],
2043
+ "description"=>
2044
+ "The last time this recipient opened an email from you, in unixtime."},
2045
+ "updated_at"=>
2046
+ {"type"=>"number",
2047
+ "description"=>
2048
+ "The last update date for this recipient's record."}},
2049
+ "required"=>["email"]}}}},
2050
+ "mail_settings_patch"=>
2051
+ {"title"=>"Mail Settings: Patch",
2052
+ "type"=>"object",
2053
+ "properties"=>
2054
+ {"enabled"=>
2055
+ {"type"=>"boolean",
2056
+ "description"=>"Indicates if the mail setting is enabled."},
2057
+ "email"=>
2058
+ {"type"=>"string",
2059
+ "description"=>"The email address of the recipient."}},
2060
+ "example"=>{"enabled"=>true, "email"=>"email@example.com"}},
2061
+ "mail_settings_forward_bounce"=>
2062
+ {"title"=>"Mail Settings: Forward Bounce",
2063
+ "type"=>"object",
2064
+ "properties"=>
2065
+ {"email"=>
2066
+ {"type"=>["string", "null"],
2067
+ "description"=>
2068
+ "The email address that you would like your bounce reports forwarded to."},
2069
+ "enabled"=>
2070
+ {"type"=>"boolean",
2071
+ "description"=>
2072
+ "Indicates if the bounce forwarding mail setting is enabled."}},
2073
+ "example"=>{"enabled"=>false, "email"=>nil}},
2074
+ "contactdb_custom_field_with_id_value"=>
2075
+ {"title"=>"ContactDB Custom field schema.",
2076
+ "allOf"=>
2077
+ [{"$ref"=>"#/definitions/contactdb_custom_field_with_id"},
2078
+ {"type"=>"object",
2079
+ "properties"=>
2080
+ {"value"=>
2081
+ {"type"=>["string", "null"],
2082
+ "description"=>"The value of this recipient's custom field"}}}]},
2083
+ "contactdb_recipient_count"=>
2084
+ {"title"=>"ContactDB: Recipient Count",
2085
+ "type"=>"object",
2086
+ "properties"=>
2087
+ {"recipient_count"=>
2088
+ {"type"=>"number", "description"=>"The count of recipients."}},
2089
+ "required"=>["recipient_count"],
2090
+ "example"=>{"recipient_count"=>1234}},
2091
+ "subuser_post"=>
2092
+ {"title"=>"Subuser::POST",
2093
+ "type"=>"object",
2094
+ "properties"=>
2095
+ {"username"=>
2096
+ {"type"=>"string", "description"=>"The username of the subuser."},
2097
+ "user_id"=>
2098
+ {"type"=>"number", "description"=>"The user ID for this subuser."},
2099
+ "email"=>
2100
+ {"type"=>"string",
2101
+ "description"=>"The email address for this subuser.",
2102
+ "format"=>"email"},
2103
+ "signup_session_token"=>{"type"=>"string"},
2104
+ "authorization_token"=>{"type"=>"string"},
2105
+ "credit_allocation"=>
2106
+ {"type"=>"object", "properties"=>{"type"=>{"type"=>"string"}}}},
2107
+ "required"=>["username", "user_id", "email"],
2108
+ "example"=>
2109
+ {"username"=>"example_subuser",
2110
+ "user_id"=>1234,
2111
+ "email"=>"example@example.com",
2112
+ "signup_session_token"=>"",
2113
+ "authorization_token"=>"",
2114
+ "credit_allocation"=>{"type"=>"unlimited"}}},
2115
+ "whitelabel::domain"=>
2116
+ {"title"=>"Whitelabel - Domain",
2117
+ "type"=>"object",
2118
+ "properties"=>
2119
+ {"id"=>
2120
+ {"type"=>"number", "description"=>"The ID of the domain whitelabel."},
2121
+ "user_id"=>
2122
+ {"type"=>"number",
2123
+ "description"=>
2124
+ "The ID of the user that this whitelabel will be associated with."},
2125
+ "subdomain"=>
2126
+ {"type"=>"string",
2127
+ "description"=>"The subdomain to use for this domain whitelabel."},
2128
+ "domain"=>
2129
+ {"type"=>"string",
2130
+ "description"=>
2131
+ "The domain that this whitelabel is being created for."},
2132
+ "username"=>
2133
+ {"type"=>"string",
2134
+ "description"=>
2135
+ "The username that this whitelabel will be associated with."},
2136
+ "ips"=>
2137
+ {"type"=>"array",
2138
+ "description"=>
2139
+ "The IPs to be included in the custom SPF record for this domain whitelabel.",
2140
+ "items"=>{"type"=>"object"}},
2141
+ "custom_spf"=>
2142
+ {"type"=>"boolean",
2143
+ "description"=>
2144
+ "Indicates whether this domain whitelabel will use custom SPF."},
2145
+ "default"=>
2146
+ {"type"=>"boolean",
2147
+ "description"=>
2148
+ "Indicates if this domain whitelabel is the default whitelabel."},
2149
+ "legacy"=>
2150
+ {"type"=>"boolean",
2151
+ "description"=>
2152
+ "Indicates if this domain whitelabel was created using the legacy whitelabel tool."},
2153
+ "automatic_security"=>
2154
+ {"type"=>"boolean",
2155
+ "description"=>
2156
+ "Indicates if this domain whitelabel uses automated security."},
2157
+ "valid"=>
2158
+ {"type"=>"boolean",
2159
+ "description"=>"Indicates if this is a valid whitelabel."},
2160
+ "dns"=>
2161
+ {"type"=>"object",
2162
+ "description"=>
2163
+ "The DNS records for this whitelabel that are used to authenticate the sending domain.",
2164
+ "required"=>["mail_cname", "dkim1", "dkim2"],
2165
+ "properties"=>
2166
+ {"mail_cname"=>
2167
+ {"type"=>"object",
2168
+ "description"=>
2169
+ "The CNAME for your sending domain that points to sendgrid.net.",
2170
+ "required"=>["valid", "type", "host", "data"],
2171
+ "properties"=>
2172
+ {"valid"=>
2173
+ {"type"=>"boolean",
2174
+ "description"=>"Indicates if this is a valid CNAME."},
2175
+ "type"=>
2176
+ {"type"=>"string", "description"=>"The type of DNS record."},
2177
+ "host"=>
2178
+ {"type"=>"string",
2179
+ "description"=>"The domain that this CNAME is created for.",
2180
+ "format"=>"hostname"},
2181
+ "data"=>
2182
+ {"type"=>"string", "description"=>"The CNAME record."}}},
2183
+ "dkim1"=>
2184
+ {"type"=>"object",
2185
+ "description"=>"A DNS record.",
2186
+ "required"=>["valid", "type", "host", "data"],
2187
+ "properties"=>
2188
+ {"valid"=>
2189
+ {"type"=>"boolean",
2190
+ "description"=>"Indicates if this is a valid DNS record."},
2191
+ "type"=>
2192
+ {"type"=>"string", "description"=>"The type of DNS record."},
2193
+ "host"=>
2194
+ {"type"=>"string",
2195
+ "description"=>
2196
+ "The domain that this DNS record was created for."},
2197
+ "data"=>{"type"=>"string", "description"=>"The DNS record."}}},
2198
+ "dkim2"=>
2199
+ {"type"=>"object",
2200
+ "description"=>"A DNS record.",
2201
+ "required"=>["valid", "type", "host", "data"],
2202
+ "properties"=>
2203
+ {"valid"=>
2204
+ {"type"=>"boolean",
2205
+ "description"=>"Indicates if this is a valid DNS record."},
2206
+ "type"=>
2207
+ {"type"=>"string", "description"=>"The type of DNS record."},
2208
+ "host"=>
2209
+ {"type"=>"string",
2210
+ "description"=>
2211
+ "The domain that this DNS record was created for."},
2212
+ "data"=>
2213
+ {"type"=>"string", "description"=>"The DNS record."}}}}}},
2214
+ "required"=>
2215
+ ["id",
2216
+ "user_id",
2217
+ "subdomain",
2218
+ "domain",
2219
+ "username",
2220
+ "ips",
2221
+ "custom_spf",
2222
+ "default",
2223
+ "legacy",
2224
+ "automatic_security",
2225
+ "valid",
2226
+ "dns"]},
2227
+ "mail_batch_id"=>
2228
+ {"title"=>"Mail: Batch ID",
2229
+ "type"=>"object",
2230
+ "properties"=>
2231
+ {"batch_id"=>{"type"=>"string", "pattern"=>"^[a-zA-Z0-9\\-\\_]"}},
2232
+ "required"=>["batch_id"],
2233
+ "example"=>{"batch_id"=>"HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi"}}}}
2234
+ end