How to authenticate with the SipherMail API
API tokens are obtained through NextAuth.js session tokens. For API access:
curl -X POST https://api.siphermail.com/v1/send \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "recipient@example.com",
"subject": "Hello",
"body": "This is a test email"
}'const response = await fetch('https://api.siphermail.com/v1/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: 'recipient@example.com',
subject: 'Hello',
body: 'This is a test email'
})
});
const result = await response.json();