Validate Before Sending With dryRun
Use dryRun: true when you want Motorical to validate an email request without queueing delivery work or writing an email log.
Dry-run validation is useful during setup, CI checks, onboarding flows, and AI-generated integrations.
What dryRun Checks
dryRun validates the same send request shape used by real sends:
- Motor Block API key format and authorization
- sender address and Motor Block domain match
- DNS readiness for the sending domain
- recipient shape
- subject length
- body presence and body size
It does not send email.
cURL Example
curl -X POST "https://api.motorical.com/v1/send" \
-H "Authorization: ApiKey $MK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "sender@yourdomain.com",
"to": ["recipient@example.com"],
"subject": "Dry-run validation",
"text": "Validate this message before sending.",
"html": "<p>Validate this message before sending.</p>",
"dryRun": true
}'
Expected Response
{
"success": true,
"dryRun": true,
"data": {
"status": "validated",
"domain": "yourdomain.com",
"recipientCount": 1,
"bodySize": 42
}
}
CI or Setup Check
Add a dry-run check to a deployment or setup script before enabling real sends.
const response = await fetch('https://api.motorical.com/v1/send', {
method: 'POST',
headers: {
Authorization: `ApiKey ${process.env.MK_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: process.env.TEST_EMAIL_FROM,
to: [process.env.TEST_EMAIL_TO],
subject: 'Motorical setup validation',
text: 'This is a validation-only request.',
dryRun: true
})
});
const result = await response.json();
if (!response.ok || !result.success || result.data.status !== 'validated') {
throw new Error(result.error || 'Motorical dry-run validation failed');
}
When To Use Real Sends Instead
Use a real send when you need to test:
- downstream provider acceptance
- actual inbox placement
- webhook event delivery
- delivery timelines and logs
Use a unique Idempotency-Key for real sends that may be retried.