Schedule a newsletter
Schedule a newsletter to send at a specific time. The newsletter must be in a draft state. If the newsletter has already been sent, you'll get a 400 error. If the newsletter is already scheduled, this endpoint updates the scheduled time.
The recipients for the newsletter are defined when you create/update the newsletter. If you're not sure who will receive the newsletter, you can use the List newsletters endpoint to get a list of newsletters and their recipients.
- Type: integernewsletter
_id requiredThe identifier of a newsletter.
- Type: object
Optional newsletter rate limiting. If you set
rate_limit_email_rateorrate_limit_time_period, set both;rate_limit_spreadcan be set alone.- Type: integerFormat: unix timestampscheduled
_at requiredUnix timestamp for the send. Use
0to deschedule. When greater than0, the time must be in the future and you must sendtimezoneso the UI displays the time correctly. - Type: integerrate
_limit _email _rate min:1Maximum number of messages per time period. NOTE: Though this states
email_rate, you can use this for other message channels. Only fixed rate limits are supported, not daily ramp limits. - Type: booleanrate
_limit _spread When
true, spreads messages evenly across the time period. Otherwise, it sends as fast as possible up to the limit in each period. - Type: integerenumrate
_limit _time _period Time period in seconds for rate limiting. Must be one of 60 (minute), 3600 (hour), or 86400 (day).
values- 60
- 3600
- 86400
- Type: stringtimezone
IANA timezone name (for example,
America/New_York). Required whenscheduled_atis greater than0. Not required when descheduling (scheduled_atis0). - Type: booleantz
_match _enabled When
true, sends at the same local time in each recipient's timezone. If it's set totrueandrate_limit_time_periodis provided, then the period can't be greater than3600(1 hour).
- application/json
- application/json
- 404
The newsletter does not exist.
- application/json
- 429
Your request is over the 10-per-second limit.
curl https://api.customer.io/v1/newsletters/1/schedule \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"scheduled_at": 1719849600,
"timezone": "America/New_York",
"tz_match_enabled": false,
"rate_limit_email_rate": 500,
"rate_limit_time_period": 60,
"rate_limit_spread": true
}'
{
"newsletter": {
"id": 128275,
"deduplicate_id": "128275:1484870424",
"type": "email",
"content_ids": [
45
],
"name": "Weekly Product Update",
"sent_at": null,
"created": 1481653919,
"updated": 1481653929,
"recipient_segment_ids": [
42,
99
],
"subscription_topic_id": 5
}
}The newsletter is scheduled for sending.