Contents
1.0 Introduction
API Reference
DriftSpike, a product of Strucureo, provides a robust REST API for seamless email delivery. All endpoints are HTTPS-only.
Production Base URL
https://api-drift-spike.vercel.app/api
Authentication
Authenticating with the API is done via the x-api-key header. Your API Key is your unique **Supabase User ID**, which can be found in your dashboard credentials section.
x-api-key: YOUR_USER_ID
1. Check Status
Use this endpoint to verify the service health and connection to your SMTP server.
curl -X GET https://api-drift-spike.vercel.app/api/status \
-H "x-api-key: YOUR_USER_ID" \
-H "Content-Type: application/json"
2. Send Email
Basic Usage
Send a transactional email with HTML content.
curl -X POST https://api-drift-spike.vercel.app/api/send-email \
-H "x-api-key: YOUR_USER_ID" \
-H "Content-Type: application/json" \
-d '{
"to": "recipient@example.com",
"subject": "Your Subject",
"html": "<h1>Hello!</h1><p>Your message here</p>"
}'
With Attachments
Send an email with base64 encoded attachments.
curl -X POST https://api-drift-spike.vercel.app/api/send-email \
-H "x-api-key: YOUR_USER_ID" \
-H "Content-Type: application/json" \
-d '{
"to": "recipient@example.com",
"subject": "Email with Attachment",
"html": "<h1>Hello!</h1>",
"attachments": [
{
"filename": "hello.txt",
"content": "SGVsbG8gV29ybGQh",
"contentType": "text/plain"
}
]
}'
Error Handling
The API uses standard HTTP response codes to indicate success or failure.
200 - OK
Request succeeded.
401 - Unauthorized
Invalid or missing API key (User ID).
500 - Server Error
SMTP connection failure or internal error.
Rate Limits & Plans
Rate limits vary by plan:
- Starter: 1 request per minute
- Production: 30 requests per minute
To upgrade to Premium, please contact strucureo@gmail.com