Skip to content

Spam Traps Monitoring

Our spam trap monitoring service surfaces how much of your email is being sent to known spam traps.

List Spam Trap Hits

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.

Security
basicAuth
Query
startstring, (date-time)

The start timestamp in RFC3339 format(YYYY-MM-DDThh:mm:ssZ) of the timeframe for which you wish to see data. Default is 7 days ago

endstring, (date-time)

The end timestamp in RFC3339 format(YYYY-MM-DDThh:mm:ssZ) of the timeframe for which you wish to see data. Default is now

dimensionstring

Use this field to group results.

Enum ValueDescription
timestamp

Group by date

domain_name

Group by domain

ip

Group by IP address

sender

Group by sender address

from

Group by from

tags

Group by tags

subaccount

Group by subaccount

sortstring

Sort field and order, in form of 'field:order'

Default:"same as dimension"
ipArray of strings

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

domainArray of strings

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

senderArray of strings

Use this field to filter results by sender email address.

fromArray of strings

Use this field to filter results by from address.

limitintegerrequired

Limits the number of items returned in a request

include_subaccountsboolean

Include subaccounts

Default:false
curl -i -X GET \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v2/spamtraps?start=2019-08-24T14%3A15%3A22Z&end=2019-08-24T14%3A15%3A22Z&dimension=timestamp&sort=same%20as%20dimension&ip=string&domain=string&sender=string&from=string&limit=0&include_subaccounts=false'

Responses

A 200 response

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