The Mailsac API allows interaction with Mailsac services, including email checking, validation, forwarding setup, web socket email messages reception, and outbound mail sending.
Test the Mailsac API online: Swagger UI Explorer
Base API Endpoint: https://mailsac.com/api/
All API documentation is relative to this endpoint.
- API Documentation
- Full Documentation and Guides
- Community Support and Discussion Forums
- Web socket example in Node.js - ruffrey
- Terms of Service
- Privacy Policy
For paid email support and pre-sales, contact us at support@team.mailsac.com.
This package requires Python 2.7 or 3.4 and above.
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import client Install via Setuptools.
python setup.py install --user(or sudo python setup.py install to install the package for all users)
Then import the package:
import clientPlease follow the installation procedure and then run the following:
from __future__ import print_function
import time
import client
from client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = client.Configuration()
configuration.api_key['Mailsac-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Mailsac-Key'] = 'Bearer'
# Configure API key authorization: APIKeyQueryParam
configuration = client.Configuration()
configuration.api_key['_mailsacKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['_mailsacKey'] = 'Bearer'
# create an instance of the API class
api_instance = client.AccountApi(client.ApiClient(configuration))
try:
# Get account stats
api_response = api_instance.account_stats()
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->account_stats: %s\n" % e)
# Configure API key authorization: APIKeyHeader
configuration = client.Configuration()
configuration.api_key['Mailsac-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Mailsac-Key'] = 'Bearer'
# Configure API key authorization: APIKeyQueryParam
configuration = client.Configuration()
configuration.api_key['_mailsacKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['_mailsacKey'] = 'Bearer'
# create an instance of the API class
api_instance = client.AccountApi(client.ApiClient(configuration))
try:
# Get current account
api_response = api_instance.user()
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->user: %s\n" % e)All URIs are relative to https://mailsac.com/api
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccountApi | account_stats | GET /me/stats | Get account stats |
| AccountApi | user | GET /me | Get current account |
| AddressesApi | check_availability | GET /addresses/{email}/availability | Check address ownership |
| AddressesApi | create_address | POST /addresses/{email} | Reserve (create/own) a private email address |
| AddressesApi | create_addresses | POST /private-addresses-bulk | Reserve multiple private addresses |
| AddressesApi | delete_address | DELETE /addresses/{email} | Release a private email address |
| AddressesApi | get_address | GET /addresses/{email} | Fetch an address or check if it is reserved |
| AddressesApi | list_addresses | GET /addresses | List all private email addresses |
| AddressesApi | update_address | PUT /addresses/{email} | Update private email address forwarding and metadata |
| AttachmentsApi | count_public_attachments | GET /mailstats/common-attachments/{md5sum}/count | Count public attachments |
| AttachmentsApi | download_attachment | GET /addresses/{email}/messages/{messageId}/attachments/{attachmentIdentifier} | Download email attachment |
| AttachmentsApi | download_public_attachment | GET /mailstats/common-attachments/{md5sum}/download | Download public attachment |
| AttachmentsApi | list_message_attachments | GET /addresses/{email}/messages/{messageId}/attachments | List attachments for an email message |
| AttachmentsApi | list_messages_for_attachment | GET /mailstats/common-attachments/{md5sum} | List public messages with an attachment |
| AttachmentsApi | list_public_attachments | GET /mailstats/common-attachments | Search for attachments |
| DomainsApi | list_domains | GET /domains | List domains |
| MessagesApi | add_message_label | PUT /addresses/{email}/messages/{messageId}/labels/{label} | Add a label to a message |
| MessagesApi | count_messages | GET /addresses/{email}/message-count | Count messages for an email inbox |
| MessagesApi | delete_all_domain_messages | POST /domains/{domain}/delete-all-domain-mail | Delete all messages in a domain |
| MessagesApi | delete_all_messages | DELETE /addresses/{email}/messages | Delete all messages for an email inbox |
| MessagesApi | delete_message | DELETE /addresses/{email}/messages/{messageId} | Delete an email message |
| MessagesApi | delete_message_label | DELETE /addresses/{email}/messages/{messageId}/labels/{label} | Remove a label from a message |
| MessagesApi | filter_inbox_messages | GET /inbox-filter | Filter messages in account by to, from, and/or subject |
| MessagesApi | get_body_dirty | GET /dirty/{email}/{messageId} | Get message HTML body (dirty) |
| MessagesApi | get_body_plain_text | GET /text/{email}/{messageId} | Get message plaintext |
| MessagesApi | get_body_sanitized | GET /body/{email}/{messageId} | Get the message HTML body (sanitized) |
| MessagesApi | get_full_raw_message | GET /raw/{email}/{messageId} | Get original SMTP message |
| MessagesApi | get_headers | GET /addresses/{email}/messages/{messageId}/headers | Get parsed message headers |
| MessagesApi | get_message_metadata | GET /addresses/{email}/messages/{messageId} | Get email message metadata |
| MessagesApi | list_domain_messages | GET /domains/{domain}/messages | List messages for an domain |
| MessagesApi | list_inbox_messages | GET /inbox | Get all account messages paginated |
| MessagesApi | list_messages | GET /addresses/{email}/messages | List messages for an email inbox |
| MessagesApi | list_starred_messages | GET /addresses/starred/messages | List starred (saved) messages on the account |
| MessagesApi | search_inbox_messages | GET /inbox-search | Search messages by to, from, and subject |
| MessagesApi | set_message_folder | PUT /addresses/{email}/messages/{messageId}/folder/{folder} | Move a message into a folder |
| MessagesApi | set_message_read_status | PUT /addresses/{email}/messages/{messageId}/read/{readBoolean} | Set message read/unread status |
| MessagesApi | toggle_message_star | PUT /addresses/{email}/messages/{messageId}/star | Star (save) a message |
| WebSocketsApi | do_not_use_web_socket_docs_only | POST /custom_web_sockets | Connect a web socket to wss://sock.mailsac.com/incoming-messages |
| WebhooksApi | do_not_use_webhook_docs_only | POST /custom_webhooks | Receive a webhook email message on your server |
| EmailValidationApi | validate_address | GET /validations/addresses/{email} | Validate an email address and if it is disposable |
| EmailValidationApi | validate_addresses_bulk | POST /validations/addresses | Validate up to 50 email addresses |
| MessageStatsApi | check_denylist | GET /mailstats/blacklist/{domainOrIP} | Check IP or domain on deny-list |
| MessageStatsApi | denylist | GET /mailstats/blacklist | List the current deny-list |
| MessageStatsApi | list_top_public_addresses | GET /mailstats/top-addresses | List top public disposable email addresses receiving messages |
| MessageStatsApi | list_top_public_domains | GET /mailstats/top-domains | List top public domains receiving disposable messages |
| MessageStatsApi | list_top_public_senders | GET /mailstats/top-senders | List top sender email addresses for disposable public messages |
- AllOfEmailMessageWebSocketFrameEmail
- AttachmentIdentifier
- AttachmentMeta
- ByteEncoding
- CommonAttachments
- CurrentUserInfo
- CurrentUserStats
- Domain
- DomainString
- DomainsList
- EmailAddress
- EmailAddressAvailability
- EmailAddressIntegrity
- EmailAddressIntegrityList
- EmailAddressList
- EmailAttachment
- EmailAttachmentList
- EmailMessage
- EmailMessageBodyProps
- EmailMessageList
- EmailMessageShort
- EmailMessageWebSocketFrame
- EmailMessageWebhook
- EmailRecipient
- EmailString
- EmailStringList
- EmailSubject
- ErrorResponseBody
- InlineResponse200
- InlineResponse2001
- InlineResponse20010
- InlineResponse20011
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- InlineResponse2005
- InlineResponse2006
- InlineResponse2007
- InlineResponse2008
- InlineResponse2009
- Limit
- Md5sum
- MessageFolder
- MessageHeaders
- MessageId
- MessageLabel
- MessageLabels
- ModelDate
- NotEnoughCreditsResponse
- PrivateaddressesbulkBody
- ReadBoolean
- ReceivedHeaders
- ReceivedHeadersList
- SendMessage
- SendMessageFrom
- SendMessageTo
- Skip
- TooManyRecipientsResponse
- UpdatePrivateAddressForwarding
- ValidationsAddressesBody
- Type: API key
- API key parameter name: Mailsac-Key
- Location: HTTP header
- Type: API key
- API key parameter name: _mailsacKey
- Location: URL query string