curl --request POST \ --url https://api.credira.com/v1/send-email \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "template_id": "template_123456789", "recipient_email": "customer@example.com", "recipient_name": "John Doe", "callout_id": "callout_987654321", "variables": { "customer_name": "John Doe", "invoice_number": "INV-001", "amount": "1250.00", "due_date": "2024-01-30" }, "scheduled_time": "2024-01-15T14:30:00Z", "priority": "high", "email_type": "payment_reminder", "metadata": { "campaign_id": "camp_123", "department": "billing", "invoice_amount": 1250.0 } }'
{ "success": true, "data": { "id": "email_123456789", "template_id": "template_123456789", "callout_id": "callout_987654321", "recipient_email": "customer@example.com", "recipient_name": "John Doe", "subject": "Payment Reminder - Invoice #INV-001", "status": "scheduled", "scheduled_time": "2024-01-15T14:30:00Z", "account_id": "acc_789123456", "created_time": "2024-01-15T10:30:00Z", "email_type": "payment_reminder", "priority": "high", "estimated_delivery": "2024-01-15T14:30:00Z", "tracking_id": "track_456789123", "metadata": { "campaign_id": "camp_123", "department": "billing", "invoice_amount": 1250.0 } }, "meta": { "timestamp": "2024-01-15T10:30:00Z", "request_id": "req_123456789", "message": "Email has been scheduled successfully" } }
Trigger a new email to a customer
{ "success": false, "error": { "code": "INVALID_REQUEST", "message": "Missing required field: template_id" }, "meta": { "timestamp": "2024-01-15T10:30:00Z", "request_id": "req_123456789" } }
{ "success": false, "error": { "code": "UNAUTHORIZED", "message": "Invalid or missing API key" }, "meta": { "timestamp": "2024-01-15T10:30:00Z", "request_id": "req_123456789" } }
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid email address format", "details": "Email address must be a valid format" }, "meta": { "timestamp": "2024-01-15T10:30:00Z", "request_id": "req_123456789" } }
{ "success": false, "error": { "code": "RATE_LIMITED", "message": "Too many email requests. Please wait before sending another email." }, "meta": { "timestamp": "2024-01-15T10:30:00Z", "request_id": "req_123456789" } }