Skip to content
Last updated

Inbox Placement

A seed list is an object that provides the mailing list for your inbox placement test. It also acts as a container for all the results of those tests and will aggregate the stats of all the tests.

When you create a seed list you will be provided a mailing list. You may adjust this mailing list as you see fit, but you must send to the target_email otherwise a placement test will not be run.

Generate a seed list

POST /v4/inbox/seedlists

The available form fields to generate a seed list are as follows:

FieldDescription
nameThe name that you would like to use for this seed list.
seed_filterA regular expression that will be applied to addresses in the mailing list.
curl -X POST https://api.mailgun.net/v4/inbox/seedlists \
  -F 'name=list' \
  --user 'api:<YOUR_API_KEY>'

Example response for creating a seed list.

{
  "kid": "610abd2009b08f382ac86c45",
  "created_at": "2021-08-04T16:15:28.08Z",
  "updated_at": "2021-08-04T16:15:28.08Z",
  "last_result_at": "0001-01-01T00:00:00Z",
  "target_email": "ibp-12345678-1234-1234-1234-123456789012@domain.com",
  "sending_domains": [],
  "has_results": false,
  "name": "My campaign inbox test",
  "seed_filter": ".*",
  "mailing_list": "ibp-12345678-1234-1234-1234-123456789012@domain.com,another@email.com",
  "delivery_stats": {
    "all": {
      "delivered": 0,
      "missing": 0,
      "pending": 0,
      "spam": 0,
      "inbox": 0,
      "total": 0,
      "provider": "all"
    }
  },
  "results": []
}

Field Explanation:

NameTypeDescription
kidstringUnique identifier for a seed list.
created_atdatetimeDate and time that seed list was created.
updated_atdatetimeDate and time that seed list was updated. Will update whenever it is changed.
last_result_atdatetimeDate and time that seed list was updated. Will update whenever a new result comes in.
target_emailstringThe required email address that must be included in a mailing list for an inbox placement test to work.
sending_domainsarrayThe list of possible domains that the messages must come from.
has_resultsboolA flag that is true when results exist for this seed list
namestringThe name of the seed list
seed_filterstringA regular expression value that will be used to filter the list of seeds in the seed list.
mailing_liststringA mailing list that contains the target email, and available seeds.
delivery_statsobjectAn object that contains sub-objects that describe delivery stats. See below.
resultsarrayAn array of results from the seed list's tests.

Delivery Stats

Delivery stats is an object that is included with seed list and results from the API. It is an attribute of the main object that is returned. A sample object:

"delivery_stats": {
  "all": {
    "delivered": 10,
    "missing": 1,
    "pending": 0,
    "spam": 3,
    "inbox": 6,
    "total": 10,
    "provider": "all"
  },
  "yahoo.com": {
    "delivered": 4,
    "missing": 1,
    "pending": 0,
    "spam": 0,
    "inbox": 4,
    "total": 5,
    "provider": "yahoo.com"
  },
  "gmail.com": {
    "delivered": 5,
    "missing": 0,
    "pending": 0,
    "spam": 3,
    "inbox": 2,
    "total": 5,
    "provider": "gmail.com"
  }
}

Field Explanation:

NameTypeDescription
sub-object -"subkey"objectThe sub-object of the main delivery_stats object is divided by provider. There will always be an "all" provider that is the total sum.
deliverednumberThe amount of messages that were received by the system.
missingnumberThe amount of messages that were not received by the required reporting time period.
pendingnumberThe amount of messages that have yet to be received within the required reporting time period.
spamnumberThe amount of messages that were detected in the provider's spam folder.
inboxnumberThe amount of messages that were detected in a non-spam folder.
totalnumberThe amount of messages that are expected.
providerstringThe provider that these mailboxes are a part of (identical to key).

Results

A result is an object summarizing Inbox Placement tests sent to the target_email.

{
  "result_id": "12345678-1234-1234-1234-123456789012",
  "subject": "IBP Test - 1",
  "sender": "generated@yourdomain.com",
  "delivery_stats": {
    "all": {
      "delivered": 7,
      "missing": 0,
      "pending": 0,
      "spam": 2,
      "inbox": 5,
      "total": 7,
      "provider": "all",
      "categories": {}
    }
  }
}

Field Explanation:

