Skip to Content

Python Quickstart

pip install requests export SPLASHIFY_API_KEY="pk_live_..."
import os, requests r = requests.post( "https://apis.splashifypro.com/api/v1/partner/email/send", headers={ "Authorization": f"Bearer {os.environ['SPLASHIFY_API_KEY']}", "Content-Type": "application/json", }, json={ "from": "hello@yourcompany.com", "to": ["customer@example.com"], "subject": "Welcome to our app", "html_body": "<h1>Welcome 👋</h1>", "text_body": "Welcome.", }, ) r.raise_for_status() print(r.json()["results"][0]["message_id"])

Handling errors

if not r.ok: err = r.json() raise RuntimeError(f"{err['error']}: {err['message']}")

Async (httpx)

import httpx, asyncio async def send(): async with httpx.AsyncClient() as c: r = await c.post( "https://apis.splashifypro.com/api/v1/partner/email/send", headers={"Authorization": f"Bearer {API_KEY}"}, json={...}, ) return r.json() asyncio.run(send())

What’s next