Skip to main content
This guide walks you through sending your first email with Ark. We’ll use the sandbox domain so you can test immediately without any DNS configuration.
Sandbox Mode: The sandbox domain sandbox.arkhq.io lets you send test emails instantly. For production, you’ll configure your own domain later.

Prerequisites

  • An Ark account (sign up free)
  • An API key from your dashboard

Step 1: Install the SDK

pip install ark-email
Python 3.9+ required. For async support: pip install ark-email[aiohttp]

Step 2: Get Your API Key

1

Get your API key

Go to arkhq.io/org/credentials and create a new credential. Copy the key - you’ll need it in the next step.
2

Set environment variable

export ARK_API_KEY="your-api-key-here"
Verification: Run echo $ARK_API_KEY to confirm your key is set. You should see your API key printed.

Step 3: Send Your First Email

Send a test email using the sandbox domain. Replace [email protected] with your actual email address to receive the test:
import os
from ark import Ark

client = Ark(api_key=os.environ.get("ARK_API_KEY"))

email = client.emails.send(
    from_="[email protected]",
    to=["[email protected]"],
    subject="Hello from Ark!",
    html="<h1>It works!</h1><p>You just sent your first email with Ark.</p>",
    text="It works! You just sent your first email with Ark."
)

print(f"Email ID: {email.data.id}")
print(f"Status: {email.data.status}")

Expected Response

{
  "success": true,
  "data": {
    "id": "msg_abc123xyz",
    "status": "pending",
    "to": ["[email protected]"]
  },
  "meta": {
    "requestId": "req_def456"
  }
}
Verification: Check your inbox for the email. It should arrive within seconds. Also check your spam folder if you don’t see it.

Step 4: Check Email Status

Use the email ID from the response to check delivery status:
email = client.emails.retrieve("msg_abc123xyz")

print(f"Status: {email.data.status}")
print(f"Timestamp: {email.data.timestamp_iso}")

Status Values

StatusDescription
pendingEmail accepted, waiting to be processed
sentEmail transmitted to recipient’s mail server
softfailTemporary delivery failure, will retry
hardfailPermanent delivery failure
bouncedEmail bounced back
heldHeld for manual review
Verification: The status should show sent after a few seconds. If it shows bounced, double-check the recipient email address.

You’re All Set!

You’ve successfully:
  • Installed the Ark SDK
  • Set up your API key
  • Sent your first email via the sandbox
  • Verified delivery status

Next Steps

Sandbox Limitations: The sandbox domain is for testing only. Emails may be rate-limited and marked as test messages. For production use, configure your own domain.