NameTypeDescription
result_idstringUnique identifier for a received test.
subjectstringThe subject of the email sent to the target_email.
senderstringSender address of the email sent to the target_email.
delivery_statsobjectAn object that contains sub-objects that describe delivery stats. See above.

Get all seed lists

GET /v4/inbox/seedlists

Get a list of all of your seed lists. You can filter this using the available filters. These can be listed from the "Get all available filters for seed lists" endpoint described below.

curl -s --user 'api:YOUR_API_KEY' -G \
    https://api.mailgun.net/v4/seedlists

Example response for listing seed lists.

{
  "items": [
    {
      "kid": "123456789123456789123456",
      "created_at": "2021-08-02T23:10:17.915Z",
      "updated_at": "2021-08-03T17:26:55.629Z",
      "last_result_at": "2021-08-03T17:26:55.629Z",
      "target_email": "ibp-12345678-1234-1234-1234-123456789012@domain.com",
      "sending_domains": [
        "mydomain.com"
      ],
      "has_results": true,
      "name": "Inbox Placement Test",
      "seed_filter": ".*",
      "mailing_list": "ibp-12345678-1234-1234-1234-123456789012@domain.com,some@where.com",
      "delivery_stats": {
        "all": {
          "delivered": 7,
          "missing": 0,
          "pending": 0,
          "spam": 2,
          "inbox": 5,
          "total": 7,
          "provider": "all"
        }
      },
      "results": [
        {
          "result_id": "12345678-1234-1234-1234-123456789012",
          "subject": "IBP Test - 1",
          "sender": "generated@yourdomain.com",
          "delivery_stats": {
            "all": {
              "delivered": 7,
              "missing": 0,
              "pending": 0,
              "spam": 2,
              "inbox": 5,
              "total": 7,
              "provider": "all",
              "categories": {}
            }
          }
        }
      ]
    }
  ],
  "paging": {
    "first": "http://domain.com/v4/inbox/seedlists?ascending=0&limit=1",
    "last": "http://domain.com/v4/inbox/seedlists?ascending=1&limit=1",
    "next": "http://domain.com/v4/inbox/seedlists?ascending=0&cursor=123987123981723987873497&limit=1",
    "previous": "http://domain.com/v4/inbox/seedlists?ascending=1&cursor=123987123981723987873487&limit=1"
  },
  "total": 32
}

Field Explanation:

NameTypeDescription
itemsarrayA list of seed list objects (same fields as above).
pagingobjectA paging sub-object to navigate through sections of data.
totalnumberThe total amount of seed lists.

Paging sub-object

The paging sub-object assists with navigating paginated responses. For a variety of reasons the number of items that can be returned in a response has been limited. This object contains the following fields:

NameTypeDescription
firsturlA url address to the first item of this set
lasturlA url address to the last item of this set
nexturlA url address to the next item of this set
previousurlA url address to the previous item of this set

Additionally you can interact with the pagination through a few fields added to the query-string of your request:

NameTypeDescription
limitnumberA limit on the number of items that can be returned (defaults to 25)
offsetnumberA the amount of items to "move" by
ascendingboolA flag that will set the order of the pagination
cursorstringA unique id that can be used as a "pivot" of where you are in the set
sortstringThe parameter to sort by (EXPERIMENTAL)

Note: cursor and offset may not both be used at the same time

Get a seed list

You can select a single seed list with this endpoint.

GET /v4/inbox/seedlists/ibp-seedlist-address@domain.net

Example response of getting a single seed list.

