mailgun.js 12.2.0 → 12.3.1

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/README.md CHANGED
@@ -27,7 +27,7 @@ __Table of Contents__
27
27
  - [Release Process](#release-process)
28
28
 
29
29
  # Documentation
30
- [Mailgun API Documentation](https://documentation.mailgun.com/en/latest/api_reference.html):
30
+ [Mailgun API Documentation](https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview)
31
31
 
32
32
  ## Install
33
33
 
@@ -35,7 +35,7 @@ __Table of Contents__
35
35
 
36
36
  Install mailgun.js with:
37
37
 
38
- ```sh
38
+ ```SH
39
39
  npm install mailgun.js
40
40
  ```
41
41
 
@@ -45,7 +45,7 @@ The next step is to import the module and instantiate a mailgun client by callin
45
45
 
46
46
  NOTE: starting from version 3.0 you need to pass FormData (we need this to keep library universal). For node.js you can use built-in FormData or `form-data` library.
47
47
 
48
- **IMPORTANT**: if you are using EU infrastructure, you need to also pass `url: 'https://api.eu.mailgun.net'` together with auth credentials as stated in [Mailgun docs](https://documentation.mailgun.com/en/latest/quickstart-sending.html#send-via-api)
48
+ **IMPORTANT**: if you use EU infrastructure, you need to also pass `url: 'https://api.eu.mailgun.net'` together with auth credentials as stated in [Mailgun docs](https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#base-url)
49
49
 
50
50
  ### Imports
51
51
  Once the package is installed, you can import the library using `import` or `require` approach:
@@ -186,7 +186,7 @@ Example:
186
186
 
187
187
 
188
188
  ### SubAccounts Usage
189
- Primary accounts can make API calls on behalf of their subaccounts. [API documentation](https://documentation.mailgun.com/en/latest/subaccounts.html#subaccounts)
189
+ Primary accounts can make API calls on behalf of their subaccounts. [API documentation](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts)
190
190
  ```js
191
191
  import Mailgun from 'mailgun.js';
192
192
  const mailgun = new Mailgun(FormData); // or import FormData from 'form-data'
@@ -210,6 +210,10 @@ The following service methods are available to instantiated clients. The example
210
210
  - [Methods](#methods)
211
211
  - [messages](#messages)
212
212
  - [create](#create)
213
+ - [retrieveStoredEmail](#retrievestoredemail)
214
+ - [resendEmail](#resendemail)
215
+ - [getMessagesQueueStatus](#getmessagesqueuestatus)
216
+ - [clearMessagesQueue](#clearmessagesqueue)
213
217
  - [domains](#domains)
214
218
  - [list](#list)
215
219
  - [get](#get)
@@ -243,6 +247,15 @@ The following service methods are available to instantiated clients. The example
243
247
  - [get](#get-2)
244
248
  - [generate](#generate)
245
249
  - [regenerate](#regenerate)
250
+ - [domain keys](#domain-keys)
251
+ - [list](#list-2)
252
+ - [listAll](#listall)
253
+ - [create](#create-3)
254
+ - [activate](#activate)
255
+ - [deactivate](#deactivate)
256
+ - [destroy](#destroy-2)
257
+ - [updateDKIMAuthority](#updatedkimauthority-1)
258
+ - [updateDKIMSelector](#updatedkimselector-1)
246
259
  - [events](#events)
247
260
  - [get](#get-3)
248
261
  - [Example with Date and *Filter field*](#example-with-date-and-filter-field)
@@ -254,7 +267,7 @@ The following service methods are available to instantiated clients. The example
254
267
  - [getAccount](#getaccount-1)
255
268
  - [getAccountUsage](#getaccountusage)
256
269
  - [suppressions](#suppressions)
257
- - [list](#list-2)
270
+ - [list](#list-3)
258
271
  - [Bounces Example](#bounces-example)
259
272
  - [Unsubscribes Example](#unsubscribes-example)
260
273
  - [Complaints Example](#complaints-example)
@@ -262,41 +275,41 @@ The following service methods are available to instantiated clients. The example
262
275
  - [Bounces Example](#bounces-example-1)
263
276
  - [Unsubscribes Example](#unsubscribes-example-1)
264
277
  - [Complaints Example](#complaints-example-1)
265
- - [create](#create-3)
278
+ - [create](#create-4)
266
279
  - [Bounces Example](#bounces-example-2)
267
280
  - [Unsubscribes Example](#unsubscribes-example-2)
268
281
  - [Unsubscribe from one tag](#unsubscribe-from-one-tag)
269
282
  - [Unsubscribe from particular tags](#unsubscribe-from-particular-tags)
270
283
  - [Complaints Example](#complaints-example-2)
271
- - [destroy](#destroy-2)
284
+ - [destroy](#destroy-3)
272
285
  - [Bounces Example](#bounces-example-3)
273
286
  - [Unsubscribes Example](#unsubscribes-example-3)
274
287
  - [Complaints Example](#complaints-example-3)
275
288
  - [webhooks](#webhooks)
276
- - [list](#list-3)
289
+ - [list](#list-4)
277
290
  - [get](#get-5)
278
- - [create](#create-4)
291
+ - [create](#create-5)
279
292
  - [update](#update-2)
280
- - [destroy](#destroy-3)
293
+ - [destroy](#destroy-4)
281
294
  - [routes](#routes)
282
- - [list](#list-4)
295
+ - [list](#list-5)
283
296
  - [get](#get-6)
284
- - [create](#create-5)
297
+ - [create](#create-6)
285
298
  - [update](#update-3)
286
- - [destroy](#destroy-4)
299
+ - [destroy](#destroy-5)
287
300
  - [validate](#validate)
288
301
  - [get](#get-7)
289
302
  - [multiple validation](#multiple-validation)
290
- - [create](#create-6)
291
- - [list](#list-5)
303
+ - [create](#create-7)
304
+ - [list](#list-6)
292
305
  - [get](#get-8)
293
- - [destroy](#destroy-5)
306
+ - [destroy](#destroy-6)
294
307
  - [mailing lists](#mailing-lists)
295
- - [list](#list-6)
308
+ - [list](#list-7)
296
309
  - [get](#get-9)
297
- - [create](#create-7)
310
+ - [create](#create-8)
298
311
  - [update](#update-4)
299
- - [destroy](#destroy-6)
312
+ - [destroy](#destroy-7)
300
313
  - [mailing list members](#mailing-list-members)
301
314
  - [listMembers](#listmember)
302
315
  - [getMember](#getmember)
@@ -305,39 +318,39 @@ The following service methods are available to instantiated clients. The example
305
318
  - [updateMember](#updatemember)
306
319
  - [destroyMember](#destroymember)
307
320
  - [subaccounts](#subaccounts)
308
- - [list](#list-7)
321
+ - [list](#list-8)
309
322
  - [get](#get-10)
310
- - [create](#create-8)
323
+ - [create](#create-9)
311
324
  - [enable](#enable)
312
325
  - [disable](#disable)
313
- - [destroy](#destroy-7)
326
+ - [destroy](#destroy-8)
314
327
  - [setMonthlySendingLimit](#setmonthlysendinglimit)
315
328
  - [getMonthlySendingLimit](#getmonthlysendinglimit)
316
329
  - [updateSubaccountFeature](#updatesubaccountfeature)
317
330
  - [inbox placements](#inbox-placements)
318
331
  - [SeedsLists](#seedslists)
319
- - [list](#list-8)
332
+ - [list](#list-9)
320
333
  - [get](#get-11)
321
- - [create](#create-9)
334
+ - [create](#create-10)
322
335
  - [update](#update-5)
323
- - [destroy](#destroy-8)
336
+ - [destroy](#destroy-9)
324
337
  - [SeedsLists Attributes](#attributes)
325
- - [list](#list-9)
338
+ - [list](#list-10)
326
339
  - [get](#get-12)
327
340
  - [SeedsLists Filters](#filters)
328
- - [list](#list-10)
341
+ - [list](#list-11)
329
342
  - [Providers](#providers)
330
- - [list](#list-11)
331
- - [Results](#results)
332
343
  - [list](#list-12)
344
+ - [Results](#results)
345
+ - [list](#list-13)
333
346
  - [get](#get-13)
334
- - [destroy](#destroy-9)
347
+ - [destroy](#destroy-10)
335
348
  - [getResultByShareId](#getresultbyshareid)
336
349
  - [Results Attributes](#attributes-1)
337
- - [list](#list-13)
350
+ - [list](#list-14)
338
351
  - [get](#get-14)
339
352
  - [Results Filters](#filters-1)
340
- - [list](#list-14)
353
+ - [list](#list-15)
341
354
  - [Sharing](#sharing)
342
355
  - [get](#get-15)
343
356
  - [update](#update-6)
@@ -361,8 +374,9 @@ The following service methods are available to instantiated clients. The example
361
374
  ### Messages
362
375
 
363
376
  - #### create
377
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/post-v3--domain-name--messages)
364
378
 
365
- `mg.messages.create(domain, data)` - [api docs](https://documentation.mailgun.com/en/latest/api-sending.html)
379
+ `mg.messages.create(domain, data)`
366
380
 
367
381
  Options:
368
382
 
@@ -501,7 +515,6 @@ The following service methods are available to instantiated clients. The example
501
515
  })
502
516
  .then(response => console.log(response))
503
517
  ```
504
-
505
518
  - Browser example of send file
506
519
 
507
520
  Before sending the file you need to somehow get the Blob of the file.
@@ -540,23 +553,170 @@ The following service methods are available to instantiated clients. The example
540
553
  }
541
554
  ```
542
555
 
556
+ - #### retrieveStoredEmail
557
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/get-v3-domains--domain-name--messages--storage-key-)
558
+
559
+ `mg.messages.retrieveStoredEmail(domain, storageKey)`
560
+
561
+ **storageKey** - Storage key from the email's associated events (Example: Accepted/Delivered events storage.key field). Mentioned events can be found on https://app.mailgun.com/ (Send -> logs).
562
+
563
+ *Note: Storage keys are available for the duration of your domain's message retention policy.*
564
+
565
+ Example:
566
+
567
+ ```JS
568
+ mg.messages.retrieveStoredEmail('sandbox-123.mailgun.org', 'BABEAAeEDgPUyeFqr-tATLaCfYqyqvLpbg')
569
+ .then(storedEmail => console.log(storedEmail)) // logs response data
570
+ .catch(err => console.error(err)); // logs any error
571
+ ```
572
+
573
+ Promise returns:
574
+
575
+ ```JS
576
+ {
577
+ 'Content-Type': 'multipart/alternative; boundary="boundary_12345"',
578
+ From: 'postmaster@sandbox.mailgun.org',
579
+ 'Message-Id': '<123.123@sandbox.mailgun.org>',
580
+ 'Mime-Version': '1.0',
581
+ Subject: 'Hello',
582
+ To: 'foo@example.com',
583
+ 'X-Mailgun-Deliver-By': 'Fri, 28 Nov 2025 18:02:00 +0000',
584
+ sender: 'postmaster@sandbox.mailgun.org',
585
+ recipients: 'foo@example.com',
586
+ from: 'postmaster@sandbox.mailgun.org',
587
+ subject: 'Hello',
588
+ 'body-html': '<a href="https://test.com">Test</a>',
589
+ 'body-plain': 'Testing some Mailgun awesomness!',
590
+ attachments: [],
591
+ 'content-id-map': {},
592
+ 'message-headers': [
593
+ ['Mime-Version', '1.0'],
594
+ [
595
+ 'Content-Type',
596
+ 'multipart/alternative; boundary="boundary_12345'
597
+ ],
598
+ ['Subject', 'Hello'],
599
+ ['From', 'postmaster@sandbox.mailgun.org'],
600
+ ['To', 'foo@example.com'],
601
+ ['X-Mailgun-Deliver-By', 'Fri, 28 Nov 2025 18:02:00 +0000'],
602
+ [
603
+ 'Message-Id',
604
+ '<123.123@sandbox.mailgun.org>'
605
+ ]
606
+ ],
607
+ 'stripped-html': '<a href="https://test.com">Test</a>',
608
+ 'stripped-text': 'Testing some Mailgun awesomness!',
609
+ 'stripped-signature': ''
610
+ }
611
+ ```
612
+
613
+ - ### resendEmail
614
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/post-v3-domains--domain-name--messages--storage-key-)
615
+
616
+ `mg.messages.resendEmail(domain, storageKey, recipient)`
617
+
618
+ **storageKey** - Storage key from the email's associated events (Example: Accepted/Delivered events storage.key field). Mentioned events can be found on https://app.mailgun.com/ (Send -> logs).
619
+
620
+ *Note: Storage keys are available for the duration of your domain's message retention policy.*
621
+
622
+ **recipient** - Email address of the recipient(s). Supports friendly name format.
623
+ Example: "Bob <bob@host.com>". Use commas to separate multiple recipients. Duplicate addresses are automatically ignored.
624
+
625
+ Example:
626
+
627
+ ```JS
628
+ mg.messages.resendEmail(
629
+ 'sandbox-123.mailgun.org',
630
+ 'BABEAAeEDgPUyeFqr-tATLaCfYqyqvLpbg',
631
+ 'foo@test.com, bar@test.com'
632
+ ).then(resendStatus => console.log(resendStatus)) // logs response data
633
+ .catch(err => console.error(err)); // logs any error
634
+ ```
635
+
636
+ Promise returns:
637
+
638
+ ```JS
639
+ {
640
+ id: '<20151025002517.117282.79817@sandbox-123.mailgun.org>',
641
+ message: 'Queued. Thank you.'
642
+ }
643
+ ```
644
+
645
+ - ### getMessagesQueueStatus
646
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/get-v3-domains--name--sending-queues)
647
+
648
+ `mg.messages.getMessagesQueueStatus(domain)`
649
+
650
+ Example:
651
+
652
+ ```JS
653
+ mg.messages.getMessagesQueueStatus('sandbox-123.mailgun.org')
654
+ .then(queueStatus => console.log(queueStatus)) // logs response data
655
+ .catch(err => console.error(err)); // logs any error
656
+ ```
657
+
658
+ Promise returns:
659
+
660
+ ```JS
661
+ {
662
+ regular: {
663
+ is_disabled: false,
664
+ disabled: {
665
+ until: null,
666
+ reason: ''
667
+ }
668
+ },
669
+ scheduled: {
670
+ is_disabled: true,
671
+ disabled: {
672
+ until: new Date('2025-11-28T18:02:00Z'),
673
+ reason: 'High load'
674
+ }
675
+ }
676
+ }
677
+ ```
678
+
679
+ - ### clearMessagesQueue
680
+ Deletes all scheduled and undelivered mail from the domain queue.
681
+
682
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/delete-v3--domain-name--envelopes)
683
+
684
+ `mg.messages.getMessagesQueueStatus(domain, storageUrl)`
685
+
686
+ **storageUrl** - Mail's generated storage URL. e.g. https://storage-us-east4.api.mailgun.net/v3/example.com/envelopes. Can be found on https://app.mailgun.com/ (Send -> logs -> event). Allowed values: `storage-us-east4.api.mailgun.net`, `storage-us-west1.api.mailgun.net`, and `storage-europe-west1.api.mailgun.net`.
687
+
688
+ Example:
689
+
690
+ ```JS
691
+ mg.messages.clearMessagesQueue('sandbox-123.mailgun.org', 'storage-us-east4.api.mailgun.net')
692
+ .then(result => console.log(result)) // logs response data
693
+ .catch(err => console.error(err)); // logs any error
694
+ ```
695
+
696
+ Promise returns:
697
+ ```JS
698
+ {
699
+ message: "done"
700
+ }
701
+ ```
702
+
543
703
  ### Templates
544
704
 
545
705
  Mailgun’s templates uses a fork of the very popular template engine [handlebars](https://handlebarsjs.com/).
546
706
 
547
- To provide values for a substitution you need to use 'h:X-Mailgun-Variables' property in the message description.
707
+ To provide values for a substitution you need to use `h:X-Mailgun-Variables` property in the message description.
548
708
 
549
709
  Make sure that this property is a JSON string like:
550
- ```js
551
- JSON.stringify({
552
- "title": "A title",
553
- "body": "The body"
554
- })
710
+ ```JS
711
+ JSON.stringify({
712
+ title: "A title",
713
+ body: "The body"
714
+ })
555
715
  ```
556
716
 
557
717
  You can find few examples of how to use templates below.
558
718
  - Providing values for **title** and **slug** variables to render in template
559
- ```js
719
+ ```JS
560
720
  ...
561
721
  const {
562
722
  title,
@@ -607,7 +767,7 @@ The following service methods are available to instantiated clients. The example
607
767
 
608
768
  ### Recipient Variables
609
769
 
610
- [Docs](https://documentation.mailgun.com/en/latest/user_manual.html#batch-sending)
770
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/post-v3--domain-name--messages)
611
771
 
612
772
  Recipient Variables are custom variables that you define, which you can then reference in the message body. They give you the ability to send a custom message to each recipient while still using a single API Call.
613
773
 
@@ -640,14 +800,17 @@ The following service methods are available to instantiated clients. The example
640
800
 
641
801
  - #### list
642
802
  Get the list of domains. Can be filtered by state or authority. Sorting is optional. The list is paginated and limited to 1000 items per page.
643
- `mg.domains.list(query)` - [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domains/#tag/Domains/operation/GET-v4-domains)
803
+
804
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/get-v4-domains)
805
+
806
+ `mg.domains.list(query)`
644
807
 
645
808
  Example:
646
809
 
647
- ```js
648
- mg.domains.list()
649
- .then(domains => console.log(domains)) // logs array of domains
650
- .catch(err => console.error(err)); // logs any error
810
+ ```JS
811
+ mg.domains.list()
812
+ .then(domains => console.log(domains)) // logs array of domains
813
+ .catch(err => console.error(err)); // logs any error
651
814
  ```
652
815
 
653
816
  Promise returns: array of Domain instances
@@ -688,7 +851,9 @@ The following service methods are available to instantiated clients. The example
688
851
  - #### get
689
852
  Fetches representation of a domain that includes details about the domain's state and settings.
690
853
 
691
- `mg.domains.get(domain, query)` - [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domains/#tag/Domains/operation/GET-v4-domains--name-)
854
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/get-v4-domains--name-)
855
+
856
+ `mg.domains.get(domain, query)`
692
857
 
693
858
  Example:
694
859
 
@@ -756,7 +921,9 @@ The following service methods are available to instantiated clients. The example
756
921
  - #### create
757
922
  Creates a domain for sending emails
758
923
 
759
- `mg.domains.create(data)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domains/#tag/Domains/operation/POST-v4-domains)
924
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/post-v4-domains)
925
+
926
+ `mg.domains.create(data)`
760
927
 
761
928
  Example:
762
929
 
@@ -848,7 +1015,9 @@ The following service methods are available to instantiated clients. The example
848
1015
  - #### verify
849
1016
  Verify the domains DNS records (includes A, CNAME, SPF, DKIM and MX records) to ensure the domain is ready and able to send
850
1017
 
851
- `mg.domains.verify(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domains/#tag/Domains/operation/PUT-v4-domains--name--verify)
1018
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/put-v4-domains--name--verify)
1019
+
1020
+ `mg.domains.verify(domainAddress)`
852
1021
 
853
1022
  Example:
854
1023
 
@@ -906,7 +1075,9 @@ The following service methods are available to instantiated clients. The example
906
1075
  - #### update
907
1076
  Update domains configuration like smtp credentials, enable/disable automatic sender security, spam actions, wildcard, or tracking web scheme.
908
1077
 
909
- `mg.domains.update(domain, options)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domains/#tag/Domains/operation/PUT-v4-domains--name-)
1078
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/put-v4-domains--name-)
1079
+
1080
+ `mg.domains.update(domain, options)`
910
1081
 
911
1082
  Example:
912
1083
 
@@ -986,7 +1157,10 @@ The following service methods are available to instantiated clients. The example
986
1157
 
987
1158
  - #### destroy
988
1159
  The domain must not be disabled or used as an authority for an other domain. Sandbox domain can't be deleted.
989
- `mg.domains.destroy(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domains/#tag/Domains/operation/DELETE-v3-domains--name-)
1160
+
1161
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/delete-v3-domains--name-)
1162
+
1163
+ `mg.domains.destroy(domainAddress)`
990
1164
 
991
1165
  Example:
992
1166
 
@@ -1011,9 +1185,13 @@ The following service methods are available to instantiated clients. The example
1011
1185
  `domains.updateTracking` method is deprecated, and will be removed. Please use `domains.domainTracking.updateTracking` instead.
1012
1186
 
1013
1187
  - #### getConnection
1188
+ ***Deprecated, and will be removed in the future releases***
1189
+
1014
1190
  Returns domain's delivery connection settings.
1015
1191
 
1016
- `mg.domains.getConnection(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Connection/#tag/Domain-Connection/operation/GET-v3-domains--name--connection)
1192
+ [API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/domain/operation/httpapi.(*T).GetDomainConnection-fm-14-0/)
1193
+
1194
+ `mg.domains.getConnection(domainAddress)`
1017
1195
 
1018
1196
  Example:
1019
1197
 
@@ -1033,9 +1211,13 @@ The following service methods are available to instantiated clients. The example
1033
1211
  ```
1034
1212
 
1035
1213
  - #### updateConnection
1214
+ ***Deprecated, and will be removed in the future releases***
1215
+
1036
1216
  Update a domain's TLS connection settings.
1037
1217
 
1038
- `mg.domains.updateConnection(domainAddress, data)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Connection/#tag/Domain-Connection/operation/PUT-v3-domains--name--connection)
1218
+ [API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/domain/operation/httpapi.(*T).UpdateDomainConnection-fm-15-0/)
1219
+
1220
+ `mg.domains.updateConnection(domainAddress, data)`
1039
1221
 
1040
1222
  Example:
1041
1223
 
@@ -1059,78 +1241,13 @@ The following service methods are available to instantiated clients. The example
1059
1241
  ```
1060
1242
 
1061
1243
  - #### updateDKIMAuthority
1062
- You can delegate the domain authority to an other domain. Domain's authority is set to itself by default.
1063
-
1064
- `mg.domains.updateDKIMAuthority(domainAddress, data)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Keys/#tag/Domain-Keys/operation/PUT-v3-domains--name--dkim-authority)
1065
-
1066
- Example:
1067
-
1068
- ```JS
1069
- mg.domains.updateDKIMAuthority(domainAddress, {
1070
- self: true
1071
- })
1072
- .then(data => console.log(data)) // logs response data
1073
- .catch(err => console.error(err)); // logs any error
1074
- ```
1075
-
1076
- Data object accepts next properties:
1077
-
1078
- | Property | Description |
1079
- |:--------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
1080
- | self | Change the DKIM authority for a domain. If set to true, the domain will be the DKIM authority for itself even if the root domain is registered on the same mailgun account If set to false, the domain will have the same DKIM authority as the root domain registered on the same mailgun account |
1081
-
1082
- Promise returns:
1083
-
1084
- ```JS
1085
- {
1086
- message: 'Domain DKIM authority has been changed',
1087
- sending_dns_records: [
1088
- {
1089
- is_active: true,
1090
- cached: [],
1091
- name: 'sending_dns_record_name',
1092
- record_type: 'TXT',
1093
- valid: 'unknown',
1094
- value: 'sending_dns_record_value'
1095
- },
1096
- ...
1097
- ],
1098
- changed: true
1099
- }
1100
- ```
1244
+ `domains.updateDKIMAuthority` method is deprecated, and will be removed. Please use `domains.domainKeys.updateDKIMAuthority` [instead](#updatedkimauthority-1).
1101
1245
 
1102
1246
  - #### updateDKIMSelector
1103
- Selector is the unique identifier of your key. It has to be different from other keys selector.
1104
-
1105
- `mg.domains.updateDKIMSelector(domainAddress, data)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Keys/#tag/Domain-Keys/operation/PUT-v3-domains--name--dkim-selector)
1106
-
1107
- Example:
1108
-
1109
- ```JS
1110
- mg.domains.updateDKIMSelector(domainAddress, {
1111
- dkimSelector: 'dkimSelector_value'
1112
- })
1113
- .then(data => console.log(data)) // logs response data
1114
- .catch(err => console.error(err)); // logs any error
1115
- ```
1116
-
1117
- Data object accepts next properties:
1118
-
1119
- | Property | Description |
1120
- |:--------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
1121
- | dkimSelector | Selector is the unique identifier of your key. It has to be different from other keys selector. |
1122
-
1123
- Promise returns:
1124
-
1125
- ```JS
1126
- {
1127
- message: 'DKIM selector changed',
1128
- status: 200
1129
- }
1130
- ```
1247
+ `domains.updateDKIMSelector` method is deprecated, and will be removed. Please use `domains.domainKeys.updateDKIMSelector` [instead](#updatedkimselector-1).
1131
1248
 
1132
1249
  - #### getIps
1133
- **Deprecated, and will be removed in the future releases**
1250
+ ***Deprecated, and will be removed in the future releases***
1134
1251
 
1135
1252
  `mg.domains.getIps(domain)`
1136
1253
 
@@ -1149,7 +1266,7 @@ The following service methods are available to instantiated clients. The example
1149
1266
  ```
1150
1267
 
1151
1268
  - #### assignIp
1152
- **Deprecated, and will be removed in the future releases**
1269
+ ***Deprecated, and will be removed in the future releases***
1153
1270
  `mg.domains.assignIp(domain, ip)`
1154
1271
 
1155
1272
  Example:
@@ -1191,7 +1308,9 @@ The following service methods are available to instantiated clients. The example
1191
1308
  - #### list
1192
1309
  Returns a list of templates for the domain.
1193
1310
 
1194
- `mg.domains.domainTemplates.list('domainId', query)` - [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).GetPage-fm-9)
1311
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates)
1312
+
1313
+ `mg.domains.domainTemplates.list('domainId', query)`
1195
1314
 
1196
1315
  Example:
1197
1316
 
@@ -1230,7 +1349,9 @@ The following service methods are available to instantiated clients. The example
1230
1349
 
1231
1350
  Returns metadata information about the stored template specified in the url. If the active flag is provided, the content of the active version of the template is returned.
1232
1351
 
1233
- `mg.domains.domainTemplates.get('domainId', 'templateName', query)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).Get-fm-6)
1352
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates--template-name-)
1353
+
1354
+ `mg.domains.domainTemplates.get('domainId', 'templateName', query)`
1234
1355
 
1235
1356
  Example:
1236
1357
 
@@ -1275,7 +1396,9 @@ The following service methods are available to instantiated clients. The example
1275
1396
  Store a new template, including its name, description and (optionally) the template content.
1276
1397
  If the template content is provided, a new version is automatically created and becomes the active version.
1277
1398
 
1278
- `mg.domains.domainTemplates.create(domainId, templateData)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).Post-fm-4)
1399
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/post-v3--domain-name--templates)
1400
+
1401
+ `mg.domains.domainTemplates.create(domainId, templateData)`
1279
1402
 
1280
1403
  Example:
1281
1404
 
@@ -1334,7 +1457,9 @@ The following service methods are available to instantiated clients. The example
1334
1457
  - #### update
1335
1458
  Update the description of a template.
1336
1459
 
1337
- `mg.domains.domainTemplates.update('domainId', 'templateName', data)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).Put-fm-12)
1460
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/put-v3--domain-name--templates--template-name-)
1461
+
1462
+ `mg.domains.domainTemplates.update('domainId', 'templateName', data)`
1338
1463
 
1339
1464
  Example:
1340
1465
 
@@ -1363,7 +1488,9 @@ The following service methods are available to instantiated clients. The example
1363
1488
  - #### destroy
1364
1489
  Delete the template specified in the url. NOTE: This method deletes all versions of the specified template.
1365
1490
 
1366
- `mg.domains.domainTemplates.destroy('domainId', 'templateName')` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).Delete-fm-13)
1491
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/delete-v3--domain-name--templates--template-name-)
1492
+
1493
+ `mg.domains.domainTemplates.destroy('domainId', 'templateName')`
1367
1494
 
1368
1495
  Example:
1369
1496
 
@@ -1385,7 +1512,9 @@ The following service methods are available to instantiated clients. The example
1385
1512
  - #### destroyAll
1386
1513
  Delete all templates and their versions for the domain.
1387
1514
 
1388
- `mg.domains.domainTemplates.destroyAll('domainId')` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).DeleteAll-fm-15)
1515
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/delete-v3--domain-name--templates)
1516
+
1517
+ `mg.domains.domainTemplates.destroyAll('domainId')`
1389
1518
 
1390
1519
  Example:
1391
1520
 
@@ -1406,7 +1535,9 @@ The following service methods are available to instantiated clients. The example
1406
1535
  - #### listVersions
1407
1536
  Returns a paginated list of template versions.
1408
1537
 
1409
- `mg.domains.domainTemplates.listVersions('domainId', 'template_name', queryData)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).GetVersionsPage-fm-8)
1538
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates--template-name--versions)
1539
+
1540
+ `mg.domains.domainTemplates.listVersions('domainId', 'template_name', queryData)`
1410
1541
 
1411
1542
  Example:
1412
1543
 
@@ -1453,7 +1584,9 @@ The following service methods are available to instantiated clients. The example
1453
1584
 
1454
1585
  Retrieve the information and content of the specified version of a template.
1455
1586
 
1456
- `mg.domains.domainTemplates.getVersion('domainId', 'template_name', 'tag')` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).GetVersion-fm-7)
1587
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates--template-name--versions--version-name-)
1588
+
1589
+ `mg.domains.domainTemplates.getVersion('domainId', 'template_name', 'tag')`
1457
1590
 
1458
1591
  Example:
1459
1592
 
@@ -1494,7 +1627,9 @@ The following service methods are available to instantiated clients. The example
1494
1627
  - #### createVersion
1495
1628
  Adds a new template version. If the template doesn’t contain any other versions, the first version becomes active. A template can store up to 40 versions.
1496
1629
 
1497
- `mg.domains.domainTemplates.createVersion('domainId', 'template_name', versionData)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).PostVersion-fm-5)
1630
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/post-v3--domain-name--templates--template-name--versions)
1631
+
1632
+ `mg.domains.domainTemplates.createVersion('domainId', 'template_name', versionData)`
1498
1633
 
1499
1634
  Example:
1500
1635
 
@@ -1556,7 +1691,9 @@ The following service methods are available to instantiated clients. The example
1556
1691
  Update information or content of the specific template version.
1557
1692
  Existing fields not included in the request will not be changed
1558
1693
 
1559
- `mg.domains.domainTemplates.updateVersion('domainId', 'template_name', 'tag' , versionData)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).PutVersion-fm-11)
1694
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/put-v3--domain-name--templates--template-name--versions--version-name-)
1695
+
1696
+ `mg.domains.domainTemplates.updateVersion('domainId', 'template_name', 'tag' , versionData)`
1560
1697
 
1561
1698
  Example:
1562
1699
 
@@ -1601,7 +1738,9 @@ The following service methods are available to instantiated clients. The example
1601
1738
  - #### destroyVersion
1602
1739
  Delete a specific template version.
1603
1740
 
1604
- `mg.domains.domainTemplates.destroyVersion('domainId', 'template_name', 'tag' )` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/#tag/Templates/operation/httpapi.(*TemplateAPIControler).DeleteVersion-fm-14)
1741
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/delete-v3--domain-name--templates--template-name--versions--version-name-)
1742
+
1743
+ `mg.domains.domainTemplates.destroyVersion(domainId, templateName, tag)`
1605
1744
 
1606
1745
  Example:
1607
1746
 
@@ -1616,7 +1755,9 @@ The following service methods are available to instantiated clients. The example
1616
1755
  status: 200,
1617
1756
  message: 'version has been deleted',
1618
1757
  templateName: 'template_name',
1619
- templateVersion: { tag: 'v1' }
1758
+ templateVersion: {
1759
+ tag:'v1'
1760
+ }
1620
1761
  }
1621
1762
  ```
1622
1763
 
@@ -1626,7 +1767,9 @@ The following service methods are available to instantiated clients. The example
1626
1767
 
1627
1768
  Mailgun offers tracking for clicks, unsubscribes, and opens, with optional HTTPS protocol support on tracking URLs. To enable HTTPS, Mailgun uses Let’s Encrypt with HTTP-01 challenges through your existing tracking CNAME record to issue a TLS certificate. This setup also includes support for HTTP Strict Transport Security (HSTS) for enhanced security.
1628
1769
 
1629
- `mg.domains.domainTracking.getTracking(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking)
1770
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/get-v3-domains--name--tracking)
1771
+
1772
+ `mg.domains.domainTracking.getTracking(domainAddress)`
1630
1773
 
1631
1774
  Example:
1632
1775
 
@@ -1662,7 +1805,8 @@ The following service methods are available to instantiated clients. The example
1662
1805
 
1663
1806
  - Open Tracking Example:
1664
1807
 
1665
- [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-open)
1808
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v3-domains--name--tracking-open)
1809
+
1666
1810
  ```js
1667
1811
  mg.domains.domainTracking.updateTracking('foobar.example.com', 'open', {
1668
1812
  active: true,
@@ -1693,7 +1837,7 @@ The following service methods are available to instantiated clients. The example
1693
1837
 
1694
1838
  - Click Tracking Example:
1695
1839
 
1696
- [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-click)
1840
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v3-domains--name--tracking-click)
1697
1841
  ```JS
1698
1842
  mg.domains.domainTracking.updateTracking('foobar.example.com', 'click', {active: true})
1699
1843
  .then(msg => console.log(msg)) // logs response data
@@ -1719,7 +1863,7 @@ The following service methods are available to instantiated clients. The example
1719
1863
 
1720
1864
  - Unsubscribe Tracking Example
1721
1865
 
1722
- [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-unsubscribe)
1866
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v3-domains--name--tracking-unsubscribe)
1723
1867
  ```js
1724
1868
  mg.domains.domainTracking.updateTracking('foobar.example.com', 'unsubscribe', {
1725
1869
  active: true,
@@ -1754,7 +1898,9 @@ The following service methods are available to instantiated clients. The example
1754
1898
  - #### get
1755
1899
  Get x509 TLS certificate and status
1756
1900
 
1757
- `mg.domains.domainTracking.get(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/httpapi.(*HttpAPI).getStatusV2-fm-8)
1901
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/get-v2-x509--domain--status)
1902
+
1903
+ `mg.domains.domainTracking.get(domainAddress)`
1758
1904
 
1759
1905
  Example:
1760
1906
 
@@ -1778,7 +1924,9 @@ The following service methods are available to instantiated clients. The example
1778
1924
  - #### generate
1779
1925
  Initiates generation of a TLS certificate for the tracking domain in a background task. Once generation is enqueued, you may poll the status endpoint in location field to check for success. Domain address must be formatted as `webPrefix.domainName` from domains settings
1780
1926
 
1781
- `mg.domains.domainTracking.generate(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/httpapi.(*HttpAPI).generateStatusV2-fm-8)
1927
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/post-v2-x509--domain-)
1928
+
1929
+ `mg.domains.domainTracking.generate(domainAddress)`
1782
1930
 
1783
1931
  Example:
1784
1932
 
@@ -1801,7 +1949,9 @@ The following service methods are available to instantiated clients. The example
1801
1949
  - #### regenerate
1802
1950
  Initiates regeneration of an expired TLS certificate for the tracking domain in a background task. Once generation is enqueued, you may poll status endpoint in location field to check for success. This will not regenerate an existing certificate that is still valid. Domain address must be formatted as `webPrefix.domainName` from domains settings
1803
1951
 
1804
- `mg.domains.domainTracking.regenerate(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/httpapi.(*HttpAPI).generateStatusV2-fm-8)
1952
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v2-x509--domain-)
1953
+
1954
+ `mg.domains.domainTracking.regenerate(domainAddress)`
1805
1955
 
1806
1956
  Example:
1807
1957
 
@@ -1821,9 +1971,290 @@ The following service methods are available to instantiated clients. The example
1821
1971
  }
1822
1972
  ```
1823
1973
 
1974
+ ### Domain Keys
1975
+
1976
+ - #### list
1977
+ List all domain keys for your domain, including active/inactive and valid/invalid ones.
1978
+
1979
+ `mg.domains.domainKeys.list(domainAddress, data)`
1980
+
1981
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/get-v4-domains--authority-name--keys)
1982
+
1983
+ Example:
1984
+
1985
+ ```JS
1986
+ mg.domains.domainKeys.list(domainAddress)
1987
+ .then(data => console.log(data)) // logs response data
1988
+ .catch(err => console.error(err)); // logs any error
1989
+ ```
1990
+
1991
+ Promise returns:
1992
+
1993
+ ```JS
1994
+ {
1995
+ items: [
1996
+ {
1997
+ signing_domain: 'authority.domain.tld',
1998
+ selector: 's1',
1999
+ dns_record: {
2000
+ is_active: true,
2001
+ cached: [],
2002
+ name: 's1._domainkey.authority.domain.tld',
2003
+ record_type: 'TXT',
2004
+ valid: 'unknown',
2005
+ value: 'expected dns value'
2006
+ }
2007
+ },
2008
+ ],
2009
+ status: 200
2010
+ }
2011
+ ```
2012
+
2013
+ - #### listAll
2014
+ List domain keys, and optionally filter by signing domain or selector. The page & limit data is only required when paging through the data.
2015
+
2016
+ `mg.domains.domainKeys.listAll(filterData)`
2017
+
2018
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/get-v1-dkim-keys)
2019
+
2020
+ Example:
2021
+
2022
+ ```JS
2023
+ mg.domains.domainKeys.listAll(
2024
+ {
2025
+ signingDomain: 'authority.domain.tld', // optional
2026
+ selector: 's1', // optional
2027
+ }
2028
+ )
2029
+ .then(data => console.log(data)) // logs response data
2030
+ .catch(err => console.error(err)); // logs any error
2031
+ ```
2032
+
2033
+ Promise returns:
2034
+
2035
+ ```JS
2036
+ {
2037
+ items: [
2038
+ {
2039
+ signing_domain: 'authority.domain.tld',
2040
+ selector: 's1',
2041
+ dns_record: {
2042
+ is_active: true,
2043
+ cached: [],
2044
+ name: 's1._domainkey.authority.domain.tld',
2045
+ record_type: 'TXT',
2046
+ valid: 'unknown',
2047
+ value: 'expected dns value'
2048
+ }
2049
+ },
2050
+ ],
2051
+ status: 200
2052
+ }
2053
+ ```
2054
+
2055
+ - #### create
2056
+ Create a domain key.
2057
+
2058
+ *Note that once private keys are created or imported they are never exported. Alternatively, you can import an existing PEM file containing a RSA private key in PKCS #1, ASn.1 DER format. Note, the pem can be passed as a file attachment or as a form-string parameter.*
2059
+
2060
+ `mg.domains.domainKeys.create(newKeyData)`
2061
+
2062
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/post-v1-dkim-keys)
2063
+
2064
+ Example:
2065
+
2066
+ ```JS
2067
+ mg.domains.domainKeys.create(
2068
+ {
2069
+ signingDomain: 'authority.domain.tld',
2070
+ selector: 's1',
2071
+ bits: '2048' // optional
2072
+ }
2073
+ )
2074
+ .then(data => console.log(data)) // logs response data
2075
+ .catch(err => console.error(err)); // logs any error
2076
+ ```
2077
+
2078
+ Promise returns:
2079
+
2080
+ ```JS
2081
+ {
2082
+ signing_domain: 'authority.domain.tld',
2083
+ selector: 's1',
2084
+ dns_record: {
2085
+ is_active: true,
2086
+ cached: [],
2087
+ name: 's1._domainkey.authority.domain.tld',
2088
+ record_type: 'TXT',
2089
+ valid: 'unknown',
2090
+ value: 'expected dns value'
2091
+ },
2092
+ status: 200
2093
+ }
2094
+ ```
2095
+
2096
+ - #### activate
2097
+ Activate a key to be used to DKIM sign emails with.
2098
+
2099
+ *Note: dns records must be valid for a domain key to be activated*
2100
+
2101
+ `mg.domains.domainKeys.activate(domainAddress, selector)`
2102
+
2103
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v4-domains--authority-name--keys--selector--activate)
2104
+
2105
+ Example:
2106
+
2107
+ ```JS
2108
+ mg.domains.domainKeys.activate('authority.domain.tld', 's1')
2109
+ .then(data => console.log(data)) // logs response data
2110
+ .catch(err => console.error(err)); // logs any error
2111
+ ```
2112
+
2113
+ Promise returns:
2114
+
2115
+ ```JS
2116
+ {
2117
+ message: 'domain key activated',
2118
+ authority: 'authority.domain.tld',
2119
+ selector: 's1',
2120
+ active: true,
2121
+ status: 200,
2122
+ }
2123
+ ```
2124
+
2125
+ - #### deactivate
2126
+ Deactivating for a specified authority and/or selector means a key won't be used for signing email anymore, even if they are valid.
2127
+
2128
+ `mg.domains.domainKeys.deactivate(domainAddress, selector)`
2129
+
2130
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v4-domains--authority-name--keys--selector--deactivate)
2131
+
2132
+ Example:
2133
+
2134
+ ```JS
2135
+ mg.domains.domainKeys.deactivate('authority.domain.tld', 's1')
2136
+ .then(data => console.log(data)) // logs response data
2137
+ .catch(err => console.error(err)); // logs any error
2138
+ ```
2139
+
2140
+ Promise returns:
2141
+
2142
+ ```JS
2143
+ {
2144
+ message: 'domain key deactivated',
2145
+ authority: 'authority.domain.tld',
2146
+ selector: 's1',
2147
+ active: true,
2148
+ status: 200,
2149
+ }
2150
+ ```
2151
+
2152
+ - #### destroy
2153
+ Delete a key.
2154
+
2155
+ **Domain keys are not recoverable after deletion so use with care**
2156
+
2157
+ `mg.domains.domainKeys.destroy(domainAddress, selector)`
2158
+
2159
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/delete-v1-dkim-keys)
2160
+
2161
+ Example:
2162
+
2163
+ ```JS
2164
+ mg.domains.domainKeys.destroy('authority.domain.tld', 's1')
2165
+ .then(data => console.log(data)) // logs response data
2166
+ .catch(err => console.error(err)); // logs any error
2167
+ ```
2168
+
2169
+ Promise returns:
2170
+
2171
+ ```JS
2172
+ {
2173
+ message: 'success'
2174
+ }
2175
+ ```
2176
+
2177
+ - #### updateDKIMAuthority
2178
+ You can delegate the domain authority to an other domain. Domain's authority is set to itself by default.
2179
+
2180
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v3-domains--name--dkim-authority)
2181
+
2182
+ `mg.domains.domainKeys.updateDKIMAuthority(domainAddress, data)`
2183
+
2184
+ Example:
2185
+
2186
+ ```JS
2187
+ mg.domains.domainKeys.updateDKIMAuthority(domainAddress, {
2188
+ self: true
2189
+ })
2190
+ .then(data => console.log(data)) // logs response data
2191
+ .catch(err => console.error(err)); // logs any error
2192
+ ```
2193
+
2194
+ Data object accepts next properties:
2195
+
2196
+ | Property | Description |
2197
+ |:--------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
2198
+ | self | Change the DKIM authority for a domain. If set to true, the domain will be the DKIM authority for itself even if the root domain is registered on the same mailgun account If set to false, the domain will have the same DKIM authority as the root domain registered on the same mailgun account |
2199
+
2200
+ Promise returns:
2201
+
2202
+ ```JS
2203
+ {
2204
+ message: 'Domain DKIM authority has been changed',
2205
+ sending_dns_records: [
2206
+ {
2207
+ is_active: true,
2208
+ cached: [],
2209
+ name: 'sending_dns_record_name',
2210
+ record_type: 'TXT',
2211
+ valid: 'unknown',
2212
+ value: 'sending_dns_record_value'
2213
+ },
2214
+ ...
2215
+ ],
2216
+ changed: true
2217
+ }
2218
+ ```
2219
+
2220
+ - #### updateDKIMSelector
2221
+ Selector is the unique identifier of your key. It has to be different from other keys selector.
2222
+
2223
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v3-domains--name--dkim-selector)
2224
+
2225
+ `mg.domains.domainKeys.updateDKIMSelector(domainAddress, data)`
2226
+
2227
+ Example:
2228
+
2229
+ ```JS
2230
+ mg.domains.domainKeys.updateDKIMSelector(domainAddress, {
2231
+ dkimSelector: 'dkimSelector_value'
2232
+ })
2233
+ .then(data => console.log(data)) // logs response data
2234
+ .catch(err => console.error(err)); // logs any error
2235
+ ```
2236
+
2237
+ Data object accepts next properties:
2238
+
2239
+ | Property | Description |
2240
+ |:--------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
2241
+ | dkimSelector | Selector is the unique identifier of your key. It has to be different from other keys selector. |
2242
+
2243
+ Promise returns:
2244
+
2245
+ ```JS
2246
+ {
2247
+ message: 'DKIM selector changed',
2248
+ status: 200
2249
+ }
2250
+ ```
2251
+
1824
2252
  ### Events
1825
2253
 
1826
2254
  - #### get
2255
+ ***Deprecated, and will be removed in the future releases***
2256
+
2257
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/events)
1827
2258
 
1828
2259
  `mg.events.get(domain, data)`
1829
2260
 
@@ -1847,7 +2278,7 @@ The following service methods are available to instantiated clients. The example
1847
2278
  | end | The end of the search time range. It can be specified as a string (see Date Format) or linux epoch seconds. Refer to Time Range for details. |
1848
2279
  | ascending | Defines the direction of the search time range if the range end time is not specified. Can be either yes or no. Refer to Time Range for details. |
1849
2280
  | limit | Number of entries to return. (300 max) |
1850
- | **field** | **field** is the name of the *[Filter Field](https://documentation.mailgun.com/en/latest/api-events.html#filter-field)*. The value of the parameter should be a valid Filter Expression. Several field filters can be specified in one request. If the same field is mentioned, more then once, then all its filter expressions are combined with AND operator. |
2281
+ | **field** | **field** is the name of the *[Filter Field](https://mailgun-docs.redoc.ly/docs/mailgun/user-manual/events/#filter-field)*. The value of the parameter should be a valid Filter Expression. Several field filters can be specified in one request. If the same field is mentioned, more then once, then all its filter expressions are combined with AND operator. |
1851
2282
  - #### Example with Date and *Filter field*
1852
2283
  ```js
1853
2284
  const date = new Date(2023, 7, 2, 0, 0, 0, 0); // Wed Aug 02 2023 00:00:00 GMT+0300
@@ -1858,6 +2289,7 @@ The following service methods are available to instantiated clients. The example
1858
2289
  event: 'delivered'
1859
2290
  });
1860
2291
  ```
2292
+
1861
2293
  Promise returns: items (array of event objects), pages (paging keys grouped by id)
1862
2294
 
1863
2295
  ```JS
@@ -1878,8 +2310,11 @@ The following service methods are available to instantiated clients. The example
1878
2310
  ```
1879
2311
 
1880
2312
  ### Stats
1881
- - #### Stats Options
2313
+ ***Deprecated, and will be removed in the future releases***
2314
+
2315
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/stats)
1882
2316
 
2317
+ - #### Stats Options
1883
2318
  | Parameter | Description |
1884
2319
  |:-----------|:---------------------------------------------------------------------------------------------------------------------------|
1885
2320
  | event | The type of the event. For a complete list of all events written to the log see the `Event Types` table below. (Required) |
@@ -1915,6 +2350,8 @@ The following service methods are available to instantiated clients. The example
1915
2350
 
1916
2351
  - #### getDomain
1917
2352
 
2353
+ [API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/openapi-final/tag/Stats/#tag/Stats/operation/GET-v3--domain--stats-total)
2354
+
1918
2355
  `mg.stats.getDomain(domain, query)`
1919
2356
 
1920
2357
  Example:
@@ -1940,6 +2377,7 @@ The following service methods are available to instantiated clients. The example
1940
2377
  ```
1941
2378
 
1942
2379
  - #### getAccount
2380
+ [API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/openapi-final/tag/Stats/#tag/Stats/operation/GET-v3-stats-total)
1943
2381
 
1944
2382
  `mg.stats.getDomain(domain, query)`
1945
2383
 
@@ -1969,11 +2407,13 @@ The following service methods are available to instantiated clients. The example
1969
2407
  ```
1970
2408
 
1971
2409
  ### Metrics
1972
- Mailgun collects many different events and generates event metrics which are available in your Control Panel. This data is also available via our analytics metrics [API endpoint](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Metrics/#tag/Metrics).
2410
+ Mailgun collects many different events and generates event metrics which are available in your Control Panel. This data is also available via our analytics metrics [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/metrics).
1973
2411
 
1974
2412
  - #### getAccount
1975
2413
  Gets filtered metrics for an account
1976
2414
 
2415
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/metrics/post-v1-analytics-metrics)
2416
+
1977
2417
  `mg.metrics.getAccount(MetricsQuery);`
1978
2418
 
1979
2419
  Example:
@@ -2007,7 +2447,7 @@ The following service methods are available to instantiated clients. The example
2007
2447
  | duration | String | A duration in the format of '1d' '2h' '2m'. If duration is provided then it is calculated from the end date and overwrites the start date.|
2008
2448
  | dimensions | Array of strings | Attributes of the metric data such as 'subaccount'.|
2009
2449
  | metrics | Array of strings | Name of the metrics to receive the stats for such as 'processed_count'.|
2010
- | filter | object | Filters to apply to the query. The 'AND' property is required and should contains array of filters objects. See this [document](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Metrics/#tag/Metrics/operation/api.(*MetricsAPI).PostMetricQuery-fm-3!path=filter&t=request) for an object shape. |
2450
+ | filter | object | Filters to apply to the query. The 'AND' property is required and should contains array of filters objects. See this [document](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/metrics/post-v1-analytics-metrics#metrics/post-v1-analytics-metrics/t=request&path=filter) for an object shape. |
2011
2451
  | include_subaccounts | Boolean | Include stats from all subaccounts. |
2012
2452
  | include_aggregates | Boolean | Include top-level aggregate metrics.|
2013
2453
 
@@ -2040,6 +2480,9 @@ The following service methods are available to instantiated clients. The example
2040
2480
 
2041
2481
  - #### getAccountUsage
2042
2482
  Gets filtered **usage metrics** for an account
2483
+
2484
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/metrics/post-v1-analytics-usage-metrics)
2485
+
2043
2486
  `mg.metrics.getAccountUsage(MetricsQuery);`
2044
2487
 
2045
2488
  Example:
@@ -2073,7 +2516,7 @@ The following service methods are available to instantiated clients. The example
2073
2516
  | duration | String | A duration in the format of '1d' '2h' '2m'. If duration is provided then it is calculated from the end date and overwrites the start date.|
2074
2517
  | dimensions | Array of strings | Attributes of the metric data such as 'subaccount'.|
2075
2518
  | metrics | Array of strings | Name of the metrics to receive the stats for such as 'processed_count'.|
2076
- | filter | object | Filters to apply to the query. The 'AND' property is required and should contains array of filters objects. See this [document](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Metrics/#tag/Metrics/operation/api.(*MetricsAPI).PostMetricQuery-fm-3!path=filter&t=request) for an object shape. |
2519
+ | filter | object | Filters to apply to the query. The 'AND' property is required and should contains array of filters objects. See this [document](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/metrics/post-v1-analytics-metrics#metrics/post-v1-analytics-metrics/t=request&path=filter) for an object shape. |
2077
2520
  | include_subaccounts | Boolean | Include stats from all subaccounts. |
2078
2521
  | include_aggregates | Boolean | Include top-level aggregate metrics.|
2079
2522
 
@@ -2111,7 +2554,7 @@ The following service methods are available to instantiated clients. The example
2111
2554
  `mg.suppressions.list(domain, suppressionType, query?)`
2112
2555
 
2113
2556
  - #### Bounces Example:
2114
-
2557
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/get-v3--domainid--bounces)
2115
2558
  ```js
2116
2559
  mg.suppressions.list('foobar.example.com', 'bounces')
2117
2560
  .then(msg => console.log(msg)) // logs response data
@@ -2119,7 +2562,7 @@ The following service methods are available to instantiated clients. The example
2119
2562
  ```
2120
2563
 
2121
2564
  - #### Unsubscribes Example:
2122
-
2565
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/get-v3--domainid--unsubscribes)
2123
2566
  ```js
2124
2567
  mg.suppressions.list('foobar.example.com', 'unsubscribes')
2125
2568
  .then(msg => console.log(msg)) // logs response data
@@ -2128,6 +2571,8 @@ The following service methods are available to instantiated clients. The example
2128
2571
 
2129
2572
  - #### Complaints Example:
2130
2573
 
2574
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/get-v3--domainid--complaints)
2575
+
2131
2576
  ```js
2132
2577
  mg.suppressions.list('foobar.example.com', 'complaints')
2133
2578
  .then(msg => console.log(msg)) // logs response data
@@ -2160,7 +2605,7 @@ The following service methods are available to instantiated clients. The example
2160
2605
  `mg.suppressions.get(domain, suppressionType, address)`
2161
2606
 
2162
2607
  - #### Bounces Example:
2163
-
2608
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/get-v3--domainid--bounces--address-)
2164
2609
  ```js
2165
2610
  mg.suppressions.get('foobar.example.com', 'bounces', 'address@example.com')
2166
2611
  .then(msg => console.log(msg)) // logs response data
@@ -2168,6 +2613,7 @@ The following service methods are available to instantiated clients. The example
2168
2613
  ```
2169
2614
 
2170
2615
  - #### Unsubscribes Example:
2616
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/get-v3--domainid--unsubscribes--address-)
2171
2617
 
2172
2618
  ```js
2173
2619
  mg.suppressions.get('foobar.example.com', 'unsubscribes', 'address@example.com')
@@ -2177,6 +2623,8 @@ The following service methods are available to instantiated clients. The example
2177
2623
 
2178
2624
  - #### Complaints Example:
2179
2625
 
2626
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/get-v3--domainid--complaints--address-)
2627
+
2180
2628
  ```js
2181
2629
  mg.suppressions.get('foobar.example.com', 'complaints', 'address@example.com')
2182
2630
  .then(msg => console.log(msg)) // logs response data
@@ -2198,6 +2646,8 @@ The following service methods are available to instantiated clients. The example
2198
2646
  `mg.suppressions.create(domain, suppressionType, data || data[])`
2199
2647
 
2200
2648
  - #### Bounces Example:
2649
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/post-v3--domainid--bounces)
2650
+
2201
2651
  ```JS
2202
2652
  mg.suppressions.create('foobar.example.com', 'bounces', [{address: 'bob@example.com'}])
2203
2653
  .then(msg => console.log(msg)) // logs response data
@@ -2222,7 +2672,7 @@ The following service methods are available to instantiated clients. The example
2222
2672
  ```
2223
2673
 
2224
2674
  - #### Unsubscribes Example:
2225
-
2675
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/post-v3--domainid--unsubscribes)
2226
2676
  ```js
2227
2677
  mg.suppressions.create('foobar.example.com', 'unsubscribes', {address: 'bob@example.com'})
2228
2678
  .then(msg => console.log(msg)) // logs response data
@@ -2273,8 +2723,8 @@ The following service methods are available to instantiated clients. The example
2273
2723
  ```
2274
2724
 
2275
2725
  - #### Complaints Example:
2276
-
2277
- ```js
2726
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/post-v3--domainid--complaints)
2727
+ ```JS
2278
2728
  mg.suppressions.create('foobar.example.com', 'complaints', [{address: 'bob@example.com'}])
2279
2729
  .then(msg => console.log(msg)) // logs response data
2280
2730
  .catch(err => console.error(err)); // logs any error
@@ -2299,7 +2749,7 @@ The following service methods are available to instantiated clients. The example
2299
2749
  `mg.suppressions.destroy(domain, suppressionType, address)`
2300
2750
 
2301
2751
  - #### Bounces Example:
2302
-
2752
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/delete-v3--domainid--bounces--address-)
2303
2753
  ```JS
2304
2754
  mg.suppressions.destroy('foobar.example.com', 'bounces', 'bob@example.com')
2305
2755
  .then(msg => console.log(msg)) // logs response data
@@ -2318,7 +2768,7 @@ The following service methods are available to instantiated clients. The example
2318
2768
  ```
2319
2769
 
2320
2770
  - #### Unsubscribes Example:
2321
-
2771
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/delete-v3--domainid--unsubscribes--address-)
2322
2772
  ```js
2323
2773
  mg.suppressions.destroy('foobar.example.com', 'unsubscribes', 'bob@example.com')
2324
2774
  .then(msg => console.log(msg)) // logs response data
@@ -2337,7 +2787,7 @@ The following service methods are available to instantiated clients. The example
2337
2787
  ```
2338
2788
 
2339
2789
  - #### Complaints Example:
2340
-
2790
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/delete-v3--domainid--complaints--address-)
2341
2791
  ```js
2342
2792
  mg.suppressions.destroy('foobar.example.com', 'complaints', 'bob@example.com')
2343
2793
  .then(msg => console.log(msg)) // logs response data
@@ -2357,6 +2807,7 @@ The following service methods are available to instantiated clients. The example
2357
2807
  ### Webhooks
2358
2808
 
2359
2809
  - #### list
2810
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/get-v3-domains--domain--webhooks)
2360
2811
 
2361
2812
  `mg.webhooks.list(domain, query)`
2362
2813
 
@@ -2385,6 +2836,7 @@ The following service methods are available to instantiated clients. The example
2385
2836
  ```
2386
2837
 
2387
2838
  - #### get
2839
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/get-v3-domains--domain-name--webhooks--webhook-name-)
2388
2840
 
2389
2841
  `mg.webhooks.get(domain, id)`
2390
2842
 
@@ -2405,6 +2857,7 @@ The following service methods are available to instantiated clients. The example
2405
2857
  ```
2406
2858
 
2407
2859
  - #### create
2860
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/post-v3-domains--domain--webhooks)
2408
2861
 
2409
2862
  `mg.webhooks.create(domain, id, data, test)`
2410
2863
 
@@ -2442,6 +2895,7 @@ The following service methods are available to instantiated clients. The example
2442
2895
  ```
2443
2896
 
2444
2897
  - #### update
2898
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/put-v3-domains--domain-name--webhooks--webhook-name-)
2445
2899
 
2446
2900
  `mg.webhooks.update(domain, id, url, test)`
2447
2901
 
@@ -2476,6 +2930,7 @@ The following service methods are available to instantiated clients. The example
2476
2930
 
2477
2931
 
2478
2932
  - #### destroy
2933
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/delete-v3-domains--domain-name--webhooks--webhook-name-)
2479
2934
 
2480
2935
  `mg.webhooks.destroy(domain, id)`
2481
2936
 
@@ -2498,6 +2953,7 @@ The following service methods are available to instantiated clients. The example
2498
2953
  ### Routes
2499
2954
 
2500
2955
  - #### list
2956
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/get-v3-routes)
2501
2957
 
2502
2958
  `mg.routes.list(query)`
2503
2959
 
@@ -2525,6 +2981,7 @@ The following service methods are available to instantiated clients. The example
2525
2981
  ```
2526
2982
 
2527
2983
  - #### get
2984
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/get-v3-routes-id)
2528
2985
 
2529
2986
  `mg.routes.get(id)`
2530
2987
 
@@ -2550,6 +3007,7 @@ The following service methods are available to instantiated clients. The example
2550
3007
  ```
2551
3008
 
2552
3009
  - #### create
3010
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/post-v3-routes)
2553
3011
 
2554
3012
  `mg.routes.create(options)`
2555
3013
 
@@ -2580,6 +3038,7 @@ The following service methods are available to instantiated clients. The example
2580
3038
  ```
2581
3039
 
2582
3040
  - #### update
3041
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/put-v3-routes-id)
2583
3042
 
2584
3043
  `mg.routes.update(id, options)`
2585
3044
 
@@ -2611,6 +3070,7 @@ The following service methods are available to instantiated clients. The example
2611
3070
  ```
2612
3071
 
2613
3072
  - #### destroy
3073
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/delete-v3-routes-id)
2614
3074
 
2615
3075
  `mg.routes.destroy(id)`
2616
3076
 
@@ -2634,6 +3094,7 @@ The following service methods are available to instantiated clients. The example
2634
3094
  ### Validation
2635
3095
 
2636
3096
  - #### get
3097
+ [API Reference](https://documentation.mailgun.com/docs/validate/single-valid-ir)
2637
3098
 
2638
3099
  `mg.validate.get(address)`
2639
3100
 
@@ -2661,7 +3122,8 @@ The following service methods are available to instantiated clients. The example
2661
3122
  ```
2662
3123
 
2663
3124
  ### Multiple validation
2664
- https://documentation.mailgun.com/en/latest/api-email-validation.html#email-validation
3125
+ [API Reference](https://documentation.mailgun.com/docs/validate/bulk-valid-ir)
3126
+
2665
3127
  - #### create
2666
3128
  `mg.validate.multipleValidation.create('name_of_the_list', { file })`
2667
3129
 
@@ -2800,6 +3262,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
2800
3262
  A client to manage mailing lists.
2801
3263
 
2802
3264
  - #### list
3265
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-v3-lists)
2803
3266
 
2804
3267
  `mg.lists.list()`
2805
3268
 
@@ -2828,6 +3291,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
2828
3291
  ```
2829
3292
 
2830
3293
  - #### get
3294
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-v3-lists-address)
2831
3295
 
2832
3296
  `mg.lists.get(mailListAddress)`
2833
3297
 
@@ -2854,6 +3318,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
2854
3318
  ```
2855
3319
 
2856
3320
  - #### create
3321
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/post-v3-lists)
2857
3322
 
2858
3323
  `mg.lists.create(data)`
2859
3324
 
@@ -2886,6 +3351,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
2886
3351
  ```
2887
3352
 
2888
3353
  - #### update
3354
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/put-v3-lists-address)
2889
3355
 
2890
3356
  `mg.lists.update(mailListAddress)`
2891
3357
 
@@ -2918,6 +3384,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
2918
3384
  ```
2919
3385
 
2920
3386
  - #### destroy
3387
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/delete-v3-lists-address)
2921
3388
 
2922
3389
  `mg.lists.destroy(mailListAddress)`
2923
3390
 
@@ -2939,9 +3406,10 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
2939
3406
  ```
2940
3407
 
2941
3408
  ### Mailing list members
2942
- A client to manage members within a specific mailing list.
3409
+ A client to manage members within a specific mailing list.
2943
3410
 
2944
3411
  - #### listMembers
3412
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-lists-string:list_address-members)
2945
3413
 
2946
3414
  `mg.lists.members.listMembers(mailListAddress)`
2947
3415
 
@@ -2967,6 +3435,8 @@ A client to manage members within a specific mailing list.
2967
3435
  ```
2968
3436
 
2969
3437
  - #### getMember
3438
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-lists-list_address-members-member_address)
3439
+
2970
3440
  `mg.lists.members.getMember(mailListAddress, mailListMemberAddress)`
2971
3441
 
2972
3442
  Example:
@@ -2989,6 +3459,8 @@ A client to manage members within a specific mailing list.
2989
3459
  ```
2990
3460
 
2991
3461
  - #### createMember
3462
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/post-lists-string:list_address-members)
3463
+
2992
3464
  `mg.lists.members.createMember(mailListAddress, data)`
2993
3465
 
2994
3466
  Example:
@@ -3017,6 +3489,7 @@ A client to manage members within a specific mailing list.
3017
3489
  ```
3018
3490
 
3019
3491
  - #### createMembers
3492
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/post-lists-list_address-members.json)
3020
3493
  `mg.lists.members.createMembers(mailListAddress, data)`
3021
3494
 
3022
3495
  Example:
@@ -3062,6 +3535,7 @@ A client to manage members within a specific mailing list.
3062
3535
  ```
3063
3536
 
3064
3537
  - #### updateMember
3538
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/put-lists-list_address-members-member_address)
3065
3539
 
3066
3540
  `mg.lists.members.updateMember(mailListAddress, mailListMemberAddress, data)`
3067
3541
 
@@ -3090,6 +3564,7 @@ A client to manage members within a specific mailing list.
3090
3564
  ```
3091
3565
 
3092
3566
  - #### destroyMember
3567
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/delete-lists-list_address-members-member_address)
3093
3568
 
3094
3569
  `mg.lists.members.destroyMember(mailListAddress, mailListMemberAddress)`
3095
3570
 
@@ -3109,13 +3584,15 @@ A client to manage members within a specific mailing list.
3109
3584
  message: 'Mailing list member has been deleted'
3110
3585
  }
3111
3586
  ```
3587
+
3112
3588
  ### Subaccounts
3113
3589
 
3114
3590
  A client to manage subaccounts.
3115
3591
 
3116
3592
  - #### list
3593
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/get-v5-accounts-subaccounts)
3117
3594
 
3118
- `mg.subaccounts.list(query)` - [api docs](https://documentation.mailgun.com/en/latest/subaccounts.html)
3595
+ `mg.subaccounts.list(query)`
3119
3596
 
3120
3597
  Example:
3121
3598
 
@@ -3144,6 +3621,7 @@ A client to manage members within a specific mailing list.
3144
3621
  | enabled | Returns all enabled/disabled subaccounts. (Defaults to all if omitted) |
3145
3622
 
3146
3623
  - #### get
3624
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/get-v5-accounts-subaccounts-subaccount_id)
3147
3625
 
3148
3626
  `mg.subaccounts.get(subaccount_id)`
3149
3627
 
@@ -3162,6 +3640,7 @@ A client to manage members within a specific mailing list.
3162
3640
  ```
3163
3641
 
3164
3642
  - #### create
3643
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/post-v5-accounts-subaccounts)
3165
3644
 
3166
3645
  `mg.subaccounts.create(name)`
3167
3646
 
@@ -3186,6 +3665,7 @@ A client to manage members within a specific mailing list.
3186
3665
  | name | Name of the subaccount being created (ex. 'mysubaccount') |
3187
3666
 
3188
3667
  - #### enable
3668
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/post-v5-accounts-subaccounts-subaccount_id-enable)
3189
3669
 
3190
3670
  `mg.subaccounts.enable(subaccount_id)`
3191
3671
 
@@ -3203,6 +3683,7 @@ A client to manage members within a specific mailing list.
3203
3683
  ```
3204
3684
 
3205
3685
  - #### disable
3686
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/post-v5-accounts-subaccounts-subaccount_id-disable)
3206
3687
 
3207
3688
  `mg.subaccounts.disable(subaccount_id)`
3208
3689
 
@@ -3220,6 +3701,7 @@ A client to manage members within a specific mailing list.
3220
3701
  ```
3221
3702
 
3222
3703
  - #### destroy
3704
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/delete-v5-accounts-subaccounts-subaccount_id)
3223
3705
 
3224
3706
  `mg.subaccounts.destroy(subaccount_id)`
3225
3707
 
@@ -3237,8 +3719,9 @@ A client to manage members within a specific mailing list.
3237
3719
  ```
3238
3720
 
3239
3721
  - #### setMonthlySendingLimit
3722
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/put-v5-accounts-subaccounts-subaccount_id-limit-custom-monthly)
3240
3723
 
3241
- `mg.subaccounts.setMonthlySendingLimit(subaccount_id, limit)`
3724
+ `mg.subaccounts.setMonthlySendingLimit(subaccount_id, limit)`
3242
3725
 
3243
3726
  Example:
3244
3727
 
@@ -3254,6 +3737,7 @@ A client to manage members within a specific mailing list.
3254
3737
  ```
3255
3738
 
3256
3739
  - #### getMonthlySendingLimit
3740
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/get-v5-accounts-subaccounts-subaccount_id-limit-custom-monthly)
3257
3741
 
3258
3742
  `mg.subaccounts.getMonthlySendingLimit(subaccount_id)`
3259
3743
 
@@ -3271,6 +3755,8 @@ A client to manage members within a specific mailing list.
3271
3755
  ```
3272
3756
 
3273
3757
  - #### updateSubaccountFeature
3758
+ [API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/put-v5-accounts-subaccounts-subaccount_id-features)
3759
+
3274
3760
  `mg.subaccounts.updateSubaccountFeature(subaccount_id, featuresValues)`
3275
3761
 
3276
3762
  Example:
@@ -3302,9 +3788,12 @@ A client to manage members within a specific mailing list.
3302
3788
 
3303
3789
  ### Inbox Placements
3304
3790
  A client to allows you to see the likely deliverability of your email campaigns.
3791
+
3305
3792
  - #### SeedsLists
3306
3793
 
3307
3794
  - #### list
3795
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists)
3796
+
3308
3797
  `mg.inboxPlacements.seedsLists.list()`
3309
3798
 
3310
3799
  Example:
@@ -3398,6 +3887,8 @@ A client to manage members within a specific mailing list.
3398
3887
  ```
3399
3888
 
3400
3889
  - #### get
3890
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists--address-)
3891
+
3401
3892
  `mg.inboxPlacements.seedsLists.get(seedsListId)`
3402
3893
 
3403
3894
  Example:
@@ -3480,6 +3971,8 @@ A client to manage members within a specific mailing list.
3480
3971
  ```
3481
3972
 
3482
3973
  - #### create
3974
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/post-v4-inbox-seedlists)
3975
+
3483
3976
  ```js
3484
3977
  mg.inboxPlacements.seedsLists.create({
3485
3978
  name: 'seedLists name',
@@ -3541,6 +4034,7 @@ A client to manage members within a specific mailing list.
3541
4034
  ```
3542
4035
 
3543
4036
  - #### update
4037
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/put-v4-inbox-seedlists--address-)
3544
4038
 
3545
4039
  ```JS
3546
4040
  mg.inboxPlacements.seedsLists.update(seedsListId,{
@@ -3602,6 +4096,8 @@ A client to manage members within a specific mailing list.
3602
4096
  ```
3603
4097
 
3604
4098
  - #### destroy
4099
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/delete-v4-inbox-seedlists--address-)
4100
+
3605
4101
  ```js
3606
4102
  mg.inboxPlacements.seedsLists.destroy(seedsListId)
3607
4103
  ```
@@ -3625,6 +4121,9 @@ A client to manage members within a specific mailing list.
3625
4121
  - #### Attributes
3626
4122
 
3627
4123
  - #### list
4124
+
4125
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists-a)
4126
+
3628
4127
  `mg.inboxPlacements.seedsLists.attributes.list()`
3629
4128
 
3630
4129
  Example:
@@ -3646,7 +4145,9 @@ A client to manage members within a specific mailing list.
3646
4145
  ```
3647
4146
 
3648
4147
  - #### get
3649
- `mg.inboxPlacements.attributes.get('attribute_name');`
4148
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists-a--attribute-)
4149
+
4150
+ `mg.inboxPlacements.seedsLists.attributes.get('attribute_name');`
3650
4151
 
3651
4152
  Example:
3652
4153
  ```JS
@@ -3668,6 +4169,8 @@ A client to manage members within a specific mailing list.
3668
4169
  - #### Filters
3669
4170
 
3670
4171
  - #### list
4172
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists--filters)
4173
+
3671
4174
  `mg.inboxPlacements.seedsLists.filters.list()`
3672
4175
 
3673
4176
  Example:
@@ -3695,6 +4198,8 @@ A client to manage members within a specific mailing list.
3695
4198
  - #### Providers
3696
4199
 
3697
4200
  - #### list
4201
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-providers)
4202
+
3698
4203
  List all available email providers.
3699
4204
 
3700
4205
  `mg.inboxPlacements.providers.list()`
@@ -3725,6 +4230,8 @@ A client to manage members within a specific mailing list.
3725
4230
  - #### Results
3726
4231
 
3727
4232
  - #### list
4233
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results)
4234
+
3728
4235
  Get the details for all placement test results.
3729
4236
 
3730
4237
  ```js
@@ -3856,6 +4363,9 @@ A client to manage members within a specific mailing list.
3856
4363
 
3857
4364
  Get the details for a single result.
3858
4365
 
4366
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results--result-)
4367
+
4368
+
3859
4369
  `mg.inboxPlacements.results.get(IBPResultId)`
3860
4370
 
3861
4371
  Example:
@@ -3958,6 +4468,8 @@ A client to manage members within a specific mailing list.
3958
4468
  ```
3959
4469
 
3960
4470
  - #### destroy
4471
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/delete-v4-inbox-results--result-)
4472
+
3961
4473
  Delete the result and all associated information.
3962
4474
 
3963
4475
  `mg.inboxPlacements.results.destroy(IBPResultId)`
@@ -3980,6 +4492,9 @@ A client to manage members within a specific mailing list.
3980
4492
 
3981
4493
  - #### getResultByShareId
3982
4494
  Get a result by the share ID.
4495
+
4496
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-sharing-public--shareid-)
4497
+
3983
4498
  ```js
3984
4499
  mg.inboxPlacements.results.getResultByShareId('result_sharing_id')
3985
4500
  ```
@@ -4086,6 +4601,8 @@ A client to manage members within a specific mailing list.
4086
4601
  - #### Attributes
4087
4602
 
4088
4603
  - #### list
4604
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results-a)
4605
+
4089
4606
  `mg.inboxPlacements.results.attributes.list()`
4090
4607
 
4091
4608
  Example:
@@ -4107,6 +4624,8 @@ A client to manage members within a specific mailing list.
4107
4624
  ```
4108
4625
 
4109
4626
  - #### get
4627
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results-a--attribute-)
4628
+
4110
4629
  `mg.inboxPlacements.attributes.get('attribute_name');`
4111
4630
 
4112
4631
  Example:
@@ -4129,6 +4648,8 @@ A client to manage members within a specific mailing list.
4129
4648
  - #### Filters
4130
4649
 
4131
4650
  - #### list
4651
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results--filters)
4652
+
4132
4653
  `mg.inboxPlacements.results.filters.list()`
4133
4654
 
4134
4655
  Example:
@@ -4157,6 +4678,8 @@ A client to manage members within a specific mailing list.
4157
4678
  - #### get
4158
4679
  The sharing status of a result.
4159
4680
 
4681
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-sharing--result-)
4682
+
4160
4683
  `mg.inboxPlacements.results.sharing.get('result_id');`
4161
4684
  Example:
4162
4685
  ```JS
@@ -4179,6 +4702,8 @@ A client to manage members within a specific mailing list.
4179
4702
  - #### update
4180
4703
  Change the sharing status of a result or create a new share URL
4181
4704
 
4705
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/put-v4-inbox-sharing--result-)
4706
+
4182
4707
  `mg.inboxPlacements.results.sharing.update('result_id', IPRSharingUpdateData);`
4183
4708
 
4184
4709
  Example:
@@ -4207,6 +4732,8 @@ A client to manage members within a specific mailing list.
4207
4732
 
4208
4733
  'variables' are Template variables, which could be used in html or template. You can use next recipient variables inside Template variables, which will be filled for every seed automatically: %recipient.first_name%, %recipient.last_name%.
4209
4734
 
4735
+ [API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/post-v4-inbox-tests)
4736
+
4210
4737
  `mg.inboxPlacements.runTest(InboxPlacementsData);`
4211
4738
 
4212
4739
  Example: