Unsubscribe list stores email addresses of recipients who unsubscribed from your mailings by clicking a Mailgun generated unsubscribe link.
Import a CSV file containing a list of addresses to add to the unsubscribe list. The CSV file must be 25MB or under and can contain the following column headers: address, tags, created_at. address is a valid email address (required). tags is tag to unsubscribe from, use * to unsubscribe an address from all domain's correspondence (optional, default: *). created_at is timestamp of unsubscribe event in RFC2822 format (optional, default: current time)
A 202 response
A 400 response
A 500 response
{- "message": "file uploaded successfully for processing. standby..."
}
Fetch a single unsubscribe record to check if a given address is present in a list of unsubscribed users.
{- "address": "alice@example.com",
- "tags": [
- "some tag"
], - "created_at": "Tue, 07 Jan 2025 19:25:45 UTC"
}
The delivery to the deleted email address resumes until it unsubscribes again.
{- "message": "Unsubscribe event has been removed",
- "address": "foo@bar.com"
}
Paginate over a list of unsubscribes for a domain.
A 200 response
required | Array of objects |
required | object |
A 400 response
{- "items": [
- {
- "address": "alice@example.com",
- "tags": [
- "some tag"
], - "created_at": "Tue, 07 Jan 2025 19:25:45 UTC"
}
], - "paging": {
- "previous": "<previous page url>",
- "first": "<first page url>",
- "next": "<next page url>",
- "last": "<last page url>"
}
}
Request body is expected to be a valid JSON encoded sting containing up to 1000 unsubscribe records or a single unsubscribe record as application/form-data
[- {
- "address": "alice@example.com",
- "tags": [
- "some tag"
], - "createdat": "Tue, 07 Jan 2025 19:25:45 UTC"
}, - {
- "address": "bob@example.com",
- "tags": [
- "*"
], - "createdat": "Mon, 01 Jan 0001 00:00:00 UTC"
}, - {
- "address": "carol@example.com",
- "tags": [ ],
- "createdat": "Mon, 01 Jan 0001 00:00:00 UTC"
}
]
{- "message": "4 addresses have been added to the unsubscribes table"
}
Clear all unsubscribe email addresses for the domain. Delivery to the deleted email addresses will no longer be suppressed.
{- "message": "Unsubscribe addresses for this domain have been removed"
}