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.4

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.4
File Size Uploaded Provenance Actions
hostinger_mail_api-1.18.4.tar.gz 56.0 kB Without provenance Details for hostinger_mail_api-1.18.4.tar.gz

Built distribution (wheel)

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

Total release size: 164.8 kB

Release files / hostinger_mail_api-1.18.4.tar.gz

Download URL hostinger_mail_api-1.18.4.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b70148019624e55e4c8d70836b6a9d217480833fa7e9b6ca8ee4d77baa69c233
BLAKE2b-256 checksum
How to use checksums
4a7e59bed1ed79192b5fb4a56363fcd575b0b674827acf3523366c9aeb467859
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.4-py3-none-any.whl

Download URL hostinger_mail_api-1.18.4-py3-none-any.whl
Size 108.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d1dec7302f163505052056e9011db92772d613b2c692a5424c2620e2f5a3df2
BLAKE2b-256 checksum
How to use checksums
95c1f289723c07f2371cc3d6cf17962dcfabc42c36ab7efa0bc7fe2962466052
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.4

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.4 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