{
  "kid": "610abd2009b08f382ac86c45",
  "created_at": "2021-08-04T16:15:28.08Z",
  "updated_at": "2021-08-04T16:15:28.08Z",
  "last_result_at": "0001-01-01T00:00:00Z",
  "target_email": "ibp-seedlist-address@domain.net",
  "sending_domains": [
    "yourdomain.com"
  ],
  "has_results": false,
  "name": "My campaign inbox test",
  "seed_filter": ".*",
  "mailing_list": "ibp-seedlist-address@domain.net,another@email.com",
  "delivery_stats": {
    "all": {
      "delivered": 0,
      "missing": 0,
      "pending": 0,
      "spam": 0,
      "inbox": 0,
      "total": 0,
      "provider": "all"
    }
  },
  "results": [
    {
      "result_id": "12345678-1234-1234-1234-123456789012",
      "subject": "IBP Test - 1",
      "sender": "generated@yourdomain.com",
      "delivery_stats": {
        "all": {
          "delivered": 7,
          "missing": 0,
          "pending": 0,
          "spam": 2,
          "inbox": 5,
          "total": 7,
          "provider": "all",
          "categories": {}
        }
      }
    }
  ]
}
NameTypeDescription
kidstringUnique identifier for a seed list.
created_atdatetimeDate and time that seed list was created.
updated_atdatetimeDate and time that seed list was updated. Will update whenever it is changed.
last_result_atdatetimeDate and time that seed list was updated. Will update whenever a new result comes in.
target_emailstringThe required email address that must be included in a mailing list for an inbox placement test to work.
sending_domainsarrayThe list of possible domains that the messages must come from.
has_resultsboolA flag that is true when results exist for this seed list
namestringThe name of the seed list
seed_filterstringA regular expression value that will be used to filter the list of seeds in the seed list.
mailing_liststringA mailing list that contains the target email, and available seeds.
delivery_statsobjectAn object that contains sub-objects that describe delivery stats. See below.
resultsarrayAn array of results from the seed list's tests.

Get all iterable attributes of seed lists

You can use this endpoint to find all attributes that are available for listing values of.

GET /v4/inbox/seedlists/a
NameTypeDescription
attributestringA string describing what was selected.
valuesarrayA list of attributes that can be retrieved from the API.

Get all values of a specific attribute of your seed lists

You can use this endpoint to find all the values for a particular attribute. This can be used to produce autocomplete or suggestions from a frontend.

GET /v4/inbox/seedlists/a/attribute
curl -s --user 'api:YOUR_API_KEY' -G \
    https://api.mailgun.net/v4/inbox/seedlists/a/ATTRIBUTE

Example response of seed list attribute values.

{
 "items": {
   "attribute": "name",
   "values": [
     "Inbox Placement Test",
     "My email campaign"
   ]
 }
}
NameTypeDescription
attributestringA string describing what was selected.
valuesarrayA list of attributes that can be retrieved from the API.

Get all available filters for seed lists

You can use this endpoint to list the available filters for seed lists.

GET /v4/inbox/seedlists/\_filters
{
 "items": {
   "attribute": "name",
   "values": [
     "Inbox Placement Test",
     "My email campaign"
   ]
 }
}

Example response of seed list filters.

{
 "supported_filters": {
   "filters": [
     {
       "parameter": "name",
       "description": "Get seedlists by name"
     },
     {
       "parameter": "time_before",
       "description": "Get seedlists before date"
     },
     {
       "parameter": "time_after",
       "description": "Get seedlists after date"
     }
   ]
 }
}
NameTypeDescription
parameterstringThe key of the parameter you can pass in your query string.
descriptionstringA description of the filter

Delete a seed list

You can delete a seed list with this endpoint. The results under it will not be kept.

DELETE /v4/inbox/seedlists/ibp-seedlist-address@domain.net
curl -s --user 'api:YOUR_API_KEY' -X DELETE -G \
    https://api.mailgun.net/v4/inbox/seedlists/TARGET_EMAIL

This does not return any value.

Update a seed list

You can update a seed list with this endpoint. Modifying the sending domains or the seed filter will not affect historical results.

PUT /v4/inbox/seedlists/ibp-seedlist-address@domain.net

Update a seed list. The available form fields are as follows:

FieldDescription
sending_domainsUpdate the sending domains of the seed list. You can specify this multiple times.
nameUpdate the name of the seed list.
seed_filterUpdate the regular expression that will be applied to addresses in the mailing list.
curl -X PUT https://api.mailgun.net/v4/inbox/seedlists/TARGET_EMAIL \
  -F 'sending_domains=domain.com' \
  --user 'api:<YOUR_API_KEY>'

Example Response

