Send Email

Send AI-Generated Message

post

Send a personalized message generated by AI using your prompt and data.

SDK Examples

Node.js

const ContactedAI = require('contacted');
const contacted = new ContactedAI({ apiKey: 'your-api-key' });

const result = await contacted.send({
  from: 'sender@example.com',
  to: 'receiver@example.com',
  subject: 'Welcome to our platform!',
  prompt: 'Generate a welcome email for a new user',
  data: {
    name: 'John Doe',
    plan: 'premium'
  }
});

Python

from contacted import ContactedAI

contacted = ContactedAI(api_key='your-api-key')

result = contacted.send(
    from_email='sender@example.com',
    to_email='receiver@example.com',
    subject='Welcome to our platform!',
    prompt='Generate a welcome email for a new user',
    data={
        'name': 'John Doe',
        'plan': 'premium'
    }
)
Authorizations
AuthorizationstringRequired

Your ContactedAI API key. Get yours at contacted.io

Use the Authorization header with Bearer scheme: Authorization: Bearer CONTACTED_API_KEY_1234567890abcdef...

Body
fromstring · emailRequired

Sender email address

Example: noreply@myapp.com
tostring · emailRequired

Recipient email address

Example: user@example.com
subjectstring · min: 2 · max: 256Required

Email subject line. Must be between 2-256 characters.

Example: Welcome to our platform!
promptstring · min: 10 · max: 2000Required

AI prompt describing the message to generate. Must be between 10-2000 characters.

Example: Create a personalized welcome email for a new premium subscriber
Responses
200

Message sent successfully

application/json
post
/send

Last updated