### Manage Webhooks Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Examples for getting, updating, deleting, and testing webhooks using the webhooks API. ```python webhook = await webhooks_api.get_webhook("example.com", "webhook-guid") ``` ```python webhook = await webhooks_api.update_webhook( domain="example.com", webhook_guid="webhook-guid", webhook_type="opened", url="https://example.com/new-webhook" ) ``` ```python await webhooks_api.delete_webhook("example.com", "webhook-guid") ``` ```python result = await webhooks_api.test_webhook( domain="example.com", url="https://example.com/webhook", event_type="delivered" ) print(f"Response status: {result['data']['response_status']}") ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Instructions for cloning the SDK repository and installing development dependencies using 'uv'. ```bash # Clone repository git clone https://github.com/kirimemail/kirimemail-smtp-python-sdk.git cd kirimemail-smtp-python-sdk # Install with uv uv sync --dev ``` -------------------------------- ### Install Kirim.Email SMTP Python SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Install the SDK using pip. This command downloads and installs the latest version of the library. ```bash pip install kirimemail-smtp-sdk ``` -------------------------------- ### Manage Credentials with Kirim Email Python SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Examples for getting, resetting password, and deleting credentials. Ensure the returned password is saved securely. ```python credential = await credentials_api.get_credential("example.com", "credential-guid") await credentials_api.delete_credential("example.com", "credential-guid") result = await credentials_api.reset_password("example.com", "credential-guid") print(f"New password: {result['data']['new_password']}") ``` -------------------------------- ### Get User Quota Information with Kirim Email Python SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Example for retrieving current and maximum email quota, and calculating usage percentage. ```python from kirimemail_smtp import UserApi user_api = UserApi(client) # Get quota quota = await user_api.get_quota() print(f"Available: {quota['data']['current_quota']}/{quota['data']['max_quota']}") print(f"Usage: {quota['data']['usage_percentage']}%" ``` -------------------------------- ### DomainsApi: Setup Tracking Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Sets up a tracking domain for a given domain. ```APIDOC ## DomainsApi: Setup Tracking Domain ### Description Sets up a tracking domain for a given domain. ### Method `setup_tracklink` ### Parameters #### Path Parameters - **domain** (string) - Required - The primary domain. - **tracklink** (string) - Required - The tracking domain to set up. #### Query Parameters None #### Request Body None ### Request Example ```python await domains_api.setup_tracklink("example.com", "track.example.com") ``` ### Response #### Success Response Indicates successful setup. #### Response Example (Not explicitly provided in source, typically an empty success response or status message) ``` -------------------------------- ### Verify Tracking Domain Setup Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Confirm that the tracking domain has been correctly set up and is ready to be used for tracking email engagement. ```python result = await domains_api.verify_tracklink("example.com") ``` -------------------------------- ### Quick Start: Send an Email with Kirim.Email SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Initialize the SmtpClient and use the MessagesApi to send a basic email. Ensure you replace placeholders with your actual credentials and domain. ```python import asyncio from kirimemail_smtp import SmtpClient, MessagesApi async def send_email(): # Initialize client client = SmtpClient(username="your-username", token="your-token") messages_api = MessagesApi(client) # Send email result = await messages_api.send_message( domain="example.com", message={ "from": "sender@example.com", "from_name": "Company Name", "to": "recipient@example.com", "subject": "Hello from Python SDK", "text": "This is a test email sent using the Kirim.Email Python SDK." } ) print(f"Email sent: {result}") # Run the async function asyncio.run(send_email()) ``` -------------------------------- ### Setup Authentication Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Configure an authentication domain for your email sending. This is crucial for deliverability and sender reputation. ```python await domains_api.setup_auth_domain("example.com", { "auth_domain": "auth.example.com", "dkim_key_length": 2048 }) ``` -------------------------------- ### Manage Webhooks with Kirim Email Python SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Examples for listing and creating webhooks for email events. Supports filtering webhooks by type. ```python from kirimemail_smtp import WebhooksApi webhooks_api = WebhooksApi(client) # List webhooks webhooks = await webhooks_api.list_webhooks("example.com") # List webhooks by type webhooks = await webhooks_api.list_webhooks("example.com", webhook_type="delivered") # Create webhook webhook = await webhooks_api.create_webhook( domain="example.com", webhook_type="delivered", url="https://example.com/webhook" ) ``` -------------------------------- ### DomainsApi: Verify Tracking Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Verifies the tracking domain setup for a given domain. ```APIDOC ## DomainsApi: Verify Tracking Domain ### Description Verifies the tracking domain setup for a given domain. ### Method `verify_tracklink` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain whose tracking link needs verification. #### Query Parameters None #### Request Body None ### Request Example ```python result = await domains_api.verify_tracklink("example.com") ``` ### Response #### Success Response - **result** (any) - The verification result. #### Response Example (Not explicitly provided in source, but would indicate success or failure of tracking domain verification) ``` -------------------------------- ### DomainsApi: Setup Authentication Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Sets up an authentication domain for the specified domain, including DKIM key length. ```APIDOC ## DomainsApi: Setup Authentication Domain ### Description Sets up an authentication domain for the specified domain, including DKIM key length. ### Method `setup_auth_domain` ### Parameters #### Path Parameters - **domain** (string) - Required - The primary domain for which to set up authentication. #### Query Parameters None #### Request Body - **auth_domain** (string) - Required - The authentication domain name. - **dkim_key_length** (integer) - Optional - The desired length for the DKIM key. ### Request Example ```python await domains_api.setup_auth_domain("example.com", { "auth_domain": "auth.example.com", "dkim_key_length": 2048 }) ``` ### Response #### Success Response Indicates successful setup. #### Response Example (Not explicitly provided in source, typically an empty success response or status message) ``` -------------------------------- ### Get Domain Details Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Fetch detailed information about a specific domain. This includes its configuration and status. ```python domain = await domains_api.get_domain("example.com") ``` -------------------------------- ### Setup Tracking Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Configure a custom domain for tracking email opens and clicks. This helps maintain brand consistency and control over tracking links. ```python await domains_api.setup_tracklink("example.com", "track.example.com") ``` -------------------------------- ### DomainsApi: Get Domain Details Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Retrieves detailed information about a specific domain. ```APIDOC ## DomainsApi: Get Domain Details ### Description Retrieves detailed information about a specific domain. ### Method `get_domain` ### Parameters #### Path Parameters - **domain** (string) - Required - The name of the domain to retrieve details for. #### Query Parameters None #### Request Body None ### Request Example ```python domain = await domains_api.get_domain("example.com") ``` ### Response #### Success Response - **domain** (object) - Detailed information about the domain. #### Response Example (Not explicitly provided in source, but would typically be a JSON object with domain configuration details) ``` -------------------------------- ### Retrieve and Stream Email Logs with Kirim Email Python SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Examples for fetching email logs with various filters and streaming logs. Supports filtering by date, sender, recipient, event type, and tags. ```python from kirimemail_smtp import LogsApi from kirimemail_smtp.models import LogEntry logs_api = LogsApi(client) # Get logs logs = await logs_api.get_logs("example.com", { "limit": 50, "start": "2023-01-01T00:00:00Z", "end": "2023-12-31T23:59:59Z", "sender": "sender@example.com", "recipient": "recipient@example.com" }) # Filter by event type (queued, delivered, bounced, failed, opened, clicked, unsubscribed, etc.) logs = await logs_api.get_logs("example.com", { "event_type": "delivered" }) # Or use the helper method with constants logs = await logs_api.get_logs_by_event_type("example.com", LogEntry.SMTP_EVENT_DELIVERED) # Filter by tags (partial match) logs = await logs_api.get_logs("example.com", { "tags": "newsletter" }) # Or use the helper method logs = await logs_api.get_logs_by_tags("example.com", "newsletter") # Combine filters logs = await logs_api.get_logs("example.com", { "event_type": "bounced", "tags": "marketing", "start": "2023-01-01T00:00:00Z", "limit": 100 }) # Get logs for specific message logs = await logs_api.get_message_logs("example.com", "message-guid") # Stream logs (async generator) async for log_entry in logs_api.stream_logs("example.com", { "limit": 10000, "start": "2023-01-01T00:00:00Z", "end": "2023-12-31T23:59:59Z" }): print(f"Log: {log_entry}") # Stream with event_type filter async for log_entry in logs_api.stream_logs("example.com", { "event_type": "delivered", "limit": 5000 }): print(f"Delivered: {log_entry}") ``` -------------------------------- ### Send Template Email Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Send an email using a pre-defined template. Provide the template GUID and any necessary variables to populate the template. ```python await messages_api.send_template_message( domain="example.com", template={ "template_guid": "template-uuid", "from": "sender@example.com", "from_name": "Company Name", "to": "recipient@example.com", "variables": {"name": "John", "product": "Premium Plan"} } ) ``` -------------------------------- ### Manage Email Suppressions with Kirim Email Python SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Examples for retrieving, searching, and deleting email suppressions (bounces, unsubscribes, whitelists). ```python from kirimemail_smtp import SuppressionsApi suppressions_api = SuppressionsApi(client) # Get all suppressions suppressions = await suppressions_api.get_suppressions("example.com", { "type": "bounce", "per_page": 10, "page": 1 }) # Get unsubscribe suppressions unsubscribes = await suppressions_api.get_unsubscribe_suppressions("example.com") # Get bounce suppressions bounces = await suppressions_api.get_bounce_suppressions("example.com") # Get whitelist suppressions whitelist = await suppressions_api.get_whitelist_suppressions("example.com") # Search suppressions results = await suppressions_api.search_suppressions("example.com", "user@example.com") # Create whitelist suppression await suppressions_api.create_whitelist_suppression( domain="example.com", recipient="trusted@example.com", recipient_type="email", description="Trusted sender" ) # Delete suppressions by IDs await suppressions_api.delete_unsubscribe_suppressions("example.com", [1, 2, 3]) await suppressions_api.delete_bounce_suppressions("example.com", [4, 5, 6]) await suppressions_api.delete_whitelist_suppressions("example.com", [7, 8, 9]) ``` -------------------------------- ### Validate Email Addresses with Kirim Email Python SDK Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Examples for validating single and bulk email addresses, including strict validation options. ```python from kirimemail_smtp import EmailValidationApi validation_api = EmailValidationApi(client) # Validate single email result = await validation_api.validate_email("user@example.com") print(f"Valid: {result['data']['is_valid']}") # Strict validation result = await validation_api.validate_email_strict("user@example.com") print(f"Valid: {result['data']['is_valid']}") # Bulk validation result = await validation_api.validate_bulk([ "user1@example.com", "user2@test.org", "invalid-email" ]) print(f"Valid: {result['data']['summary']['valid']}, Invalid: {result['data']['summary']['invalid']}") # Bulk strict validation result = await validation_api.validate_bulk_strict([ "user1@example.com", "user2@test.org" ]) ``` -------------------------------- ### Credentials API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Manage email credentials, including getting, deleting, and resetting passwords. ```APIDOC ## Credentials API ### Description Manage email credentials, including getting, deleting, and resetting passwords. ### Methods #### Get Credential Get credential details. - **Method**: GET (implied) - **Endpoint**: Not specified, but likely related to credential management. - **Parameters**: - **domain** (string) - Required - The domain for which to get the credential. - **credential_guid** (string) - Required - The unique identifier for the credential. #### Delete Credential Delete a credential. - **Method**: DELETE (implied) - **Endpoint**: Not specified, but likely related to credential management. - **Parameters**: - **domain** (string) - Required - The domain of the credential to delete. - **credential_guid** (string) - Required - The unique identifier for the credential to delete. #### Reset Password Reset the password for a given credential. - **Method**: POST (implied) - **Endpoint**: Not specified, but likely related to credential management. - **Parameters**: - **domain** (string) - Required - The domain of the credential. - **credential_guid** (string) - Required - The unique identifier for the credential. - **Response**: - **data.new_password** (string) - The newly generated password. ``` -------------------------------- ### Verify DNS Records for Authentication Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Verify the DNS records specifically for the configured authentication domain. Ensures proper DKIM and SPF setup. ```python result = await domains_api.verify_auth_domain_records("example.com") ``` -------------------------------- ### MessagesApi: Send Template Email Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Sends an email using a pre-defined template. Requires domain, template details including template GUID, sender, recipient, and variables for personalization. ```APIDOC ## MessagesApi: Send Template Email ### Description Sends an email using a pre-defined template. Requires domain, template details including template GUID, sender, recipient, and variables for personalization. ### Method `send_template_message` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **domain** (string) - Required - The domain from which to send the email. - **template** (object) - Required - The template details. - **template_guid** (string) - Required - The unique identifier for the template. - **from** (string) - Required - Sender's email address. - **from_name** (string) - Optional - Sender's name. - **to** (string) - Required - Recipient's email address. - **variables** (object) - Optional - Key-value pairs for template variables. ### Request Example ```python await messages_api.send_template_message( domain="example.com", template={ "template_guid": "template-uuid", "from": "sender@example.com", "from_name": "Company Name", "to": "recipient@example.com", "variables": {"name": "John", "product": "Premium Plan"} } ) ``` ### Response #### Success Response Details of the sent template email. #### Response Example (Not explicitly provided in source, but would typically include a message ID or status) ``` -------------------------------- ### Initialize SmtpClient Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Instantiate the SmtpClient with your username and API token. An optional base URL can be provided for non-production environments. ```python from kirimemail_smtp import SmtpClient client = SmtpClient( username="your-username", token="your-token", base_url="https://smtp-app.kirim.email" # Optional, defaults to production ) ``` -------------------------------- ### Use Pydantic Data Models Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Shows how to instantiate Pydantic models for data handling, such as EmailValidationResult, and access constants for LogEntry event types. ```python from kirimemail_smtp.models import ( Credential, Domain, EmailValidationResult, EmailValidationBatchResult, LogEntry, Pagination, Quota, Suppression, Webhook ) # Usage email_validation = EmailValidationResult( email="user@example.com", is_valid=True, cached=False, validated_at="2024-01-01T12:00:00Z", is_spamtrap=False ) # LogEntry event type constants LogEntry.SMTP_EVENT_QUEUED # 'queued' LogEntry.SMTP_EVENT_SEND # 'send' LogEntry.SMTP_EVENT_DELIVERED # 'delivered' LogEntry.SMTP_EVENT_BOUNCED # 'bounced' LogEntry.SMTP_EVENT_FAILED # 'failed' LogEntry.SMTP_EVENT_PERMANENT_FAIL # 'permanent_fail' LogEntry.SMTP_EVENT_OPENED # 'opened' LogEntry.SMTP_EVENT_CLICKED # 'clicked' LogEntry.SMTP_EVENT_UNSUBSCRIBED # 'unsubscribed' LogEntry.SMTP_EVENT_TEMP_FAILURE # 'temp_fail' LogEntry.SMTP_EVENT_DEFERRED # 'deferred' # All valid event types print(LogEntry.VALID_EVENT_TYPES) ``` -------------------------------- ### SmtpClient Initialization Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Initializes the core HTTP client with authentication and error handling capabilities. It can optionally be configured with a custom base URL. ```APIDOC ## SmtpClient ### Description The `SmtpClient` is the core HTTP client with authentication and error handling. ### Initialization ```python from kirimemail_smtp import SmtpClient client = SmtpClient( username="your-username", token="your-token", base_url="https://smtp-app.kirim.email" # Optional, defaults to production ) ``` ``` -------------------------------- ### Create a New Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Register a new domain with Kirim.Email. Specify the domain name and the desired DKIM key length for enhanced security. ```python domain = await domains_api.create_domain( domain="newdomain.com", dkim_key_length=2048 ) ``` -------------------------------- ### Run Tests and Coverage Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Commands to execute tests using pytest and generate a code coverage report. ```bash # Run tests uv run pytest # Run with coverage uv run pytest --cov=src/kirimemail_smtp --cov-report=html ``` -------------------------------- ### Handle API Errors Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Demonstrates how to catch specific exceptions like AuthenticationException, ValidationException, NotFoundException, ServerException, and general ApiException during API calls. ```python from kirimemail_smtp.exceptions import ( ApiException, AuthenticationException, ValidationException, NotFoundException, ServerException ) try: await messages_api.send_message(domain="example.com", message=message_data) except AuthenticationException: print("Authentication failed - check your credentials") except ValidationException as e: print(f"Validation error: {e.message}") print(f"Field errors: {e.errors}") except NotFoundException: print("Domain not found") except ServerException: print("Server error - please try again later") except ApiException as e: print(f"API error: {e.message}") ``` -------------------------------- ### Code Quality Checks Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Commands for linting, formatting, and type checking the code using Ruff and MyPy. ```bash # Lint code uv run ruff check src/ # Format code uv run ruff format src/ # Type checking uv run mypy src/ ``` -------------------------------- ### Verify DNS Records for Domain Authentication Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Check if the mandatory DNS records for domain authentication are correctly set up. This is a prerequisite for sending emails from the domain. ```python result = await domains_api.verify_mandatory_records("example.com") ``` -------------------------------- ### CredentialsApi: Create Credential Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Creates a new SMTP credential for a specified domain with a given username. ```APIDOC ## CredentialsApi: Create Credential ### Description Creates a new SMTP credential for a specified domain with a given username. ### Method `create_credential` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **domain** (string) - Required - The domain for which to create the credential. - **username** (string) - Required - The username for the new credential. ### Request Example ```python result = await credentials_api.create_credential( domain="example.com", username="new-credential" ) ``` ### Response #### Success Response Indicates successful creation. #### Response Example (Not explicitly provided in source, typically an empty success response or status message with credential details) ``` -------------------------------- ### DomainsApi: Create Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Creates a new domain for sending emails. Allows specifying the domain name and DKIM key length. ```APIDOC ## DomainsApi: Create Domain ### Description Creates a new domain for sending emails. Allows specifying the domain name and DKIM key length. ### Method `create_domain` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **domain** (string) - Required - The domain name to create. - **dkim_key_length** (integer) - Optional - The desired length for the DKIM key (e.g., 2048). ### Request Example ```python domain = await domains_api.create_domain( domain="newdomain.com", dkim_key_length=2048 ) ``` ### Response #### Success Response - **domain** (object) - Details of the newly created domain. #### Response Example (Not explicitly provided in source, but would typically be a JSON object representing the created domain) ``` -------------------------------- ### List Domains with Domains API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Retrieve a list of all configured domains. Supports optional search functionality to filter results. ```python from kirimemail_smtp import DomainsApi domains_api = DomainsApi(client) # List domains domains = await domains_api.list_domains() # List domains with search domains = await domains_api.list_domains(search="example") ``` -------------------------------- ### Send Email with Attachment Options Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Send an email with attachments and specify advanced options for handling attachments, such as compression, password protection, and watermarking. ```python await messages_api.send_message_with_attachment_options( domain="example.com", message={ "from": "sender@example.com", "to": "recipient@example.com", "subject": "Secure Document", "text": "Please find attached" }, files=[{"field": "attachment", "filename": "doc.pdf", "content": b"content"}], attachment_options={ "compress": True, "password": "SecureDoc2024", "watermark": {"enabled": True, "text": "CONFIDENTIAL", "position": "center"} } ) ``` -------------------------------- ### CredentialsApi: List Credentials Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Lists all SMTP credentials associated with a specific domain. ```APIDOC ## CredentialsApi: List Credentials ### Description Lists all SMTP credentials associated with a specific domain. ### Method `list_credentials` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain to list credentials for. #### Query Parameters None #### Request Body None ### Request Example ```python credentials = await credentials_api.list_credentials("example.com") ``` ### Response #### Success Response - **credentials** (array) - A list of credential objects. #### Response Example (Not explicitly provided in source, but would typically be a JSON array of credential objects) ``` -------------------------------- ### Create New SMTP Credential Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Generate a new SMTP username and password for a given domain. This allows for programmatic access to send emails via SMTP. ```python result = await credentials_api.create_credential( domain="example.com", username="new-credential" ) ``` -------------------------------- ### Send Email with Attachments Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Send an email that includes attachments. The 'files' parameter takes a list of dictionaries, each specifying the field, filename, and content of the attachment. ```python await messages_api.send_message_with_attachments( domain="example.com", message={ "from": "sender@example.com", "to": "recipient@example.com", "subject": "Email with attachments", "text": "Please find attached files" }, files=[ {"field": "attachment", "filename": "document.pdf", "content": b"PDF content"} ] ) ``` -------------------------------- ### Update Domain Tracking Settings Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Modify the tracking settings for a domain, enabling or disabling open tracking, click tracking, and unsubscribe tracking. ```python await domains_api.update_domain("example.com", { "open_track": True, "click_track": True, "unsub_track": True }) ``` -------------------------------- ### Delete a Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Remove a domain from your Kirim.Email account. This action is irreversible. ```python await domains_api.delete_domain("example.com") ``` -------------------------------- ### User API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Retrieve user quota information. ```APIDOC ## User API ### Description Retrieve user quota information. ### Methods #### Get Quota Get the current email sending quota and usage. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to user quota. - **Response**: - **data.current_quota** (integer) - The current available quota. - **data.max_quota** (integer) - The maximum quota. - **data.usage_percentage** (float) - The percentage of usage. ``` -------------------------------- ### MessagesApi: Send Email with Attachments Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Sends an email with attachments. Supports a message object and a list of files, where each file includes field, filename, and content. ```APIDOC ## MessagesApi: Send Email with Attachments ### Description Sends an email with attachments. Supports a message object and a list of files, where each file includes field, filename, and content. ### Method `send_message_with_attachments` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **domain** (string) - Required - The domain from which to send the email. - **message** (object) - Required - The email message details. - **from** (string) - Required - Sender's email address. - **to** (string) - Required - Recipient's email address. - **subject** (string) - Required - Email subject. - **text** (string) - Required - Plain text content of the email. - **files** (array) - Required - A list of files to attach. - Each item is an object with: - **field** (string) - Required - The field name for the attachment. - **filename** (string) - Required - The name of the file. - **content** (bytes) - Required - The binary content of the file. ### Request Example ```python await messages_api.send_message_with_attachments( domain="example.com", message={ "from": "sender@example.com", "to": "recipient@example.com", "subject": "Email with attachments", "text": "Please find attached files" }, files=[ {"field": "attachment", "filename": "document.pdf", "content": b"PDF content"} ] ) ``` ### Response #### Success Response Details of the sent email with attachments. #### Response Example (Not explicitly provided in source, but would typically include a message ID or status) ``` -------------------------------- ### DomainsApi: Verify Authentication Domain Records Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Verifies the DNS records for the authentication domain associated with a given domain. ```APIDOC ## DomainsApi: Verify Authentication Domain Records ### Description Verifies the DNS records for the authentication domain associated with a given domain. ### Method `verify_auth_domain_records` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain whose authentication records need verification. #### Query Parameters None #### Request Body None ### Request Example ```python result = await domains_api.verify_auth_domain_records("example.com") ``` ### Response #### Success Response - **result** (any) - The verification result. #### Response Example (Not explicitly provided in source, but would indicate success or failure of authentication domain record verification) ``` -------------------------------- ### Send Simple Email with Messages API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Use the MessagesApi to send a basic email. Specify the domain and the email message details including sender, recipient, subject, and text content. ```python from kirimemail_smtp import MessagesApi messages_api = MessagesApi(client) # Send simple email await messages_api.send_message(domain="example.com", message={ "from": "sender@example.com", "from_name": "Company Name", "to": "recipient@example.com", "subject": "Test Email", "text": "Email content" }) ``` -------------------------------- ### MessagesApi: Send Message with Attachment Options Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Sends an email with attachments and advanced attachment processing options, including compression, password protection, and watermarking. ```APIDOC ## MessagesApi: Send Message with Attachment Options ### Description Sends an email with attachments and advanced attachment processing options, including compression, password protection, and watermarking. ### Method `send_message_with_attachment_options` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **domain** (string) - Required - The domain from which to send the email. - **message** (object) - Required - The email message details. - **from** (string) - Required - Sender's email address. - **to** (string) - Required - Recipient's email address. - **subject** (string) - Required - Email subject. - **text** (string) - Required - Plain text content of the email. - **files** (array) - Required - A list of files to attach. - Each item is an object with: - **field** (string) - Required - The field name for the attachment. - **filename** (string) - Required - The name of the file. - **content** (bytes) - Required - The binary content of the file. - **attachment_options** (object) - Optional - Options for processing attachments. - **compress** (boolean) - Optional - Whether to compress attachments. - **password** (string) - Optional - Password for encrypted attachments. - **watermark** (object) - Optional - Watermark settings. - **enabled** (boolean) - Required - Whether to enable watermark. - **text** (string) - Required - The watermark text. - **position** (string) - Optional - The position of the watermark (e.g., "center"). ### Request Example ```python await messages_api.send_message_with_attachment_options( domain="example.com", message={ "from": "sender@example.com", "to": "recipient@example.com", "subject": "Secure Document", "text": "Please find attached" }, files=[{"field": "attachment", "filename": "doc.pdf", "content": b"content"}], attachment_options={ "compress": True, "password": "SecureDoc2024", "watermark": {"enabled": True, "text": "CONFIDENTIAL", "position": "center"} } ) ``` ### Response #### Success Response Details of the sent email with processed attachments. #### Response Example (Not explicitly provided in source, but would typically include a message ID or status) ``` -------------------------------- ### DomainsApi: Verify Mandatory DNS Records Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Verifies the mandatory DNS records for a given domain. ```APIDOC ## DomainsApi: Verify Mandatory DNS Records ### Description Verifies the mandatory DNS records for a given domain. ### Method `verify_mandatory_records` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain to verify DNS records for. #### Query Parameters None #### Request Body None ### Request Example ```python result = await domains_api.verify_mandatory_records("example.com") ``` ### Response #### Success Response - **result** (any) - The verification result. #### Response Example (Not explicitly provided in source, but would indicate success or failure of DNS record verification) ``` -------------------------------- ### DomainsApi: Update Domain Tracking Settings Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Updates the tracking settings (open, click, unsubscribe tracking) for a specific domain. ```APIDOC ## DomainsApi: Update Domain Tracking Settings ### Description Updates the tracking settings (open, click, unsubscribe tracking) for a specific domain. ### Method `update_domain` ### Parameters #### Path Parameters - **domain** (string) - Required - The name of the domain to update. #### Query Parameters None #### Request Body - **open_track** (boolean) - Optional - Enable or disable open tracking. - **click_track** (boolean) - Optional - Enable or disable click tracking. - **unsub_track** (boolean) - Optional - Enable or disable unsubscribe tracking. ### Request Example ```python await domains_api.update_domain("example.com", { "open_track": True, "click_track": True, "unsub_track": True }) ``` ### Response #### Success Response Indicates successful update. #### Response Example (Not explicitly provided in source, typically an empty success response or status message) ``` -------------------------------- ### DomainsApi: List Domains Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Retrieves a list of domains associated with the account. Supports optional search functionality to filter domains. ```APIDOC ## DomainsApi: List Domains ### Description Retrieves a list of domains associated with the account. Supports optional search functionality to filter domains. ### Method `list_domains` ### Parameters #### Path Parameters None #### Query Parameters - **search** (string) - Optional - Filter domains by name. #### Request Body None ### Request Example ```python # List all domains domains = await domains_api.list_domains() # List domains with search domains = await domains_api.list_domains(search="example") ``` ### Response #### Success Response - **domains** (array) - A list of domain objects. #### Response Example (Not explicitly provided in source, but would typically be a JSON array of domain objects) ``` -------------------------------- ### Webhooks API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Endpoints for managing webhooks, including listing, creating, retrieving, updating, deleting, and testing webhooks. ```APIDOC ## GET /api/domains/{domain}/webhooks ### Description List webhooks for a given domain. ### Method GET ### Endpoint /api/domains/{domain}/webhooks ## POST /api/domains/{domain}/webhooks ### Description Create a webhook for a given domain. ### Method POST ### Endpoint /api/domains/{domain}/webhooks ## GET /api/domains/{domain}/webhooks/{webhookGuid} ### Description Get details of a specific webhook for a given domain. ### Method GET ### Endpoint /api/domains/{domain}/webhooks/{webhookGuid} ## PUT /api/domains/{domain}/webhooks/{webhookGuid} ### Description Update a specific webhook for a given domain. ### Method PUT ### Endpoint /api/domains/{domain}/webhooks/{webhookGuid} ## DELETE /api/domains/{domain}/webhooks/{webhookGuid} ### Description Delete a specific webhook for a given domain. ### Method DELETE ### Endpoint /api/domains/{domain}/webhooks/{webhookGuid} ## POST /api/domains/{domain}/webhooks/test ### Description Test a webhook URL for a given domain. ### Method POST ### Endpoint /api/domains/{domain}/webhooks/test ``` -------------------------------- ### List SMTP Credentials Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Retrieve a list of SMTP credentials associated with a specific domain. These are used for authenticating with the SMTP server. ```python from kirimemail_smtp import CredentialsApi credentials_api = CredentialsApi(client) # List credentials credentials = await credentials_api.list_credentials("example.com") ``` -------------------------------- ### User Quota API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Endpoint to retrieve user quota information. ```APIDOC ## GET /api/quota ### Description Get user quota information. ### Method GET ### Endpoint /api/quota ``` -------------------------------- ### Webhooks API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Manage webhooks for email events. ```APIDOC ## Webhooks API ### Description Manage webhooks for email events. ### Methods #### List Webhooks List existing webhooks for a domain, optionally filtered by type. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to webhook listing. - **Parameters**: - **domain** (string) - Required - The domain to list webhooks for. - **webhook_type** (string) - Optional - Filter webhooks by type (e.g., 'delivered'). #### Create Webhook Create a new webhook for a domain and event type. - **Method**: POST (implied) - **Endpoint**: Not specified, but related to webhook creation. - **Parameters**: - **domain** (string) - Required - The domain for the webhook. - **webhook_type** (string) - Required - The type of event to trigger the webhook (e.g., 'delivered'). - **url** (string) - Required - The URL to send webhook notifications to. ``` -------------------------------- ### MessagesApi: Send Simple Email Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Sends a simple email using the Messages API. Requires domain, and a message object containing sender, recipient, subject, and text content. ```APIDOC ## MessagesApi: Send Simple Email ### Description Sends a simple email using the Messages API. Requires domain, and a message object containing sender, recipient, subject, and text content. ### Method `send_message` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **domain** (string) - Required - The domain from which to send the email. - **message** (object) - Required - The email message details. - **from** (string) - Required - Sender's email address. - **from_name** (string) - Optional - Sender's name. - **to** (string) - Required - Recipient's email address. - **subject** (string) - Required - Email subject. - **text** (string) - Required - Plain text content of the email. ### Request Example ```python await messages_api.send_message(domain="example.com", message={ "from": "sender@example.com", "from_name": "Company Name", "to": "recipient@example.com", "subject": "Test Email", "text": "Email content" }) ``` ### Response #### Success Response Details of the sent email. #### Response Example (Not explicitly provided in source, but would typically include a message ID or status) ``` -------------------------------- ### Logs API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Retrieve and stream email logs with various filtering options. ```APIDOC ## Logs API ### Description Retrieve and stream email logs with various filtering options. ### Methods #### Get Logs Retrieve email logs with flexible filtering. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to log retrieval. - **Parameters**: - **domain** (string) - Required - The domain to retrieve logs for. - **filters** (object) - Optional - A dictionary of filters to apply: - **limit** (integer) - Maximum number of logs to return. - **start** (string) - Start timestamp for the log retrieval (ISO 8601 format). - **end** (string) - End timestamp for the log retrieval (ISO 8601 format). - **sender** (string) - Filter logs by sender email address. - **recipient** (string) - Filter logs by recipient email address. - **event_type** (string) - Filter logs by event type (e.g., 'delivered', 'bounced'). - **tags** (string) - Filter logs by tags (partial match). #### Get Logs by Event Type Helper method to retrieve logs filtered by a specific event type. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to log retrieval. - **Parameters**: - **domain** (string) - Required - The domain to retrieve logs for. - **event_type** (string) - Required - The event type to filter by (use constants like `LogEntry.SMTP_EVENT_DELIVERED`). #### Get Logs by Tags Helper method to retrieve logs filtered by tags. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to log retrieval. - **Parameters**: - **domain** (string) - Required - The domain to retrieve logs for. - **tags** (string) - Required - The tags to filter by. #### Get Message Logs Retrieve logs for a specific message. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to log retrieval. - **Parameters**: - **domain** (string) - Required - The domain of the message. - **message_guid** (string) - Required - The unique identifier for the message. #### Stream Logs Stream logs asynchronously. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to log streaming. - **Parameters**: - **domain** (string) - Required - The domain to stream logs from. - **filters** (object) - Optional - A dictionary of filters to apply (same as `get_logs`). - **Returns**: An async generator yielding `LogEntry` objects. ``` -------------------------------- ### DomainsApi: Delete Domain Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Deletes a specific domain from the account. ```APIDOC ## DomainsApi: Delete Domain ### Description Deletes a specific domain from the account. ### Method `delete_domain` ### Parameters #### Path Parameters - **domain** (string) - Required - The name of the domain to delete. #### Query Parameters None #### Request Body None ### Request Example ```python await domains_api.delete_domain("example.com") ``` ### Response #### Success Response Indicates successful deletion. #### Response Example (Not explicitly provided in source, typically an empty success response or status message) ``` -------------------------------- ### Suppressions API Source: https://github.com/kirimemail/kirimemail-smtp-python-sdk/blob/main/README.md Manage email suppressions, including bounces, unsubscribes, and whitelists. ```APIDOC ## Suppressions API ### Description Manage email suppressions, including bounces, unsubscribes, and whitelists. ### Methods #### Get Suppressions Retrieve suppressions with pagination and type filtering. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to suppression retrieval. - **Parameters**: - **domain** (string) - Required - The domain to retrieve suppressions for. - **filters** (object) - Optional - A dictionary of filters: - **type** (string) - Required - The type of suppression ('bounce', 'unsubscribe', 'whitelist'). - **per_page** (integer) - Optional - Number of items per page. - **page** (integer) - Optional - The page number. #### Get Unsubscribe Suppressions Retrieve all unsubscribe suppressions. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to suppression retrieval. - **Parameters**: - **domain** (string) - Required - The domain to retrieve suppressions for. #### Get Bounce Suppressions Retrieve all bounce suppressions. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to suppression retrieval. - **Parameters**: - **domain** (string) - Required - The domain to retrieve suppressions for. #### Get Whitelist Suppressions Retrieve all whitelist suppressions. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to suppression retrieval. - **Parameters**: - **domain** (string) - Required - The domain to retrieve suppressions for. #### Search Suppressions Search for suppressions by recipient email address. - **Method**: GET (implied) - **Endpoint**: Not specified, but related to suppression search. - **Parameters**: - **domain** (string) - Required - The domain to search within. - **recipient** (string) - Required - The email address to search for. #### Create Whitelist Suppression Add an email address to the whitelist. - **Method**: POST (implied) - **Endpoint**: Not specified, but related to whitelist creation. - **Parameters**: - **domain** (string) - Required - The domain to add the whitelist entry to. - **recipient** (string) - Required - The email address to whitelist. - **recipient_type** (string) - Required - The type of recipient (e.g., 'email'). - **description** (string) - Optional - A description for the whitelist entry. #### Delete Unsubscribe Suppressions Delete multiple unsubscribe suppressions by their IDs. - **Method**: DELETE (implied) - **Endpoint**: Not specified, but related to suppression deletion. - **Parameters**: - **domain** (string) - Required - The domain of the suppressions. - **ids** (array of integers) - Required - A list of suppression IDs to delete. #### Delete Bounce Suppressions Delete multiple bounce suppressions by their IDs. - **Method**: DELETE (implied) - **Endpoint**: Not specified, but related to suppression deletion. - **Parameters**: - **domain** (string) - Required - The domain of the suppressions. - **ids** (array of integers) - Required - A list of suppression IDs to delete. #### Delete Whitelist Suppressions Delete multiple whitelist suppressions by their IDs. - **Method**: DELETE (implied) - **Endpoint**: Not specified, but related to suppression deletion. - **Parameters**: - **domain** (string) - Required - The domain of the suppressions. - **ids** (array of integers) - Required - A list of suppression IDs to delete. ```