Skip to main content

Hostinger Mail API Python SDK

PyPI version

About

This is a Python SDK for the Hostinger API.

Requirements.

Python 3.9+

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 message flags
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.1

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.1
File Size Uploaded Provenance
hostinger_mail_api-1.18.1.tar.gz 53.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 162.1 kB

Release files / hostinger_mail_api-1.18.1.tar.gz

Download URL hostinger_mail_api-1.18.1.tar.gz
Size 53.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0c580a79b164ca379f4f1d4aaeac65c151f9b0d00c7da7293de8ab1316b98b36
BLAKE2b-256 checksum
How to use checksums
20c368768f483af6bc03a7a4e6155eeb500a0daeba5976908a0dfce6956e39b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL hostinger_mail_api-1.18.1-py3-none-any.whl
Size 108.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25912f1a41ce791c2352c7a2f555f7cdf6bc0c20b7bd32579552ff282e747fb2
BLAKE2b-256 checksum
How to use checksums
6d5f75e24e865204b59484f802e0375af71c3294e4301bd081f4d2688e3304bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Security for hostinger-mail-api 1.18.1

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.

Release history Release notifications | RSS feed

This release

1.18.1 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