mailgun.js 12.3.0 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AMD/definitions.amd.js +1 -1
- package/AMD/mailgun.amd.js +2 -2
- package/CHANGELOG.md +34 -0
- package/CJS/definitions.cjs +1 -1
- package/CJS/mailgun.node.cjs +2 -2
- package/ESM/definitions.browser.js +1 -1
- package/ESM/definitions.node.js +1 -1
- package/ESM/mailgun.browser.js +2 -2
- package/ESM/mailgun.node.js +2 -2
- package/README.md +340 -91
- package/Types/Classes/Events.d.ts +3 -2
- package/Types/Classes/Logs/LogsClient.d.ts +12 -0
- package/Types/Classes/MailgunClient.d.ts +2 -0
- package/Types/Interfaces/Logs/ILogsClient.d.ts +4 -0
- package/Types/Interfaces/Logs/index.d.ts +1 -0
- package/Types/Interfaces/MailgunClient/IMailgunClient.d.ts +2 -0
- package/Types/Types/Common/RequestOptions.d.ts +2 -1
- package/Types/Types/Logs/Logs.d.ts +172 -0
- package/Types/Types/Logs/index.d.ts +1 -0
- package/Types/index.js +96 -1
- package/package.json +1 -1
- package/version.md +1 -1
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/
|
|
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
|
-
```
|
|
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
|
|
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/
|
|
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'
|
|
@@ -259,6 +259,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
259
259
|
- [events](#events)
|
|
260
260
|
- [get](#get-3)
|
|
261
261
|
- [Example with Date and *Filter field*](#example-with-date-and-filter-field)
|
|
262
|
+
- [logs](#logs)
|
|
263
|
+
- [get](#get-4)
|
|
262
264
|
- [stats](#stats)
|
|
263
265
|
- [Stats Options](#stats-options)
|
|
264
266
|
- [getDomain](#getdomain)
|
|
@@ -271,7 +273,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
271
273
|
- [Bounces Example](#bounces-example)
|
|
272
274
|
- [Unsubscribes Example](#unsubscribes-example)
|
|
273
275
|
- [Complaints Example](#complaints-example)
|
|
274
|
-
- [get](#get-
|
|
276
|
+
- [get](#get-5)
|
|
275
277
|
- [Bounces Example](#bounces-example-1)
|
|
276
278
|
- [Unsubscribes Example](#unsubscribes-example-1)
|
|
277
279
|
- [Complaints Example](#complaints-example-1)
|
|
@@ -287,26 +289,26 @@ The following service methods are available to instantiated clients. The example
|
|
|
287
289
|
- [Complaints Example](#complaints-example-3)
|
|
288
290
|
- [webhooks](#webhooks)
|
|
289
291
|
- [list](#list-4)
|
|
290
|
-
- [get](#get-
|
|
292
|
+
- [get](#get-6)
|
|
291
293
|
- [create](#create-5)
|
|
292
294
|
- [update](#update-2)
|
|
293
295
|
- [destroy](#destroy-4)
|
|
294
296
|
- [routes](#routes)
|
|
295
297
|
- [list](#list-5)
|
|
296
|
-
- [get](#get-
|
|
298
|
+
- [get](#get-7)
|
|
297
299
|
- [create](#create-6)
|
|
298
300
|
- [update](#update-3)
|
|
299
301
|
- [destroy](#destroy-5)
|
|
300
302
|
- [validate](#validate)
|
|
301
|
-
- [get](#get-
|
|
303
|
+
- [get](#get-8)
|
|
302
304
|
- [multiple validation](#multiple-validation)
|
|
303
305
|
- [create](#create-7)
|
|
304
306
|
- [list](#list-6)
|
|
305
|
-
- [get](#get-
|
|
307
|
+
- [get](#get-9)
|
|
306
308
|
- [destroy](#destroy-6)
|
|
307
309
|
- [mailing lists](#mailing-lists)
|
|
308
310
|
- [list](#list-7)
|
|
309
|
-
- [get](#get-
|
|
311
|
+
- [get](#get-10)
|
|
310
312
|
- [create](#create-8)
|
|
311
313
|
- [update](#update-4)
|
|
312
314
|
- [destroy](#destroy-7)
|
|
@@ -319,7 +321,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
319
321
|
- [destroyMember](#destroymember)
|
|
320
322
|
- [subaccounts](#subaccounts)
|
|
321
323
|
- [list](#list-8)
|
|
322
|
-
- [get](#get-
|
|
324
|
+
- [get](#get-11)
|
|
323
325
|
- [create](#create-9)
|
|
324
326
|
- [enable](#enable)
|
|
325
327
|
- [disable](#disable)
|
|
@@ -330,29 +332,29 @@ The following service methods are available to instantiated clients. The example
|
|
|
330
332
|
- [inbox placements](#inbox-placements)
|
|
331
333
|
- [SeedsLists](#seedslists)
|
|
332
334
|
- [list](#list-9)
|
|
333
|
-
- [get](#get-
|
|
335
|
+
- [get](#get-12)
|
|
334
336
|
- [create](#create-10)
|
|
335
337
|
- [update](#update-5)
|
|
336
338
|
- [destroy](#destroy-9)
|
|
337
339
|
- [SeedsLists Attributes](#attributes)
|
|
338
340
|
- [list](#list-10)
|
|
339
|
-
- [get](#get-
|
|
341
|
+
- [get](#get-13)
|
|
340
342
|
- [SeedsLists Filters](#filters)
|
|
341
343
|
- [list](#list-11)
|
|
342
344
|
- [Providers](#providers)
|
|
343
345
|
- [list](#list-12)
|
|
344
346
|
- [Results](#results)
|
|
345
347
|
- [list](#list-13)
|
|
346
|
-
- [get](#get-
|
|
348
|
+
- [get](#get-14)
|
|
347
349
|
- [destroy](#destroy-10)
|
|
348
350
|
- [getResultByShareId](#getresultbyshareid)
|
|
349
351
|
- [Results Attributes](#attributes-1)
|
|
350
352
|
- [list](#list-14)
|
|
351
|
-
- [get](#get-
|
|
353
|
+
- [get](#get-15)
|
|
352
354
|
- [Results Filters](#filters-1)
|
|
353
355
|
- [list](#list-15)
|
|
354
356
|
- [Sharing](#sharing)
|
|
355
|
-
- [get](#get-
|
|
357
|
+
- [get](#get-16)
|
|
356
358
|
- [update](#update-6)
|
|
357
359
|
- [Run Test](#run-test)
|
|
358
360
|
- [Navigation thru lists](#navigation-thru-lists)
|
|
@@ -374,8 +376,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
374
376
|
### Messages
|
|
375
377
|
|
|
376
378
|
- #### create
|
|
379
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/post-v3--domain-name--messages)
|
|
377
380
|
|
|
378
|
-
`mg.messages.create(domain, data)`
|
|
381
|
+
`mg.messages.create(domain, data)`
|
|
379
382
|
|
|
380
383
|
Options:
|
|
381
384
|
|
|
@@ -553,7 +556,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
553
556
|
```
|
|
554
557
|
|
|
555
558
|
- #### retrieveStoredEmail
|
|
556
|
-
[
|
|
559
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/get-v3-domains--domain-name--messages--storage-key-)
|
|
557
560
|
|
|
558
561
|
`mg.messages.retrieveStoredEmail(domain, storageKey)`
|
|
559
562
|
|
|
@@ -610,7 +613,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
610
613
|
```
|
|
611
614
|
|
|
612
615
|
- ### resendEmail
|
|
613
|
-
[
|
|
616
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/post-v3-domains--domain-name--messages--storage-key-)
|
|
614
617
|
|
|
615
618
|
`mg.messages.resendEmail(domain, storageKey, recipient)`
|
|
616
619
|
|
|
@@ -642,7 +645,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
642
645
|
```
|
|
643
646
|
|
|
644
647
|
- ### getMessagesQueueStatus
|
|
645
|
-
[
|
|
648
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/get-v3-domains--name--sending-queues)
|
|
646
649
|
|
|
647
650
|
`mg.messages.getMessagesQueueStatus(domain)`
|
|
648
651
|
|
|
@@ -678,7 +681,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
678
681
|
- ### clearMessagesQueue
|
|
679
682
|
Deletes all scheduled and undelivered mail from the domain queue.
|
|
680
683
|
|
|
681
|
-
[
|
|
684
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/delete-v3--domain-name--envelopes)
|
|
682
685
|
|
|
683
686
|
`mg.messages.getMessagesQueueStatus(domain, storageUrl)`
|
|
684
687
|
|
|
@@ -703,19 +706,19 @@ The following service methods are available to instantiated clients. The example
|
|
|
703
706
|
|
|
704
707
|
Mailgun’s templates uses a fork of the very popular template engine [handlebars](https://handlebarsjs.com/).
|
|
705
708
|
|
|
706
|
-
To provide values for a substitution you need to use
|
|
709
|
+
To provide values for a substitution you need to use `h:X-Mailgun-Variables` property in the message description.
|
|
707
710
|
|
|
708
711
|
Make sure that this property is a JSON string like:
|
|
709
|
-
```
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
712
|
+
```JS
|
|
713
|
+
JSON.stringify({
|
|
714
|
+
title: "A title",
|
|
715
|
+
body: "The body"
|
|
716
|
+
})
|
|
714
717
|
```
|
|
715
718
|
|
|
716
719
|
You can find few examples of how to use templates below.
|
|
717
720
|
- Providing values for **title** and **slug** variables to render in template
|
|
718
|
-
```
|
|
721
|
+
```JS
|
|
719
722
|
...
|
|
720
723
|
const {
|
|
721
724
|
title,
|
|
@@ -766,7 +769,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
766
769
|
|
|
767
770
|
### Recipient Variables
|
|
768
771
|
|
|
769
|
-
[
|
|
772
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/post-v3--domain-name--messages)
|
|
770
773
|
|
|
771
774
|
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.
|
|
772
775
|
|
|
@@ -799,14 +802,17 @@ The following service methods are available to instantiated clients. The example
|
|
|
799
802
|
|
|
800
803
|
- #### list
|
|
801
804
|
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.
|
|
802
|
-
|
|
805
|
+
|
|
806
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/get-v4-domains)
|
|
807
|
+
|
|
808
|
+
`mg.domains.list(query)`
|
|
803
809
|
|
|
804
810
|
Example:
|
|
805
811
|
|
|
806
|
-
```
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
812
|
+
```JS
|
|
813
|
+
mg.domains.list()
|
|
814
|
+
.then(domains => console.log(domains)) // logs array of domains
|
|
815
|
+
.catch(err => console.error(err)); // logs any error
|
|
810
816
|
```
|
|
811
817
|
|
|
812
818
|
Promise returns: array of Domain instances
|
|
@@ -847,7 +853,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
847
853
|
- #### get
|
|
848
854
|
Fetches representation of a domain that includes details about the domain's state and settings.
|
|
849
855
|
|
|
850
|
-
|
|
856
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/get-v4-domains--name-)
|
|
857
|
+
|
|
858
|
+
`mg.domains.get(domain, query)`
|
|
851
859
|
|
|
852
860
|
Example:
|
|
853
861
|
|
|
@@ -915,7 +923,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
915
923
|
- #### create
|
|
916
924
|
Creates a domain for sending emails
|
|
917
925
|
|
|
918
|
-
|
|
926
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/post-v4-domains)
|
|
927
|
+
|
|
928
|
+
`mg.domains.create(data)`
|
|
919
929
|
|
|
920
930
|
Example:
|
|
921
931
|
|
|
@@ -1007,7 +1017,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1007
1017
|
- #### verify
|
|
1008
1018
|
Verify the domains DNS records (includes A, CNAME, SPF, DKIM and MX records) to ensure the domain is ready and able to send
|
|
1009
1019
|
|
|
1010
|
-
|
|
1020
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/put-v4-domains--name--verify)
|
|
1021
|
+
|
|
1022
|
+
`mg.domains.verify(domainAddress)`
|
|
1011
1023
|
|
|
1012
1024
|
Example:
|
|
1013
1025
|
|
|
@@ -1065,7 +1077,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1065
1077
|
- #### update
|
|
1066
1078
|
Update domains configuration like smtp credentials, enable/disable automatic sender security, spam actions, wildcard, or tracking web scheme.
|
|
1067
1079
|
|
|
1068
|
-
|
|
1080
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/put-v4-domains--name-)
|
|
1081
|
+
|
|
1082
|
+
`mg.domains.update(domain, options)`
|
|
1069
1083
|
|
|
1070
1084
|
Example:
|
|
1071
1085
|
|
|
@@ -1145,7 +1159,10 @@ The following service methods are available to instantiated clients. The example
|
|
|
1145
1159
|
|
|
1146
1160
|
- #### destroy
|
|
1147
1161
|
The domain must not be disabled or used as an authority for an other domain. Sandbox domain can't be deleted.
|
|
1148
|
-
|
|
1162
|
+
|
|
1163
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/delete-v3-domains--name-)
|
|
1164
|
+
|
|
1165
|
+
`mg.domains.destroy(domainAddress)`
|
|
1149
1166
|
|
|
1150
1167
|
Example:
|
|
1151
1168
|
|
|
@@ -1170,9 +1187,13 @@ The following service methods are available to instantiated clients. The example
|
|
|
1170
1187
|
`domains.updateTracking` method is deprecated, and will be removed. Please use `domains.domainTracking.updateTracking` instead.
|
|
1171
1188
|
|
|
1172
1189
|
- #### getConnection
|
|
1190
|
+
***Deprecated, and will be removed in the future releases***
|
|
1191
|
+
|
|
1173
1192
|
Returns domain's delivery connection settings.
|
|
1174
1193
|
|
|
1175
|
-
|
|
1194
|
+
[API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/domain/operation/httpapi.(*T).GetDomainConnection-fm-14-0/)
|
|
1195
|
+
|
|
1196
|
+
`mg.domains.getConnection(domainAddress)`
|
|
1176
1197
|
|
|
1177
1198
|
Example:
|
|
1178
1199
|
|
|
@@ -1192,9 +1213,13 @@ The following service methods are available to instantiated clients. The example
|
|
|
1192
1213
|
```
|
|
1193
1214
|
|
|
1194
1215
|
- #### updateConnection
|
|
1216
|
+
***Deprecated, and will be removed in the future releases***
|
|
1217
|
+
|
|
1195
1218
|
Update a domain's TLS connection settings.
|
|
1196
1219
|
|
|
1197
|
-
|
|
1220
|
+
[API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/domain/operation/httpapi.(*T).UpdateDomainConnection-fm-15-0/)
|
|
1221
|
+
|
|
1222
|
+
`mg.domains.updateConnection(domainAddress, data)`
|
|
1198
1223
|
|
|
1199
1224
|
Example:
|
|
1200
1225
|
|
|
@@ -1218,13 +1243,13 @@ The following service methods are available to instantiated clients. The example
|
|
|
1218
1243
|
```
|
|
1219
1244
|
|
|
1220
1245
|
- #### updateDKIMAuthority
|
|
1221
|
-
|
|
1246
|
+
`domains.updateDKIMAuthority` method is deprecated, and will be removed. Please use `domains.domainKeys.updateDKIMAuthority` [instead](#updatedkimauthority-1).
|
|
1222
1247
|
|
|
1223
1248
|
- #### updateDKIMSelector
|
|
1224
|
-
|
|
1249
|
+
`domains.updateDKIMSelector` method is deprecated, and will be removed. Please use `domains.domainKeys.updateDKIMSelector` [instead](#updatedkimselector-1).
|
|
1225
1250
|
|
|
1226
1251
|
- #### getIps
|
|
1227
|
-
|
|
1252
|
+
***Deprecated, and will be removed in the future releases***
|
|
1228
1253
|
|
|
1229
1254
|
`mg.domains.getIps(domain)`
|
|
1230
1255
|
|
|
@@ -1243,7 +1268,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
1243
1268
|
```
|
|
1244
1269
|
|
|
1245
1270
|
- #### assignIp
|
|
1246
|
-
|
|
1271
|
+
***Deprecated, and will be removed in the future releases***
|
|
1247
1272
|
`mg.domains.assignIp(domain, ip)`
|
|
1248
1273
|
|
|
1249
1274
|
Example:
|
|
@@ -1285,7 +1310,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1285
1310
|
- #### list
|
|
1286
1311
|
Returns a list of templates for the domain.
|
|
1287
1312
|
|
|
1288
|
-
|
|
1313
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates)
|
|
1314
|
+
|
|
1315
|
+
`mg.domains.domainTemplates.list('domainId', query)`
|
|
1289
1316
|
|
|
1290
1317
|
Example:
|
|
1291
1318
|
|
|
@@ -1324,7 +1351,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1324
1351
|
|
|
1325
1352
|
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.
|
|
1326
1353
|
|
|
1327
|
-
|
|
1354
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates--template-name-)
|
|
1355
|
+
|
|
1356
|
+
`mg.domains.domainTemplates.get('domainId', 'templateName', query)`
|
|
1328
1357
|
|
|
1329
1358
|
Example:
|
|
1330
1359
|
|
|
@@ -1369,7 +1398,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1369
1398
|
Store a new template, including its name, description and (optionally) the template content.
|
|
1370
1399
|
If the template content is provided, a new version is automatically created and becomes the active version.
|
|
1371
1400
|
|
|
1372
|
-
|
|
1401
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/post-v3--domain-name--templates)
|
|
1402
|
+
|
|
1403
|
+
`mg.domains.domainTemplates.create(domainId, templateData)`
|
|
1373
1404
|
|
|
1374
1405
|
Example:
|
|
1375
1406
|
|
|
@@ -1428,7 +1459,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1428
1459
|
- #### update
|
|
1429
1460
|
Update the description of a template.
|
|
1430
1461
|
|
|
1431
|
-
|
|
1462
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/put-v3--domain-name--templates--template-name-)
|
|
1463
|
+
|
|
1464
|
+
`mg.domains.domainTemplates.update('domainId', 'templateName', data)`
|
|
1432
1465
|
|
|
1433
1466
|
Example:
|
|
1434
1467
|
|
|
@@ -1457,7 +1490,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1457
1490
|
- #### destroy
|
|
1458
1491
|
Delete the template specified in the url. NOTE: This method deletes all versions of the specified template.
|
|
1459
1492
|
|
|
1460
|
-
|
|
1493
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/delete-v3--domain-name--templates--template-name-)
|
|
1494
|
+
|
|
1495
|
+
`mg.domains.domainTemplates.destroy('domainId', 'templateName')`
|
|
1461
1496
|
|
|
1462
1497
|
Example:
|
|
1463
1498
|
|
|
@@ -1479,7 +1514,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1479
1514
|
- #### destroyAll
|
|
1480
1515
|
Delete all templates and their versions for the domain.
|
|
1481
1516
|
|
|
1482
|
-
|
|
1517
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/delete-v3--domain-name--templates)
|
|
1518
|
+
|
|
1519
|
+
`mg.domains.domainTemplates.destroyAll('domainId')`
|
|
1483
1520
|
|
|
1484
1521
|
Example:
|
|
1485
1522
|
|
|
@@ -1500,7 +1537,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1500
1537
|
- #### listVersions
|
|
1501
1538
|
Returns a paginated list of template versions.
|
|
1502
1539
|
|
|
1503
|
-
|
|
1540
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates--template-name--versions)
|
|
1541
|
+
|
|
1542
|
+
`mg.domains.domainTemplates.listVersions('domainId', 'template_name', queryData)`
|
|
1504
1543
|
|
|
1505
1544
|
Example:
|
|
1506
1545
|
|
|
@@ -1547,7 +1586,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1547
1586
|
|
|
1548
1587
|
Retrieve the information and content of the specified version of a template.
|
|
1549
1588
|
|
|
1550
|
-
|
|
1589
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/get-v3--domain-name--templates--template-name--versions--version-name-)
|
|
1590
|
+
|
|
1591
|
+
`mg.domains.domainTemplates.getVersion('domainId', 'template_name', 'tag')`
|
|
1551
1592
|
|
|
1552
1593
|
Example:
|
|
1553
1594
|
|
|
@@ -1588,7 +1629,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1588
1629
|
- #### createVersion
|
|
1589
1630
|
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.
|
|
1590
1631
|
|
|
1591
|
-
|
|
1632
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/post-v3--domain-name--templates--template-name--versions)
|
|
1633
|
+
|
|
1634
|
+
`mg.domains.domainTemplates.createVersion('domainId', 'template_name', versionData)`
|
|
1592
1635
|
|
|
1593
1636
|
Example:
|
|
1594
1637
|
|
|
@@ -1650,7 +1693,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1650
1693
|
Update information or content of the specific template version.
|
|
1651
1694
|
Existing fields not included in the request will not be changed
|
|
1652
1695
|
|
|
1653
|
-
|
|
1696
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/put-v3--domain-name--templates--template-name--versions--version-name-)
|
|
1697
|
+
|
|
1698
|
+
`mg.domains.domainTemplates.updateVersion('domainId', 'template_name', 'tag' , versionData)`
|
|
1654
1699
|
|
|
1655
1700
|
Example:
|
|
1656
1701
|
|
|
@@ -1695,7 +1740,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1695
1740
|
- #### destroyVersion
|
|
1696
1741
|
Delete a specific template version.
|
|
1697
1742
|
|
|
1698
|
-
|
|
1743
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/templates/delete-v3--domain-name--templates--template-name--versions--version-name-)
|
|
1744
|
+
|
|
1745
|
+
`mg.domains.domainTemplates.destroyVersion(domainId, templateName, tag)`
|
|
1699
1746
|
|
|
1700
1747
|
Example:
|
|
1701
1748
|
|
|
@@ -1710,7 +1757,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1710
1757
|
status: 200,
|
|
1711
1758
|
message: 'version has been deleted',
|
|
1712
1759
|
templateName: 'template_name',
|
|
1713
|
-
templateVersion: {
|
|
1760
|
+
templateVersion: {
|
|
1761
|
+
tag:'v1'
|
|
1762
|
+
}
|
|
1714
1763
|
}
|
|
1715
1764
|
```
|
|
1716
1765
|
|
|
@@ -1720,7 +1769,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1720
1769
|
|
|
1721
1770
|
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.
|
|
1722
1771
|
|
|
1723
|
-
|
|
1772
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/get-v3-domains--name--tracking)
|
|
1773
|
+
|
|
1774
|
+
`mg.domains.domainTracking.getTracking(domainAddress)`
|
|
1724
1775
|
|
|
1725
1776
|
Example:
|
|
1726
1777
|
|
|
@@ -1756,7 +1807,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
1756
1807
|
|
|
1757
1808
|
- Open Tracking Example:
|
|
1758
1809
|
|
|
1759
|
-
[
|
|
1810
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v3-domains--name--tracking-open)
|
|
1811
|
+
|
|
1760
1812
|
```js
|
|
1761
1813
|
mg.domains.domainTracking.updateTracking('foobar.example.com', 'open', {
|
|
1762
1814
|
active: true,
|
|
@@ -1787,7 +1839,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
1787
1839
|
|
|
1788
1840
|
- Click Tracking Example:
|
|
1789
1841
|
|
|
1790
|
-
[
|
|
1842
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v3-domains--name--tracking-click)
|
|
1791
1843
|
```JS
|
|
1792
1844
|
mg.domains.domainTracking.updateTracking('foobar.example.com', 'click', {active: true})
|
|
1793
1845
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -1813,7 +1865,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
1813
1865
|
|
|
1814
1866
|
- Unsubscribe Tracking Example
|
|
1815
1867
|
|
|
1816
|
-
[
|
|
1868
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v3-domains--name--tracking-unsubscribe)
|
|
1817
1869
|
```js
|
|
1818
1870
|
mg.domains.domainTracking.updateTracking('foobar.example.com', 'unsubscribe', {
|
|
1819
1871
|
active: true,
|
|
@@ -1848,7 +1900,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1848
1900
|
- #### get
|
|
1849
1901
|
Get x509 TLS certificate and status
|
|
1850
1902
|
|
|
1851
|
-
|
|
1903
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/get-v2-x509--domain--status)
|
|
1904
|
+
|
|
1905
|
+
`mg.domains.domainTracking.get(domainAddress)`
|
|
1852
1906
|
|
|
1853
1907
|
Example:
|
|
1854
1908
|
|
|
@@ -1872,7 +1926,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1872
1926
|
- #### generate
|
|
1873
1927
|
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
|
|
1874
1928
|
|
|
1875
|
-
|
|
1929
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/post-v2-x509--domain-)
|
|
1930
|
+
|
|
1931
|
+
`mg.domains.domainTracking.generate(domainAddress)`
|
|
1876
1932
|
|
|
1877
1933
|
Example:
|
|
1878
1934
|
|
|
@@ -1895,7 +1951,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
1895
1951
|
- #### regenerate
|
|
1896
1952
|
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
|
|
1897
1953
|
|
|
1898
|
-
|
|
1954
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-tracking/put-v2-x509--domain-)
|
|
1955
|
+
|
|
1956
|
+
`mg.domains.domainTracking.regenerate(domainAddress)`
|
|
1899
1957
|
|
|
1900
1958
|
Example:
|
|
1901
1959
|
|
|
@@ -1922,7 +1980,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
1922
1980
|
|
|
1923
1981
|
`mg.domains.domainKeys.list(domainAddress, data)`
|
|
1924
1982
|
|
|
1925
|
-
[
|
|
1983
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/get-v4-domains--authority-name--keys)
|
|
1926
1984
|
|
|
1927
1985
|
Example:
|
|
1928
1986
|
|
|
@@ -1959,7 +2017,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
1959
2017
|
|
|
1960
2018
|
`mg.domains.domainKeys.listAll(filterData)`
|
|
1961
2019
|
|
|
1962
|
-
[
|
|
2020
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/get-v1-dkim-keys)
|
|
1963
2021
|
|
|
1964
2022
|
Example:
|
|
1965
2023
|
|
|
@@ -2003,7 +2061,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2003
2061
|
|
|
2004
2062
|
`mg.domains.domainKeys.create(newKeyData)`
|
|
2005
2063
|
|
|
2006
|
-
[
|
|
2064
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/post-v1-dkim-keys)
|
|
2007
2065
|
|
|
2008
2066
|
Example:
|
|
2009
2067
|
|
|
@@ -2044,7 +2102,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2044
2102
|
|
|
2045
2103
|
`mg.domains.domainKeys.activate(domainAddress, selector)`
|
|
2046
2104
|
|
|
2047
|
-
[
|
|
2105
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v4-domains--authority-name--keys--selector--activate)
|
|
2048
2106
|
|
|
2049
2107
|
Example:
|
|
2050
2108
|
|
|
@@ -2071,7 +2129,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2071
2129
|
|
|
2072
2130
|
`mg.domains.domainKeys.deactivate(domainAddress, selector)`
|
|
2073
2131
|
|
|
2074
|
-
[
|
|
2132
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v4-domains--authority-name--keys--selector--deactivate)
|
|
2075
2133
|
|
|
2076
2134
|
Example:
|
|
2077
2135
|
|
|
@@ -2100,7 +2158,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2100
2158
|
|
|
2101
2159
|
`mg.domains.domainKeys.destroy(domainAddress, selector)`
|
|
2102
2160
|
|
|
2103
|
-
[
|
|
2161
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/delete-v1-dkim-keys)
|
|
2104
2162
|
|
|
2105
2163
|
Example:
|
|
2106
2164
|
|
|
@@ -2121,7 +2179,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
2121
2179
|
- #### updateDKIMAuthority
|
|
2122
2180
|
You can delegate the domain authority to an other domain. Domain's authority is set to itself by default.
|
|
2123
2181
|
|
|
2124
|
-
|
|
2182
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v3-domains--name--dkim-authority)
|
|
2183
|
+
|
|
2184
|
+
`mg.domains.domainKeys.updateDKIMAuthority(domainAddress, data)`
|
|
2125
2185
|
|
|
2126
2186
|
Example:
|
|
2127
2187
|
|
|
@@ -2162,7 +2222,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
2162
2222
|
- #### updateDKIMSelector
|
|
2163
2223
|
Selector is the unique identifier of your key. It has to be different from other keys selector.
|
|
2164
2224
|
|
|
2165
|
-
|
|
2225
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-keys/put-v3-domains--name--dkim-selector)
|
|
2226
|
+
|
|
2227
|
+
`mg.domains.domainKeys.updateDKIMSelector(domainAddress, data)`
|
|
2166
2228
|
|
|
2167
2229
|
Example:
|
|
2168
2230
|
|
|
@@ -2192,6 +2254,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
2192
2254
|
### Events
|
|
2193
2255
|
|
|
2194
2256
|
- #### get
|
|
2257
|
+
***Deprecated, and will be removed in the future releases. Use [Logs](#logs) instead**
|
|
2258
|
+
|
|
2259
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/events)
|
|
2195
2260
|
|
|
2196
2261
|
`mg.events.get(domain, data)`
|
|
2197
2262
|
|
|
@@ -2215,7 +2280,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2215
2280
|
| 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. |
|
|
2216
2281
|
| 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. |
|
|
2217
2282
|
| limit | Number of entries to return. (300 max) |
|
|
2218
|
-
| **field** | **field** is the name of the *[Filter Field](https://
|
|
2283
|
+
| **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. |
|
|
2219
2284
|
- #### Example with Date and *Filter field*
|
|
2220
2285
|
```js
|
|
2221
2286
|
const date = new Date(2023, 7, 2, 0, 0, 0, 0); // Wed Aug 02 2023 00:00:00 GMT+0300
|
|
@@ -2226,6 +2291,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2226
2291
|
event: 'delivered'
|
|
2227
2292
|
});
|
|
2228
2293
|
```
|
|
2294
|
+
|
|
2229
2295
|
Promise returns: items (array of event objects), pages (paging keys grouped by id)
|
|
2230
2296
|
|
|
2231
2297
|
```JS
|
|
@@ -2245,9 +2311,99 @@ The following service methods are available to instantiated clients. The example
|
|
|
2245
2311
|
}
|
|
2246
2312
|
```
|
|
2247
2313
|
|
|
2314
|
+
### Logs
|
|
2315
|
+
Mailgun keeps track of every inbound and outbound message event and stores this log data. This data can be queried and filtered to provide insights into the health of your email infrastructure.
|
|
2316
|
+
|
|
2317
|
+
- #### get
|
|
2318
|
+
Gets customer event logs for an account
|
|
2319
|
+
|
|
2320
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/stats)
|
|
2321
|
+
|
|
2322
|
+
```mg.logs.get(query)```
|
|
2323
|
+
|
|
2324
|
+
Example:
|
|
2325
|
+
|
|
2326
|
+
```JS
|
|
2327
|
+
mg.events.get({
|
|
2328
|
+
start: new Date('2025-11-17T13:00:00Z'), // required
|
|
2329
|
+
end: new Date('2025-11-30T13:05:00Z'), // required
|
|
2330
|
+
include_totals: true,
|
|
2331
|
+
events: ['accepted'], // opened, delivered, etc.
|
|
2332
|
+
include_subaccounts: false,
|
|
2333
|
+
pagination: {
|
|
2334
|
+
token: 'page token from response',
|
|
2335
|
+
limit: 5,
|
|
2336
|
+
sort: 'timestamp:asc'
|
|
2337
|
+
},
|
|
2338
|
+
filter: {
|
|
2339
|
+
AND: [
|
|
2340
|
+
{
|
|
2341
|
+
attribute: 'domain',
|
|
2342
|
+
comparator: '=',
|
|
2343
|
+
values: [
|
|
2344
|
+
{
|
|
2345
|
+
label: 'example.com',
|
|
2346
|
+
value: 'example.com'
|
|
2347
|
+
}
|
|
2348
|
+
]
|
|
2349
|
+
}
|
|
2350
|
+
]
|
|
2351
|
+
}
|
|
2352
|
+
}).then(data => console.log(data)) // logs response
|
|
2353
|
+
.catch(err => console.error(err)); // logs any error
|
|
2354
|
+
```
|
|
2355
|
+
|
|
2356
|
+
Promise returns:
|
|
2357
|
+
```JS
|
|
2358
|
+
{
|
|
2359
|
+
start: new Date('2025-11-17T13:00:00.000Z'),
|
|
2360
|
+
end: new Date('2025-11-30T13:05:00.000Z'),
|
|
2361
|
+
status: 200,
|
|
2362
|
+
pagination: {
|
|
2363
|
+
next: 'page token for next page',
|
|
2364
|
+
last: 'page token for last page'
|
|
2365
|
+
},
|
|
2366
|
+
items: [
|
|
2367
|
+
{
|
|
2368
|
+
id: 'JDhSWf9mT5OFxCkZfpDU5d',
|
|
2369
|
+
event: 'accepted',
|
|
2370
|
+
'@timestamp': new Date('2024-07-08T16:30:18.530Z'),
|
|
2371
|
+
account: {
|
|
2372
|
+
id: '12345'
|
|
2373
|
+
},
|
|
2374
|
+
delivery-status: {
|
|
2375
|
+
message: 'Turret client: server connection failed',
|
|
2376
|
+
'attempt-no': 5,
|
|
2377
|
+
code: 680,
|
|
2378
|
+
'session-seconds': 15.026,
|
|
2379
|
+
'retry-seconds': 145
|
|
2380
|
+
},
|
|
2381
|
+
domain: {
|
|
2382
|
+
name: 'example.com'
|
|
2383
|
+
},
|
|
2384
|
+
recipient: 'example@gmail.com',
|
|
2385
|
+
'recipient-domain': 'gmail.com',
|
|
2386
|
+
'recipient-provider': 'Gmail',
|
|
2387
|
+
envelope: {
|
|
2388
|
+
sender: 'bob@example.com',
|
|
2389
|
+
transport: 'smtp',
|
|
2390
|
+
'sending-ip': '198.52.100.1',
|
|
2391
|
+
targets: 'bob@example.com'
|
|
2392
|
+
}
|
|
2393
|
+
},
|
|
2394
|
+
...
|
|
2395
|
+
],
|
|
2396
|
+
aggregates: {}
|
|
2397
|
+
}
|
|
2398
|
+
```
|
|
2399
|
+
|
|
2400
|
+
|
|
2248
2401
|
### Stats
|
|
2249
|
-
|
|
2402
|
+
***Deprecated, and will be removed in the future releases***
|
|
2403
|
+
|
|
2404
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/stats)
|
|
2250
2405
|
|
|
2406
|
+
- #### Stats Options
|
|
2251
2407
|
| Parameter | Description |
|
|
2252
2408
|
|:-----------|:---------------------------------------------------------------------------------------------------------------------------|
|
|
2253
2409
|
| event | The type of the event. For a complete list of all events written to the log see the `Event Types` table below. (Required) |
|
|
@@ -2283,6 +2439,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
2283
2439
|
|
|
2284
2440
|
- #### getDomain
|
|
2285
2441
|
|
|
2442
|
+
[API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/openapi-final/tag/Stats/#tag/Stats/operation/GET-v3--domain--stats-total)
|
|
2443
|
+
|
|
2286
2444
|
`mg.stats.getDomain(domain, query)`
|
|
2287
2445
|
|
|
2288
2446
|
Example:
|
|
@@ -2308,6 +2466,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2308
2466
|
```
|
|
2309
2467
|
|
|
2310
2468
|
- #### getAccount
|
|
2469
|
+
[API Reference](https://mailgun-docs.redoc.ly/docs/mailgun/api-reference/openapi-final/tag/Stats/#tag/Stats/operation/GET-v3-stats-total)
|
|
2311
2470
|
|
|
2312
2471
|
`mg.stats.getDomain(domain, query)`
|
|
2313
2472
|
|
|
@@ -2337,11 +2496,13 @@ The following service methods are available to instantiated clients. The example
|
|
|
2337
2496
|
```
|
|
2338
2497
|
|
|
2339
2498
|
### Metrics
|
|
2340
|
-
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
|
|
2499
|
+
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).
|
|
2341
2500
|
|
|
2342
2501
|
- #### getAccount
|
|
2343
2502
|
Gets filtered metrics for an account
|
|
2344
2503
|
|
|
2504
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/metrics/post-v1-analytics-metrics)
|
|
2505
|
+
|
|
2345
2506
|
`mg.metrics.getAccount(MetricsQuery);`
|
|
2346
2507
|
|
|
2347
2508
|
Example:
|
|
@@ -2375,7 +2536,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2375
2536
|
| 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.|
|
|
2376
2537
|
| dimensions | Array of strings | Attributes of the metric data such as 'subaccount'.|
|
|
2377
2538
|
| metrics | Array of strings | Name of the metrics to receive the stats for such as 'processed_count'.|
|
|
2378
|
-
| 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/
|
|
2539
|
+
| 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. |
|
|
2379
2540
|
| include_subaccounts | Boolean | Include stats from all subaccounts. |
|
|
2380
2541
|
| include_aggregates | Boolean | Include top-level aggregate metrics.|
|
|
2381
2542
|
|
|
@@ -2408,6 +2569,9 @@ The following service methods are available to instantiated clients. The example
|
|
|
2408
2569
|
|
|
2409
2570
|
- #### getAccountUsage
|
|
2410
2571
|
Gets filtered **usage metrics** for an account
|
|
2572
|
+
|
|
2573
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/metrics/post-v1-analytics-usage-metrics)
|
|
2574
|
+
|
|
2411
2575
|
`mg.metrics.getAccountUsage(MetricsQuery);`
|
|
2412
2576
|
|
|
2413
2577
|
Example:
|
|
@@ -2441,7 +2605,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2441
2605
|
| 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.|
|
|
2442
2606
|
| dimensions | Array of strings | Attributes of the metric data such as 'subaccount'.|
|
|
2443
2607
|
| metrics | Array of strings | Name of the metrics to receive the stats for such as 'processed_count'.|
|
|
2444
|
-
| 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/
|
|
2608
|
+
| 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. |
|
|
2445
2609
|
| include_subaccounts | Boolean | Include stats from all subaccounts. |
|
|
2446
2610
|
| include_aggregates | Boolean | Include top-level aggregate metrics.|
|
|
2447
2611
|
|
|
@@ -2479,7 +2643,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2479
2643
|
`mg.suppressions.list(domain, suppressionType, query?)`
|
|
2480
2644
|
|
|
2481
2645
|
- #### Bounces Example:
|
|
2482
|
-
|
|
2646
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/get-v3--domainid--bounces)
|
|
2483
2647
|
```js
|
|
2484
2648
|
mg.suppressions.list('foobar.example.com', 'bounces')
|
|
2485
2649
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2487,7 +2651,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2487
2651
|
```
|
|
2488
2652
|
|
|
2489
2653
|
- #### Unsubscribes Example:
|
|
2490
|
-
|
|
2654
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/get-v3--domainid--unsubscribes)
|
|
2491
2655
|
```js
|
|
2492
2656
|
mg.suppressions.list('foobar.example.com', 'unsubscribes')
|
|
2493
2657
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2496,6 +2660,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
2496
2660
|
|
|
2497
2661
|
- #### Complaints Example:
|
|
2498
2662
|
|
|
2663
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/get-v3--domainid--complaints)
|
|
2664
|
+
|
|
2499
2665
|
```js
|
|
2500
2666
|
mg.suppressions.list('foobar.example.com', 'complaints')
|
|
2501
2667
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2528,7 +2694,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2528
2694
|
`mg.suppressions.get(domain, suppressionType, address)`
|
|
2529
2695
|
|
|
2530
2696
|
- #### Bounces Example:
|
|
2531
|
-
|
|
2697
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/get-v3--domainid--bounces--address-)
|
|
2532
2698
|
```js
|
|
2533
2699
|
mg.suppressions.get('foobar.example.com', 'bounces', 'address@example.com')
|
|
2534
2700
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2536,6 +2702,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2536
2702
|
```
|
|
2537
2703
|
|
|
2538
2704
|
- #### Unsubscribes Example:
|
|
2705
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/get-v3--domainid--unsubscribes--address-)
|
|
2539
2706
|
|
|
2540
2707
|
```js
|
|
2541
2708
|
mg.suppressions.get('foobar.example.com', 'unsubscribes', 'address@example.com')
|
|
@@ -2545,6 +2712,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
2545
2712
|
|
|
2546
2713
|
- #### Complaints Example:
|
|
2547
2714
|
|
|
2715
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/get-v3--domainid--complaints--address-)
|
|
2716
|
+
|
|
2548
2717
|
```js
|
|
2549
2718
|
mg.suppressions.get('foobar.example.com', 'complaints', 'address@example.com')
|
|
2550
2719
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2566,6 +2735,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
2566
2735
|
`mg.suppressions.create(domain, suppressionType, data || data[])`
|
|
2567
2736
|
|
|
2568
2737
|
- #### Bounces Example:
|
|
2738
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/post-v3--domainid--bounces)
|
|
2739
|
+
|
|
2569
2740
|
```JS
|
|
2570
2741
|
mg.suppressions.create('foobar.example.com', 'bounces', [{address: 'bob@example.com'}])
|
|
2571
2742
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2590,7 +2761,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2590
2761
|
```
|
|
2591
2762
|
|
|
2592
2763
|
- #### Unsubscribes Example:
|
|
2593
|
-
|
|
2764
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/post-v3--domainid--unsubscribes)
|
|
2594
2765
|
```js
|
|
2595
2766
|
mg.suppressions.create('foobar.example.com', 'unsubscribes', {address: 'bob@example.com'})
|
|
2596
2767
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2641,8 +2812,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
2641
2812
|
```
|
|
2642
2813
|
|
|
2643
2814
|
- #### Complaints Example:
|
|
2644
|
-
|
|
2645
|
-
```
|
|
2815
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/post-v3--domainid--complaints)
|
|
2816
|
+
```JS
|
|
2646
2817
|
mg.suppressions.create('foobar.example.com', 'complaints', [{address: 'bob@example.com'}])
|
|
2647
2818
|
.then(msg => console.log(msg)) // logs response data
|
|
2648
2819
|
.catch(err => console.error(err)); // logs any error
|
|
@@ -2667,7 +2838,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2667
2838
|
`mg.suppressions.destroy(domain, suppressionType, address)`
|
|
2668
2839
|
|
|
2669
2840
|
- #### Bounces Example:
|
|
2670
|
-
|
|
2841
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/bounces/delete-v3--domainid--bounces--address-)
|
|
2671
2842
|
```JS
|
|
2672
2843
|
mg.suppressions.destroy('foobar.example.com', 'bounces', 'bob@example.com')
|
|
2673
2844
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2686,7 +2857,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2686
2857
|
```
|
|
2687
2858
|
|
|
2688
2859
|
- #### Unsubscribes Example:
|
|
2689
|
-
|
|
2860
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/unsubscribe/delete-v3--domainid--unsubscribes--address-)
|
|
2690
2861
|
```js
|
|
2691
2862
|
mg.suppressions.destroy('foobar.example.com', 'unsubscribes', 'bob@example.com')
|
|
2692
2863
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2705,7 +2876,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2705
2876
|
```
|
|
2706
2877
|
|
|
2707
2878
|
- #### Complaints Example:
|
|
2708
|
-
|
|
2879
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/complaints/delete-v3--domainid--complaints--address-)
|
|
2709
2880
|
```js
|
|
2710
2881
|
mg.suppressions.destroy('foobar.example.com', 'complaints', 'bob@example.com')
|
|
2711
2882
|
.then(msg => console.log(msg)) // logs response data
|
|
@@ -2725,6 +2896,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2725
2896
|
### Webhooks
|
|
2726
2897
|
|
|
2727
2898
|
- #### list
|
|
2899
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/get-v3-domains--domain--webhooks)
|
|
2728
2900
|
|
|
2729
2901
|
`mg.webhooks.list(domain, query)`
|
|
2730
2902
|
|
|
@@ -2753,6 +2925,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2753
2925
|
```
|
|
2754
2926
|
|
|
2755
2927
|
- #### get
|
|
2928
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/get-v3-domains--domain-name--webhooks--webhook-name-)
|
|
2756
2929
|
|
|
2757
2930
|
`mg.webhooks.get(domain, id)`
|
|
2758
2931
|
|
|
@@ -2773,6 +2946,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2773
2946
|
```
|
|
2774
2947
|
|
|
2775
2948
|
- #### create
|
|
2949
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/post-v3-domains--domain--webhooks)
|
|
2776
2950
|
|
|
2777
2951
|
`mg.webhooks.create(domain, id, data, test)`
|
|
2778
2952
|
|
|
@@ -2810,6 +2984,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2810
2984
|
```
|
|
2811
2985
|
|
|
2812
2986
|
- #### update
|
|
2987
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/put-v3-domains--domain-name--webhooks--webhook-name-)
|
|
2813
2988
|
|
|
2814
2989
|
`mg.webhooks.update(domain, id, url, test)`
|
|
2815
2990
|
|
|
@@ -2844,6 +3019,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2844
3019
|
|
|
2845
3020
|
|
|
2846
3021
|
- #### destroy
|
|
3022
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/mailgun/webhooks/delete-v3-domains--domain-name--webhooks--webhook-name-)
|
|
2847
3023
|
|
|
2848
3024
|
`mg.webhooks.destroy(domain, id)`
|
|
2849
3025
|
|
|
@@ -2866,6 +3042,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2866
3042
|
### Routes
|
|
2867
3043
|
|
|
2868
3044
|
- #### list
|
|
3045
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/get-v3-routes)
|
|
2869
3046
|
|
|
2870
3047
|
`mg.routes.list(query)`
|
|
2871
3048
|
|
|
@@ -2893,6 +3070,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2893
3070
|
```
|
|
2894
3071
|
|
|
2895
3072
|
- #### get
|
|
3073
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/get-v3-routes-id)
|
|
2896
3074
|
|
|
2897
3075
|
`mg.routes.get(id)`
|
|
2898
3076
|
|
|
@@ -2918,6 +3096,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2918
3096
|
```
|
|
2919
3097
|
|
|
2920
3098
|
- #### create
|
|
3099
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/post-v3-routes)
|
|
2921
3100
|
|
|
2922
3101
|
`mg.routes.create(options)`
|
|
2923
3102
|
|
|
@@ -2948,6 +3127,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2948
3127
|
```
|
|
2949
3128
|
|
|
2950
3129
|
- #### update
|
|
3130
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/put-v3-routes-id)
|
|
2951
3131
|
|
|
2952
3132
|
`mg.routes.update(id, options)`
|
|
2953
3133
|
|
|
@@ -2979,6 +3159,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
2979
3159
|
```
|
|
2980
3160
|
|
|
2981
3161
|
- #### destroy
|
|
3162
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/routes/delete-v3-routes-id)
|
|
2982
3163
|
|
|
2983
3164
|
`mg.routes.destroy(id)`
|
|
2984
3165
|
|
|
@@ -3002,6 +3183,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
3002
3183
|
### Validation
|
|
3003
3184
|
|
|
3004
3185
|
- #### get
|
|
3186
|
+
[API Reference](https://documentation.mailgun.com/docs/validate/single-valid-ir)
|
|
3005
3187
|
|
|
3006
3188
|
`mg.validate.get(address)`
|
|
3007
3189
|
|
|
@@ -3029,7 +3211,8 @@ The following service methods are available to instantiated clients. The example
|
|
|
3029
3211
|
```
|
|
3030
3212
|
|
|
3031
3213
|
### Multiple validation
|
|
3032
|
-
https://documentation.mailgun.com/
|
|
3214
|
+
[API Reference](https://documentation.mailgun.com/docs/validate/bulk-valid-ir)
|
|
3215
|
+
|
|
3033
3216
|
- #### create
|
|
3034
3217
|
`mg.validate.multipleValidation.create('name_of_the_list', { file })`
|
|
3035
3218
|
|
|
@@ -3168,6 +3351,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
|
|
|
3168
3351
|
A client to manage mailing lists.
|
|
3169
3352
|
|
|
3170
3353
|
- #### list
|
|
3354
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-v3-lists)
|
|
3171
3355
|
|
|
3172
3356
|
`mg.lists.list()`
|
|
3173
3357
|
|
|
@@ -3196,6 +3380,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
|
|
|
3196
3380
|
```
|
|
3197
3381
|
|
|
3198
3382
|
- #### get
|
|
3383
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-v3-lists-address)
|
|
3199
3384
|
|
|
3200
3385
|
`mg.lists.get(mailListAddress)`
|
|
3201
3386
|
|
|
@@ -3222,6 +3407,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
|
|
|
3222
3407
|
```
|
|
3223
3408
|
|
|
3224
3409
|
- #### create
|
|
3410
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/post-v3-lists)
|
|
3225
3411
|
|
|
3226
3412
|
`mg.lists.create(data)`
|
|
3227
3413
|
|
|
@@ -3254,6 +3440,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
|
|
|
3254
3440
|
```
|
|
3255
3441
|
|
|
3256
3442
|
- #### update
|
|
3443
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/put-v3-lists-address)
|
|
3257
3444
|
|
|
3258
3445
|
`mg.lists.update(mailListAddress)`
|
|
3259
3446
|
|
|
@@ -3286,6 +3473,7 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
|
|
|
3286
3473
|
```
|
|
3287
3474
|
|
|
3288
3475
|
- #### destroy
|
|
3476
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/delete-v3-lists-address)
|
|
3289
3477
|
|
|
3290
3478
|
`mg.lists.destroy(mailListAddress)`
|
|
3291
3479
|
|
|
@@ -3307,9 +3495,10 @@ https://documentation.mailgun.com/en/latest/api-email-validation.html#email-vali
|
|
|
3307
3495
|
```
|
|
3308
3496
|
|
|
3309
3497
|
### Mailing list members
|
|
3310
|
-
A client to manage members within a specific mailing list.
|
|
3498
|
+
A client to manage members within a specific mailing list.
|
|
3311
3499
|
|
|
3312
3500
|
- #### listMembers
|
|
3501
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-lists-string:list_address-members)
|
|
3313
3502
|
|
|
3314
3503
|
`mg.lists.members.listMembers(mailListAddress)`
|
|
3315
3504
|
|
|
@@ -3335,6 +3524,8 @@ A client to manage members within a specific mailing list.
|
|
|
3335
3524
|
```
|
|
3336
3525
|
|
|
3337
3526
|
- #### getMember
|
|
3527
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/get-lists-list_address-members-member_address)
|
|
3528
|
+
|
|
3338
3529
|
`mg.lists.members.getMember(mailListAddress, mailListMemberAddress)`
|
|
3339
3530
|
|
|
3340
3531
|
Example:
|
|
@@ -3357,6 +3548,8 @@ A client to manage members within a specific mailing list.
|
|
|
3357
3548
|
```
|
|
3358
3549
|
|
|
3359
3550
|
- #### createMember
|
|
3551
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/post-lists-string:list_address-members)
|
|
3552
|
+
|
|
3360
3553
|
`mg.lists.members.createMember(mailListAddress, data)`
|
|
3361
3554
|
|
|
3362
3555
|
Example:
|
|
@@ -3385,6 +3578,7 @@ A client to manage members within a specific mailing list.
|
|
|
3385
3578
|
```
|
|
3386
3579
|
|
|
3387
3580
|
- #### createMembers
|
|
3581
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/post-lists-list_address-members.json)
|
|
3388
3582
|
`mg.lists.members.createMembers(mailListAddress, data)`
|
|
3389
3583
|
|
|
3390
3584
|
Example:
|
|
@@ -3430,6 +3624,7 @@ A client to manage members within a specific mailing list.
|
|
|
3430
3624
|
```
|
|
3431
3625
|
|
|
3432
3626
|
- #### updateMember
|
|
3627
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/put-lists-list_address-members-member_address)
|
|
3433
3628
|
|
|
3434
3629
|
`mg.lists.members.updateMember(mailListAddress, mailListMemberAddress, data)`
|
|
3435
3630
|
|
|
@@ -3458,6 +3653,7 @@ A client to manage members within a specific mailing list.
|
|
|
3458
3653
|
```
|
|
3459
3654
|
|
|
3460
3655
|
- #### destroyMember
|
|
3656
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/mailing-lists/delete-lists-list_address-members-member_address)
|
|
3461
3657
|
|
|
3462
3658
|
`mg.lists.members.destroyMember(mailListAddress, mailListMemberAddress)`
|
|
3463
3659
|
|
|
@@ -3477,13 +3673,15 @@ A client to manage members within a specific mailing list.
|
|
|
3477
3673
|
message: 'Mailing list member has been deleted'
|
|
3478
3674
|
}
|
|
3479
3675
|
```
|
|
3676
|
+
|
|
3480
3677
|
### Subaccounts
|
|
3481
3678
|
|
|
3482
3679
|
A client to manage subaccounts.
|
|
3483
3680
|
|
|
3484
3681
|
- #### list
|
|
3682
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/get-v5-accounts-subaccounts)
|
|
3485
3683
|
|
|
3486
|
-
`mg.subaccounts.list(query)`
|
|
3684
|
+
`mg.subaccounts.list(query)`
|
|
3487
3685
|
|
|
3488
3686
|
Example:
|
|
3489
3687
|
|
|
@@ -3512,6 +3710,7 @@ A client to manage members within a specific mailing list.
|
|
|
3512
3710
|
| enabled | Returns all enabled/disabled subaccounts. (Defaults to all if omitted) |
|
|
3513
3711
|
|
|
3514
3712
|
- #### get
|
|
3713
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/get-v5-accounts-subaccounts-subaccount_id)
|
|
3515
3714
|
|
|
3516
3715
|
`mg.subaccounts.get(subaccount_id)`
|
|
3517
3716
|
|
|
@@ -3530,6 +3729,7 @@ A client to manage members within a specific mailing list.
|
|
|
3530
3729
|
```
|
|
3531
3730
|
|
|
3532
3731
|
- #### create
|
|
3732
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/post-v5-accounts-subaccounts)
|
|
3533
3733
|
|
|
3534
3734
|
`mg.subaccounts.create(name)`
|
|
3535
3735
|
|
|
@@ -3554,6 +3754,7 @@ A client to manage members within a specific mailing list.
|
|
|
3554
3754
|
| name | Name of the subaccount being created (ex. 'mysubaccount') |
|
|
3555
3755
|
|
|
3556
3756
|
- #### enable
|
|
3757
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/post-v5-accounts-subaccounts-subaccount_id-enable)
|
|
3557
3758
|
|
|
3558
3759
|
`mg.subaccounts.enable(subaccount_id)`
|
|
3559
3760
|
|
|
@@ -3571,6 +3772,7 @@ A client to manage members within a specific mailing list.
|
|
|
3571
3772
|
```
|
|
3572
3773
|
|
|
3573
3774
|
- #### disable
|
|
3775
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/post-v5-accounts-subaccounts-subaccount_id-disable)
|
|
3574
3776
|
|
|
3575
3777
|
`mg.subaccounts.disable(subaccount_id)`
|
|
3576
3778
|
|
|
@@ -3588,6 +3790,7 @@ A client to manage members within a specific mailing list.
|
|
|
3588
3790
|
```
|
|
3589
3791
|
|
|
3590
3792
|
- #### destroy
|
|
3793
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/delete-v5-accounts-subaccounts-subaccount_id)
|
|
3591
3794
|
|
|
3592
3795
|
`mg.subaccounts.destroy(subaccount_id)`
|
|
3593
3796
|
|
|
@@ -3605,8 +3808,9 @@ A client to manage members within a specific mailing list.
|
|
|
3605
3808
|
```
|
|
3606
3809
|
|
|
3607
3810
|
- #### setMonthlySendingLimit
|
|
3811
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/put-v5-accounts-subaccounts-subaccount_id-limit-custom-monthly)
|
|
3608
3812
|
|
|
3609
|
-
|
|
3813
|
+
`mg.subaccounts.setMonthlySendingLimit(subaccount_id, limit)`
|
|
3610
3814
|
|
|
3611
3815
|
Example:
|
|
3612
3816
|
|
|
@@ -3622,6 +3826,7 @@ A client to manage members within a specific mailing list.
|
|
|
3622
3826
|
```
|
|
3623
3827
|
|
|
3624
3828
|
- #### getMonthlySendingLimit
|
|
3829
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/get-v5-accounts-subaccounts-subaccount_id-limit-custom-monthly)
|
|
3625
3830
|
|
|
3626
3831
|
`mg.subaccounts.getMonthlySendingLimit(subaccount_id)`
|
|
3627
3832
|
|
|
@@ -3639,6 +3844,8 @@ A client to manage members within a specific mailing list.
|
|
|
3639
3844
|
```
|
|
3640
3845
|
|
|
3641
3846
|
- #### updateSubaccountFeature
|
|
3847
|
+
[API Reference](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/subaccounts/put-v5-accounts-subaccounts-subaccount_id-features)
|
|
3848
|
+
|
|
3642
3849
|
`mg.subaccounts.updateSubaccountFeature(subaccount_id, featuresValues)`
|
|
3643
3850
|
|
|
3644
3851
|
Example:
|
|
@@ -3670,9 +3877,12 @@ A client to manage members within a specific mailing list.
|
|
|
3670
3877
|
|
|
3671
3878
|
### Inbox Placements
|
|
3672
3879
|
A client to allows you to see the likely deliverability of your email campaigns.
|
|
3880
|
+
|
|
3673
3881
|
- #### SeedsLists
|
|
3674
3882
|
|
|
3675
3883
|
- #### list
|
|
3884
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists)
|
|
3885
|
+
|
|
3676
3886
|
`mg.inboxPlacements.seedsLists.list()`
|
|
3677
3887
|
|
|
3678
3888
|
Example:
|
|
@@ -3766,6 +3976,8 @@ A client to manage members within a specific mailing list.
|
|
|
3766
3976
|
```
|
|
3767
3977
|
|
|
3768
3978
|
- #### get
|
|
3979
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists--address-)
|
|
3980
|
+
|
|
3769
3981
|
`mg.inboxPlacements.seedsLists.get(seedsListId)`
|
|
3770
3982
|
|
|
3771
3983
|
Example:
|
|
@@ -3848,6 +4060,8 @@ A client to manage members within a specific mailing list.
|
|
|
3848
4060
|
```
|
|
3849
4061
|
|
|
3850
4062
|
- #### create
|
|
4063
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/post-v4-inbox-seedlists)
|
|
4064
|
+
|
|
3851
4065
|
```js
|
|
3852
4066
|
mg.inboxPlacements.seedsLists.create({
|
|
3853
4067
|
name: 'seedLists name',
|
|
@@ -3909,6 +4123,7 @@ A client to manage members within a specific mailing list.
|
|
|
3909
4123
|
```
|
|
3910
4124
|
|
|
3911
4125
|
- #### update
|
|
4126
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/put-v4-inbox-seedlists--address-)
|
|
3912
4127
|
|
|
3913
4128
|
```JS
|
|
3914
4129
|
mg.inboxPlacements.seedsLists.update(seedsListId,{
|
|
@@ -3970,6 +4185,8 @@ A client to manage members within a specific mailing list.
|
|
|
3970
4185
|
```
|
|
3971
4186
|
|
|
3972
4187
|
- #### destroy
|
|
4188
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/delete-v4-inbox-seedlists--address-)
|
|
4189
|
+
|
|
3973
4190
|
```js
|
|
3974
4191
|
mg.inboxPlacements.seedsLists.destroy(seedsListId)
|
|
3975
4192
|
```
|
|
@@ -3993,6 +4210,9 @@ A client to manage members within a specific mailing list.
|
|
|
3993
4210
|
- #### Attributes
|
|
3994
4211
|
|
|
3995
4212
|
- #### list
|
|
4213
|
+
|
|
4214
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists-a)
|
|
4215
|
+
|
|
3996
4216
|
`mg.inboxPlacements.seedsLists.attributes.list()`
|
|
3997
4217
|
|
|
3998
4218
|
Example:
|
|
@@ -4014,7 +4234,9 @@ A client to manage members within a specific mailing list.
|
|
|
4014
4234
|
```
|
|
4015
4235
|
|
|
4016
4236
|
- #### get
|
|
4017
|
-
|
|
4237
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists-a--attribute-)
|
|
4238
|
+
|
|
4239
|
+
`mg.inboxPlacements.seedsLists.attributes.get('attribute_name');`
|
|
4018
4240
|
|
|
4019
4241
|
Example:
|
|
4020
4242
|
```JS
|
|
@@ -4036,6 +4258,8 @@ A client to manage members within a specific mailing list.
|
|
|
4036
4258
|
- #### Filters
|
|
4037
4259
|
|
|
4038
4260
|
- #### list
|
|
4261
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-seedlists--filters)
|
|
4262
|
+
|
|
4039
4263
|
`mg.inboxPlacements.seedsLists.filters.list()`
|
|
4040
4264
|
|
|
4041
4265
|
Example:
|
|
@@ -4063,6 +4287,8 @@ A client to manage members within a specific mailing list.
|
|
|
4063
4287
|
- #### Providers
|
|
4064
4288
|
|
|
4065
4289
|
- #### list
|
|
4290
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-providers)
|
|
4291
|
+
|
|
4066
4292
|
List all available email providers.
|
|
4067
4293
|
|
|
4068
4294
|
`mg.inboxPlacements.providers.list()`
|
|
@@ -4093,6 +4319,8 @@ A client to manage members within a specific mailing list.
|
|
|
4093
4319
|
- #### Results
|
|
4094
4320
|
|
|
4095
4321
|
- #### list
|
|
4322
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results)
|
|
4323
|
+
|
|
4096
4324
|
Get the details for all placement test results.
|
|
4097
4325
|
|
|
4098
4326
|
```js
|
|
@@ -4224,6 +4452,9 @@ A client to manage members within a specific mailing list.
|
|
|
4224
4452
|
|
|
4225
4453
|
Get the details for a single result.
|
|
4226
4454
|
|
|
4455
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results--result-)
|
|
4456
|
+
|
|
4457
|
+
|
|
4227
4458
|
`mg.inboxPlacements.results.get(IBPResultId)`
|
|
4228
4459
|
|
|
4229
4460
|
Example:
|
|
@@ -4326,6 +4557,8 @@ A client to manage members within a specific mailing list.
|
|
|
4326
4557
|
```
|
|
4327
4558
|
|
|
4328
4559
|
- #### destroy
|
|
4560
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/delete-v4-inbox-results--result-)
|
|
4561
|
+
|
|
4329
4562
|
Delete the result and all associated information.
|
|
4330
4563
|
|
|
4331
4564
|
`mg.inboxPlacements.results.destroy(IBPResultId)`
|
|
@@ -4348,6 +4581,9 @@ A client to manage members within a specific mailing list.
|
|
|
4348
4581
|
|
|
4349
4582
|
- #### getResultByShareId
|
|
4350
4583
|
Get a result by the share ID.
|
|
4584
|
+
|
|
4585
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-sharing-public--shareid-)
|
|
4586
|
+
|
|
4351
4587
|
```js
|
|
4352
4588
|
mg.inboxPlacements.results.getResultByShareId('result_sharing_id')
|
|
4353
4589
|
```
|
|
@@ -4454,6 +4690,8 @@ A client to manage members within a specific mailing list.
|
|
|
4454
4690
|
- #### Attributes
|
|
4455
4691
|
|
|
4456
4692
|
- #### list
|
|
4693
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results-a)
|
|
4694
|
+
|
|
4457
4695
|
`mg.inboxPlacements.results.attributes.list()`
|
|
4458
4696
|
|
|
4459
4697
|
Example:
|
|
@@ -4475,6 +4713,8 @@ A client to manage members within a specific mailing list.
|
|
|
4475
4713
|
```
|
|
4476
4714
|
|
|
4477
4715
|
- #### get
|
|
4716
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results-a--attribute-)
|
|
4717
|
+
|
|
4478
4718
|
`mg.inboxPlacements.attributes.get('attribute_name');`
|
|
4479
4719
|
|
|
4480
4720
|
Example:
|
|
@@ -4497,6 +4737,8 @@ A client to manage members within a specific mailing list.
|
|
|
4497
4737
|
- #### Filters
|
|
4498
4738
|
|
|
4499
4739
|
- #### list
|
|
4740
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-results--filters)
|
|
4741
|
+
|
|
4500
4742
|
`mg.inboxPlacements.results.filters.list()`
|
|
4501
4743
|
|
|
4502
4744
|
Example:
|
|
@@ -4522,9 +4764,12 @@ A client to manage members within a specific mailing list.
|
|
|
4522
4764
|
```
|
|
4523
4765
|
|
|
4524
4766
|
- #### Sharing
|
|
4767
|
+
|
|
4525
4768
|
- #### get
|
|
4526
4769
|
The sharing status of a result.
|
|
4527
4770
|
|
|
4771
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/get-v4-inbox-sharing--result-)
|
|
4772
|
+
|
|
4528
4773
|
`mg.inboxPlacements.results.sharing.get('result_id');`
|
|
4529
4774
|
Example:
|
|
4530
4775
|
```JS
|
|
@@ -4547,6 +4792,8 @@ A client to manage members within a specific mailing list.
|
|
|
4547
4792
|
- #### update
|
|
4548
4793
|
Change the sharing status of a result or create a new share URL
|
|
4549
4794
|
|
|
4795
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/put-v4-inbox-sharing--result-)
|
|
4796
|
+
|
|
4550
4797
|
`mg.inboxPlacements.results.sharing.update('result_id', IPRSharingUpdateData);`
|
|
4551
4798
|
|
|
4552
4799
|
Example:
|
|
@@ -4575,6 +4822,8 @@ A client to manage members within a specific mailing list.
|
|
|
4575
4822
|
|
|
4576
4823
|
'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%.
|
|
4577
4824
|
|
|
4825
|
+
[API Reference](https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready/inbox-placement/post-v4-inbox-tests)
|
|
4826
|
+
|
|
4578
4827
|
`mg.inboxPlacements.runTest(InboxPlacementsData);`
|
|
4579
4828
|
|
|
4580
4829
|
Example:
|