Skip to main content

Hostinger Mail API Python SDK

PyPI version

About

This is a Python SDK for the Hostinger API.

Requirements.

Python 3.11+

Installation & Usage

pip install

Setup new virtual environment (optional but recommended):

python3 -m venv venv
source venv/bin/activate

Install the package via pip:

pip install hostinger_mail_api

Then import the package:

import hostinger_mail_api

Setuptools

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 hostinger_mail_api

Getting Started

Please follow the installation procedure and then run the following:

import hostinger_mail_api
from hostinger_mail_api.rest import ApiException
from pprint import pprint


# Configure Bearer authorization: BearerAuth
configuration = hostinger_mail_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with hostinger_mail_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hostinger_mail_api.AccountApi(api_client)

    try:
        # Get the authenticated account
        api_response = api_instance.get_current_account()
        print("The response of AccountApi->get_current_account:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccountApi->get_current_account: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.mail.hostinger.com

Class Method HTTP request Description
AccountApi get_current_account GET /api/v1/me Get the authenticated account
FeedbackApi submit_feedback POST /api/v1/mailboxes/{mailboxResourceId}/feedback Submit feedback
FoldersApi create_folder POST /api/v1/mailboxes/{mailboxResourceId}/folders Create folder
FoldersApi delete_folder DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} Delete folder
FoldersApi list_folders GET /api/v1/mailboxes/{mailboxResourceId}/folders List folders
FoldersApi update_folder PUT /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} Update folder
MessagesApi delete_all_messages DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages Delete all messages
MessagesApi delete_message DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Delete message
MessagesApi delete_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/delete Delete messages
MessagesApi get_message GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Get message
MessagesApi get_message_attachment GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/attachments/{attachmentId} Download message attachment
MessagesApi get_message_source GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/source Get message source
MessagesApi get_message_text GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/text Get message text content
MessagesApi list_messages GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages List messages
MessagesApi move_message POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/move Move message
MessagesApi move_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/move Move messages
MessagesApi patch_message PATCH /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Update message flags
MessagesApi search_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/search Search messages
MessagesApi update_message_flags POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/flags Update flags on multiple messages
QuotaApi get_quota GET /api/v1/mailboxes/{mailboxResourceId}/quota Get mailbox quota
SendApi send_email POST /api/v1/mailboxes/{mailboxResourceId}/send Send email
WebhooksApi create_webhook POST /api/v1/mailboxes/{mailboxResourceId}/webhooks Create webhook
WebhooksApi delete_webhook DELETE /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Delete webhook
WebhooksApi get_webhook GET /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Get webhook
WebhooksApi list_webhooks GET /api/v1/mailboxes/{mailboxResourceId}/webhooks List webhooks
WebhooksApi regenerate_webhook_secret POST /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/regenerate-secret Regenerate webhook secret
WebhooksApi test_webhook POST /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/test Test webhook
WebhooksApi update_webhook PATCH /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Update webhook

Documentation For Models

Metadata

Release files for hostinger-mail-api 1.18.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hostinger-mail-api 1.18.3
File Size Uploaded Provenance Actions
hostinger_mail_api-1.18.3.tar.gz 53.9 kB Without provenance Details for hostinger_mail_api-1.18.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hostinger-mail-api 1.18.3
File Interpreter ABI Platform Actions
hostinger_mail_api-1.18.3-py3-none-any.whl Python 3 none any Details for hostinger_mail_api-1.18.3-py3-none-any.whl

Total release size: 162.5 kB

Release files / hostinger_mail_api-1.18.3.tar.gz

Download URL hostinger_mail_api-1.18.3.tar.gz
Size 53.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4c48ccfeab8b7110086e43b8eff1b243f79c37c3f5e8647d1786fa0c56353b09
BLAKE2b-256 checksum
How to use checksums
45eb8a3834efea2bf8051c8da41b5d4841c2c5a48c7a86179cf6932cc4d72d29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hostinger_mail_api-1.18.3-py3-none-any.whl

Download URL hostinger_mail_api-1.18.3-py3-none-any.whl
Size 108.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf4233cf77dde92598265ce588c08e33fa73713bead619edc3b9c5b3b03381a8
BLAKE2b-256 checksum
How to use checksums
0c3abc893194b018ddff0f39a72760332a414b43dea999b1ccdd79b1ebf43bf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for hostinger-mail-api 1.18.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.18.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page