{
"kid": "610abd2009b08f382ac86c45",
"created_at": "2021-08-04T16:15:28.08Z",
"updated_at": "2021-08-04T16:15:28.08Z",
"last_result_at": "0001-01-01T00:00:00Z",
"target_email": "ibp-seedlist-address@domain.net",
"sending_domains": [
  "yourdomain.com"
],
"has_results": false,
"name": "My campaign inbox test",
"seed_filter": ".*",
"mailing_list": "ibp-seedlist-address@domain.net,another@email.com",
"delivery_stats": {
  "all": {
    "delivered": 0,
    "missing": 0,
    "pending": 0,
    "spam": 0,
    "inbox": 0,
    "total": 0,
    "provider": "all"
  }
},
"results": []
}
NameTypeDescription
kidstringUnique identifier for a seed list.
created_atdatetimeDate and time that seed list was created.
updated_atdatetimeDate and time that seed list was updated. Will update whenever it is changed.
last_result_atdatetimeDate and time that seed list was updated. Will update whenever a new result comes in.
target_emailstringThe required email address that must be included in a mailing list for an inbox placement test to work.
sending_domainsarrayThe list of possible domains that the messages must come from.
has_resultsboolA flag that is true when results exist for this seed list
namestringThe name of the seed list
seed_filterstringA regular expression value that will be used to filter the list of seeds in the seed list.
mailing_liststringA mailing list that contains the target email, and available seeds.
delivery_statsobjectAn object that contains sub-objects that describe delivery stats. See below.
resultsarrayAn array of results from the seed list's tests.

List Results

Test results are generated when a message has been received at the target_email. If a message is not received at the target email no seed test will be run. Results will contain the status of the monitored mail boxes and will provide stats of the test.

GET /v4/inbox/results

List all results for your account.

FieldDescription
senderFilter results by sender address
providerFilter which results show up in seed_results by provider
subjectFilter results by a subject
target_emailFilter results by a target_email address
curl -s --user 'api:YOUR_API_KEY' -G \
    https://api.mailgun.net/v4/inbox/results

Example Response

{
 "items": [
   {
     "rid": "123456789012345678901234",
     "result_id": "12345678-1234-1234-1234-123456789012",
     "keybox_email": "ibp-00410325-1c95-492e-bc35-c19899802494@mailgun.net",
     "subject": "A subject of things",
     "sender": "person@domain.com",
     "name": "Such list",
     "created_at": "2021-08-03T14:20:40.301Z",
     "updated_at": "2021-08-03T14:36:53.841Z",
     "seed_results": [
       {
         "email": "mail@box.com",
         "provider": "box.com",
         "destination": "inbox",
         "state": "delivered",
         "originating_ip": "123.123.123.123",
         "tags": [
           "inbox"
         ],
         "spf": "pass",
         "dkim": "pass",
         "dmarc": "pass"
       }
     ]
   }
 ]
}
NameTypeDescription
ridstringUnique identifier for a results.
keybox_emailstringThe target email of the seed list associated with this result.
subjectstringThe subject of the email received by the seed list mailbox (target_email)
senderstringThe email address of the sender received by the seed list mailbox (target_email). All other results must come from the same sender.
namestringThe name of the seed list.
created_atdatetimeDate and time that the results were created.
updated_atdatetimeDate and time that the results were updated. Will update whenever a mailbox within the test receives mail.
seed_resultsobjectA sub-object that contains the status of each individual seed mailbox.
statusstringWill show "processing" or "complete".
delivery_statsobjectA sub-object that provides the stats of this result.

Seed Results

The seed results sub-object will provide the details of the individual seed mail boxes.

Field Explanation:

NameTypeDescription
emailstringThe email address of the mailbox.
providerstringThe email provider of the mailbox (usually the domain).
destinationstringEither "inbox" or "spam"
statestringWhether or not the mailbox has received a message
originating_ipstringThe IP address from which the message came from (if available)
tagsarrayThe folder, or labels of where the message ended up.
spfstringSPF email authentication results (if available). Possible values are "pass", "fail", and "missing/not-set".
dkimstringResults from DKIM evaluation (if available). Possible values are "pass", "fail", and "missing/not-set".
dmarcstringDMARC email authentication results (if available). Possible values are "pass", "fail", and "missing/not-set".

Get Available Result Filters

GET /v4/inbox/results/\_filters
curl -s --user 'api:YOUR_API_KEY' -G \
    https://api.mailgun.net/v4/results/_filters

Example response of getting the available results filters.

{
  "supported_filters": {
    "filters": [
      {
        "parameter": "senderaddr",
        "description": "Sender address"
      },
      {
        "parameter": "subject",
        "description": "Subject line"
      },
      {
        "parameter": "provider",
        "description": "E-mail provider"
      },
      {
        "parameter": "target_email",
        "description": "Seedlist target e-mail"
      },
      {
        "parameter": "time_before",
        "description": "Get results before date"
      },
      {
        "parameter": "time_after",
        "description": "Get results after date"
      }
    ]
  }
}

