Schedule an email
Send a transactional email at a set time, up to 7 days ahead, such as a reminder the day before a trial ends. PostHog holds the email and sends it at that time. Scheduling works on PostHog Cloud, US and EU.
Send it later
Add scheduled_at to a send (scheduledAt or ScheduledAt in some SDKs). It works on both kinds of send: an email from your code with template_key, and a template in PostHog with template_id.
In the REST example, replace <time_in_the_next_7_days> with a time in the next 7 days when you run it, with a UTC offset, in the format YYYY-MM-DDThh:mm:ssZ.
The time needs a UTC offset:
- In the API: an ISO 8601 time, such as
2026-12-10T09:00:00Zor2026-12-10T10:00:00+01:00. Seconds and their fraction are optional. - In the SDKs: your language's date and time type with a time zone, such as a
datetimewithtzinfoin Python, atime.Timein Go, or aDateTimeOffsetin .NET. Most SDKs also take an ISO 8601 string with an offset.
PostHog keeps the time to the millisecond, and rounds a finer time up to the next millisecond, so the email never goes out early. A time that has already passed sends the email now.
Work out the time once, from data you store, such as when the trial ends. Then send the same time with the same idempotency key on every retry. The key covers the time, so the same key with a different time gets 422 idempotency_key_reused.
The response
PostHog returns 202 with a message ID, as for any send, and two more fields:
status | What it means |
|---|---|
scheduled | The email waits for scheduled_at. |
queued | The time had already passed, so the email goes out now. scheduled_at is null. |
The SDKs check that PostHog confirmed the time. Their result has the confirmed time, or no time when the email goes out now.
A status lookup returns scheduled until the time comes. Then it moves through the usual statuses, such as sent and delivered.
PostHog checks the email again before it goes out, such as its recipient. An email that fails a check doesn't go out, and its status is failed, with a reason.
Limits
- 7 days ahead. A time more than 7 days after the request gets
400 scheduled_too_far. - PostHog Cloud only. The SDKs schedule only through
https://us.posthog.comorhttps://eu.posthog.com. On any other host, such as a self-hosted PostHog, a reverse proxy, or a custom domain, they send nothing and returnscheduling_requires_cloud. - No changes after you send. You can't cancel, move, or list scheduled emails yet. A send with the same idempotency key and a new time doesn't move the email.
- One email at a time. A batch send doesn't take
scheduled_at. Schedule each email with its own send.
Errors
Scheduled sends can get the same errors as any other send. See retries and errors. These codes are only for scheduled sends:
| Code | From | What to do |
|---|---|---|
scheduled_too_far | PostHog, 400 | Send a time at most 7 days ahead. |
A field code, with attr set to scheduled_at | PostHog, 400 | Send an ISO 8601 time in the next 7 days, with a UTC offset, in the format YYYY-MM-DDThh:mm:ssZ. |
invalid_scheduled_at | SDKs | Send a real date and time with a UTC offset. The SDK sends nothing. |
scheduling_requires_cloud | SDKs | Send through PostHog Cloud. The SDK sends nothing. |
schedule_not_confirmed | SDKs | PostHog accepted the email but didn't confirm its time, so it can go out at another time. The error has the message ID. Read its status before you send it again. If you send it again, use the same idempotency key and the same request, within 24 hours. If the SDK made the key, don't send it again. |





