Create tracking opt-out
Add an email address to the tracking opt-out list for a sending domain. Opted-out addresses are excluded from open and click tracking on that domain.
Rate limit: 10 requests per minute per account.
post
Authorizations
Api-TokenstringRequired
API token in Api-Token header
Body
emailstring · emailRequiredExample:
Email address to opt out of tracking
tracked@example.comdomain_idintegerRequiredExample:
ID of the sending domain this tracking opt-out applies to
12345Responses
201
Tracking opt-out created
application/json
401
Returns unauthorized error message. Check your credentials.
application/json
403
Returns forbidden error message. Check your permissions.
application/json
422
Validation errors
application/json
429
Rate limit exceeded for the current account.
application/json
post/api/tracking_opt_outs
cURLcurl -X POST https://mailtrap.io/api/tracking_opt_outs \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"email": "tracked@example.com",
"domain_id": 12345
}'
{
"data": {
"id": "64d71bf3-1276-417b-86e1-8e66f138acfe",
"email": "tracked@example.com",
"created_at": "2025-01-15T10:30:00Z",
"domain_name": "example.com"
}
}Last updated
Was this helpful?

