Skip to content

Get Spam Trap Hits
deprecated

Request

Use this endpoint to understand how much of your mail being sent to known spam traps. This endpoint returns daily spam trap hit counts for a provided timerange, categorized by trap type. Deprecated: Use /v2/spamtraps endpoint.

Security
basicAuth
Query
startstringrequired

The start date in UTC (format YYYY-MM-DD) of the timeframe for which you wish to see data.

endstringrequired

The end date in UTC (format YYYY-MM-DD) of the timeframe for which you wish to see data.

sortbystring

Acceptable values include date, totals, domain, subject, ip, and from. Defaults to date.

groupbystring

Use this field to group results. Acceptable values include domain, subject, ip, and from.

subjectArray of strings

Use this field to filter results by email subject(s).

domainArray of strings

Use this field to filter results by domain(s).

ipArray of strings

Use this field to filter results by ip(s).

fromArray of strings

Use this field to filter results by from address.

limitintegerrequired

Limits the number of items returned in a request

curl -i -X GET \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v1/spamtraps?start=string&end=string&sortby=string&groupby=string&subject=string&domain=string&ip=string&from=string&limit=0'

Responses

A 200 response

Bodyapplication/json
itemsArray of objects(Spamtraps_Analytics_Service_github.com-mailgun-spamtraps-model-DatedTotals)required
pagingobject(Spamtraps_Analytics_Service_github.com-mailgun-spamtraps-api-PagingResponse)required
Response
{ "items": [ { … }, { … } ], "paging": {} }