Features Pricing Compare Cost calculator Guides Quickstarts Docs All systems nominal

Python quickstart

Get an API key, send one email with requests against POST /v1/send, and find it in your send log. No SDK required.

Last reviewed:

Get an API key

Create a free account and a key is issued straight away: 250 emails a day on 1 domain, enough to get through this guide. It lives on the Account page, prefixed sv_live_. Every example below writes it as a placeholder:

sv_live_xxxxxxxxxxxxxxxxxxxxxxxx

You also need a domain verified in your account, because the call below sends from an address on it. Add one under Domains if you have not already, and give the DNS records a few minutes to settle.

Send one email

sendvia has no Python SDK, so this is one POST with requests, the library most Python code already reaches for.

import requests

response = requests.post(
    "https://api.sendvia.io/v1/send",
    headers={"Authorization": "Bearer sv_live_xxxxxxxxxxxxxxxxxxxxxxxx"},
    json={
        "from": "[email protected]",
        "to": "[email protected]",
        "subject": "Hello from sendvia",
        "html": "<p>This is a test email sent through sendvia.</p>",
    },
)

print(response.status_code, response.json())

from, to and subject are required, plus at least one of html or text. Keep @sendvia.io out of from: sendvia checks the sending domain against the domains verified on your own account, and sendvia.io is never one of them for you, so the request fails before Amazon sees it. A working call prints a 200 and a small object back:

200 {'success': True, 'message_id': '0102018f1234abcd-...', 'log_id': 42}

log_id is this email's row in your account's send log, and the next step reads it straight back.

See it in the log

Every send lands in the same place regardless of how it was sent: the History page in the dashboard, or the API.

curl "https://api.sendvia.io/v1/[email protected]" \
  -H "Authorization: Bearer sv_live_xxxxxxxxxxxxxxxxxxxxxxxx"
{
  "total": 1,
  "limit": 25,
  "offset": 0,
  "logs": [
    {
      "id": 42,
      "to_address": "[email protected]",
      "from_address": "[email protected]",
      "subject": "Hello from sendvia",
      "status": "delivered",
      "error_message": null,
      "sent_at": "2026-08-20 10:03:01",
      "delivered_at": "2026-08-20 10:05:01"
    }
  ]
}

The status reads sent as soon as requests.post returns. sendvia never gets a delivery confirmation from the recipient's mail server: two minutes after a clean send it marks the message delivered on its own, reasoning from the absence of a bounce rather than from a receipt. A real bounce or failure event replaces that status the moment one arrives; nothing plays the same role for a genuine delivery. Free-plan logs stick around for 7 to 90 days, longer on premium.

Troubleshooting

The SES sandbox rejects your test recipient

A new SES account starts inside Amazon's sandbox: capped at 200 emails a day, sent only to recipient addresses you have verified yourself in the SES console, pending an AWS review that usually takes 12 to 24 hours. Send to any other address while sandboxed and the response above comes back with a 502 status and AWS's own rejection reason in the body:

{'error': 'SES send failed: ...', 'log_id': 42}

Verify the test recipient in the SES console while you wait, or request production access, which removes the restriction for every recipient in one step.

422: the domain has not been verified

sendvia checks the domain on from against the domains verified on your account before it calls AWS at all. A domain that has not been added yet, or one still waiting on DNS, is refused immediately:

{'error': 'The domain "yourdomain.com" has not been verified. Add and verify it in the dashboard first.'}

Add the domain under Domains, publish the records sendvia gives you, and the same call goes through once it passes.

Two failures almost everyone hits on the first request.
SymptomCauseFix
HTTP 502, SES send failed: ...SES sandbox: the recipient is not verifiedVerify the recipient in SES, or request production access
HTTP 422, domain not verifiedThe from domain is not verified on your accountAdd and verify the domain under Domains