Skip to content

Deliver

The Deliver endpoint queues an email for delivery through Customer.io. JustAI selects the optimal variant and handles delivery on your behalf.

POST https://worker.justwords.ai/api/deliver/:org_slug

This endpoint requires authentication via an API key. Include your key in the X-Api-Key header.

See the Quickstart for details on creating and managing API keys.

ParameterTypeRequiredDescription
org_slugstringYesYour organization identifier (e.g., your-company-name).
FieldTypeRequiredDefaultDescription
template_idstringYes-Unique identifier for the template.
emailstringYes-Recipient email address.
copy_idstringNo-Force a specific variant by ID.
attrsobjectNo{}Key-value pairs for targeting/filtering.
fieldsobjectNo{}Key-value pairs for LiquidJS template variable substitution.
lookback_daysnumberNo14Number of days of historical data to use for optimization.
offset_daysnumberNo3Number of days to offset the lookback window.
use_cachebooleanNotrueWhether to use cached results.
epsilonnumberNo-Exploration rate override for the bandit algorithm.
Terminal window
curl -X POST https://worker.justwords.ai/api/deliver/your-org \
-H "X-Api-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"template_id": "welcome-email",
"email": "alice@example.com"
}'
{
"template_id": "welcome-email",
"email": "alice@example.com",
"fields": {
"user_name": "Alice",
"account_type": "premium"
},
"attrs": {
"plan": "premium",
"region": "us-east"
}
}
{
"status": "ok"
}

A 200 response means the message has been queued for delivery. It does not mean the email has been sent yet — delivery happens asynchronously.