Skip to main content

VibeMail SDK for Python

Official SDK for the VibeMail transactional email API. Python 3.9+, standard library only — installing it pulls in nothing else.

pip install vibemail

Send an email

import os
from vibemail import VibeMail

vibemail = VibeMail(os.environ["VIBEMAIL_API_KEY"])

result = vibemail.send(
    from_address="hello@yourdomain.com",
    to="ada@example.com",
    subject="Welcome",
    html="<p>Glad you're here.</p>",
    text="Glad you're here.",
)
print(result["id"])

send() returns once the API has accepted the message, not once it has been delivered. Use get(id) to follow it.

Always send a text alternative alongside html. Mail with no plain-text part is measurably more likely to be spam-foldered.

from is a reserved word in Python, so the argument is spelled from_address; it goes out as from on the wire.

Recipients

One message goes to one recipient. To reach several people, use batch() — it sends a separate message to each, which is also what stops your recipients from seeing one another's addresses:

result = vibemail.batch([
    {"to": "ada@example.com", "subject": "Welcome", "text": "Hi Ada"},
    {"to": "alan@example.com", "subject": "Welcome", "text": "Hi Alan"},
])

for entry in result["data"]:
    if "error" in entry:
        print("rejected:", entry["error"])

Each entry succeeds or fails on its own; one bad address does not sink the rest.

Passing several addresses to to raises ValueError rather than quietly sending to the first.

Retries and idempotency

Pass idempotency_key on anything you might retry. A repeat carrying the same key returns the original result instead of sending a second copy — which matters because a client that times out has no way of knowing whether the message went out.

vibemail.send(
    to="ada@example.com",
    subject="Receipt",
    text="Thanks!",
    idempotency_key=f"receipt-{order_id}",
)

The client retries 429 and 5xx responses on its own (twice by default, honouring Retry-After) and never retries a request the server rejected on its merits. Pass max_retries=0 to handle that yourself.

Scheduling

from datetime import datetime, timedelta, timezone

result = vibemail.send(
    to="ada@example.com",
    subject="Reminder",
    text="Standup in 15 minutes.",
    scheduled_at=datetime.now(timezone.utc) + timedelta(hours=2),   # or "in 2 hours"
)

vibemail.cancel(result["id"])   # while it is still scheduled

Up to 30 days ahead. A naive datetime is read as UTC rather than as the server's local time. Once the dispatcher has claimed a message it is on its way out and can no longer be withdrawn.

Templates

templates = vibemail.list_templates()

vibemail.send(
    to="ada@example.com",
    template="welcome",
    variables={"name": "Ada"},
)

Anything you pass explicitly — subject, html, text — overrides the stored template, so you can vary one part without redefining the rest.

Errors

from vibemail import VibeMailError, VibeMailTimeoutError

try:
    vibemail.send(to="ada@example.com", subject="Hi", text="...")
except VibeMailError as err:
    print(err.status, err.detail)      # 422 "'to' and 'subject' are required"
    if err.is_retryable:               # 429 or 5xx
        ...
except VibeMailTimeoutError:
    ...                                # exceeded `timeout`, default 30s

Options

Argument Default
api_key Required, positional.
base_url https://vibemail.ai Point at a self-hosted deployment.
timeout 30.0 Per-request, in seconds.
max_retries 2 Applies to 429 and 5xx only.

API

send(**kwargs) Send one message.
batch(emails, idempotency_key=None) Send many, one recipient each.
get(email_id) Status of a send.
cancel(email_id) Withdraw a scheduled send.
list_templates() Stored templates.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibemail-1.0.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibemail-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file vibemail-1.0.0.tar.gz.

File metadata

  • Download URL: vibemail-1.0.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for vibemail-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c40d7f37086a0fdcbafd812113547fc92cbb9a1a85053109d385cf9b2de94f48
MD5 e14f46635aa0a8a6a94c696fb92b4380
BLAKE2b-256 f56576ff5266bffe8020f7f87352289647fa960ad4b3a5570d5b487e520f7bdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibemail-1.0.0.tar.gz:

Publisher: publish.yml on vibemailai/vibemail-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibemail-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vibemail-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for vibemail-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43f9ac35dcdee72cf7e8dbfbf4a43e28a63c8a7a470f00a35f756e51f7babd54
MD5 a48f1edfab5681e0736d3493131d2c95
BLAKE2b-256 a3998fbcb14c7f7e1fb33827acd132a3b56093905a26f8da0802ed3987dafc70

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibemail-1.0.0-py3-none-any.whl:

Publisher: publish.yml on vibemailai/vibemail-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.2.0

2 files

This release

1.0.0 This release

2 files

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