Get all iterable attributes of results

GET /v4/inbox/results/a

Example response of getting the result attributes.

{
  "items": {
    "attribute": "available attributes",
    "values": [
      "subject",
      "sender"
    ]
  }
}

Get all values of a specific attribute of your results lists

GET /v4/inbox/results/a/attribute
curl -s --user 'api:YOUR_API_KEY' -G \
    https://api.mailgun.net/v4/inbox/results/a/ATTRIBUTE

You can use this endpoint to find all the values for a particular attribute. This can be used to produce autocomplete or suggestions from a frontend.

Example response of response attribute values.

{
  "items": {
    "attribute": "subject",
    "values": [
      "This is a subject",
      "We've been trying to contact you",
      "about your car's extended warranty"
    ]
  }
}

Get a specific result

GET /v4/inbox/results/UUID
curl -s --user 'api:YOUR_API_KEY' -G \
    https://api.mailgun.net/v4/inbox/results/UUID

You can use this endpoint to get a single result.

NameTypeDescription
ridstringUnique identifier for a results.
keybox_emailstringThe target email of the seed list associated with this result.
subjectstringThe subject of the email received by the seed list mailbox (target_email)
senderstringThe email address of the sender received by the seed list mailbox (target_email). All other results must come from the same sender.
namestringThe name of the seed list.
created_atdatetimeDate and time that the results were created.
updated_atdatetimeDate and time that the results were updated. Will update whenever a mailbox within the test receives mail.
seed_resultsobjectA sub-object that contains the status of each individual seed mailbox.
statusstringWill show "processing" or "complete".
delivery_statsobjectA sub-object that provides the stats of this result.

Example response

{
 "result": {
   "rid": "123456789012345678901234",
   "result_id": "12345678-1234-1234-1234-123456789012",
   "keybox_email": "ibp-00410325-1c95-492e-bc35-c19899802494@mailgun.net",
   "subject": "A subject of things",
   "sender": "person@domain.com",
   "name": "Such list",
   "created_at": "2021-08-03T14:20:40.301Z",
   "updated_at": "2021-08-03T14:36:53.841Z",
   "seed_results": [
     {
       "email": "mail@box.com",
       "provider": "box.com",
       "destination": "inbox",
       "state": "delivered",
       "originating_ip": "123.123.123.123",
       "tags": [
         "inbox"
       ],
       "spf": "pass",
       "dkim": "pass",
       "dmarc": "pass"
     }
   ]
 }
}

Delete results

Use this endpoint to delete a result.

DELETE /v4/inbox/results/UUID
curl -s --user 'api:YOUR_API_KEY' -X DELETE -G \
    https://api.mailgun.net/v4/inbox/results/UUID

This does not return any value.

Create a test

Use this endpoint to create an Inbox Placement test.

POST /v4/inbox/tests

Field Explanation:

NameTypeDescription
fromstringRequired. The email address from which the email should be sent. Note, the provided domain must be verified within your Mailgun account.
subjectstringRequired. The subject of the email.
htmlstringRequired. The body of the email represented in HTML.
provider_filterlistOptional. A list of provider domains. This field can be used to test inbox placement against a subset of provider(s). See the List Providers section for available providers.
seed_liststringOptional. The identifier for the seedlist you wish to use.
curl -X POST https://api.mailgun.net/v4/inbox/tests \
  --data-raw '{
    "from": "user@domain.com",
    "subject": "testSubject",
    "html": "<html>HTML version of the body</html>"
  }
  ' \
  --user 'api:<YOUR_API_KEY'>'

Below is an example of the returned response body.

{
   "result_id": "1a066d4a-2207-4240-9e89-9e1a55511f0e",
   "links": {
     "results": "https://api.mailgun.net/v4/inbox/results/1a066d4a-2207-4240-9e89-9e1a55511f0e"
   }
}

List Providers

Use this endpoint to retrieve a list of providers available for Inbox Placement testing.

GET /v4/inbox/providers

Below is an example of the returned response body.

{
  "items": [
    {
      "domain": "hotmail.com",
      "display_name": "Hotmail",
      "region": "Global",
    },
    {
      "domain": "gmail.com",
      "display_name": "Gmail",
      "region": "Global",
    },
    ...
  ]
}