Skip to content

Delay

The Delay endpoint calculates the optimal send time for a template variant. Use it to implement send-time optimization — scheduling messages to arrive when each user is most likely to engage.

GET https://worker.justwords.ai/api/delay/:org_slug

This endpoint requires authentication via an API key. Include your key in the X-Api-Key header or as a Bearer token in the Authorization header.

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

ParameterTypeRequiredDescription
org_slugstringYesYour organization identifier (e.g., your-company-name).
ParameterTypeRequiredDescription
delay_idstringYesThe variant ID to calculate a delay for (typically from a prior Generate response).
user_idstringNoUnique identifier for the end user (used for per-user optimization).
emailstringNoEmail address of the end user (alternative to user_id).
Terminal window
curl "https://worker.justwords.ai/api/delay/your-org?delay_id=variant_abc123&user_id=user_123" \
-H "X-Api-Key: your_api_key"
  1. Call the Generate endpoint to select a variant.
  2. Pass the returned copy.id as the delay_id to this endpoint.
  3. Schedule your message to send at the returned delay_time.
{
"just_words": {
"delay_id": "variant_abc123",
"delay_time": "2024-01-15T14:30:00.000Z"
}
}
FieldTypeDescription
just_words.delay_idstringThe variant ID that was evaluated.
just_words.delay_timestringISO-8601 timestamp indicating when the message should be sent.