Skip to main content
This guide walks you through sending your first email with Ark. You’ll set up your sending domain and send a test email.
$2.50 Welcome Credit: All new organizations receive $2.50 in free credits - enough to send ~5,000 emails. Learn more about billing.

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

You have two options to send your first email:
No domain setup required! Use sandbox mode to test immediately. Send from [email protected] to any organization member.
Sandbox Restrictions: Recipients must be members of your Ark organization. Add team members at arkhq.io/org/team. Limited to 10 emails/day.

Step 4: Send the Email

Send a test email. For sandbox mode, use [email protected] as the sender and a team member’s email as recipient. For production, use your verified domain:
import os
from ark import Ark

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

# Sandbox mode: use [email protected], send to a team member
# Production: use your verified domain
email = client.emails.send(
    from_="[email protected]",  # or "[email protected]" for production
    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}")
# Sandbox emails include: email.data.sandbox == True

Expected Response

{
  "success": true,
  "data": {
    "id": "msg_abc123xyz",
    "status": "pending",
    "to": ["[email protected]"],
    "sandbox": true  // Only present for sandbox emails
  },
  "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.
Sandbox Response: The sandbox: true field in the response indicates the email was sent via sandbox mode. Sandbox emails don’t incur billing charges.

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 sandbox or custom domain)
  • Verified delivery status

Next Steps