> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Status and troubleshooting Canonical URL: https://posthog.com/docs/workflows/transactional/status > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links). ## On this page - [Check a status](#check-a-status) - [Find an email by its idempotency key](#find-an-email-by-its-idempotency-key) - [An email didn't arrive](#an-email-didnt-arrive) Each send returns a message ID. Use it to check what happened to the email for 30 days. A key with the **Transactional email** scope set to **Read** or **Write** can read statuses. Debugging a send? Your agent can read the timeline of each send and explain what went wrong. It reads only, and sends nothing: Ask your agentwith the [PostHog MCP](https://posthog.com/docs/workflows/mcp.md)[measuring-email-performance](https://posthog.com/docs/workflows/skills.md) “Check the delivery timeline for our latest transactional emails to ada@example.com and explain why any failed.” Copy ## Check a status ### Node.js ```javascript const { data } = await posthog.emails.get(messageId) console.log(data.status, data.reason) ``` ### Python ```python email = posthog.emails.get(message_id) print(email.status, email.reason) ``` ### Ruby ```ruby status = $posthog.emails.get(message_id) puts status.status, status.reason ``` ### Rust ```rust let status = posthog.emails().get(message_id).await?; println!("{}", status.status.as_str()); ``` ### PHP ```php $status = PostHog::emails()->get($messageId); echo $status->getStatus(), ' ', $status->getReason(); ``` ### Go ```go status, err := client.Emails().Get(ctx, messageID) fmt.Println(status.Status) ``` ### .NET ```csharp var status = await emails.GetAsync(messageId); Console.WriteLine($"{status.Status} {status.Reason}"); ``` ### Elixir ```elixir {:ok, status} = PostHog.Emails.get(message_id) IO.inspect({status.status, status.reason}) ``` ### REST ```bash curl "https://us.posthog.com/api/messaging/emails//" \ -H "Authorization: Bearer $POSTHOG_PROJECT_SECRET_API_KEY" ``` | `status` | What it means | | --- | --- | | `queued` | Waiting to go out. | | `sent` | Handed to the email provider. | | `delivered` | The recipient's mail server accepted it. | | `bounced` | The mail server refused it. `reason` is `hard`, `soft`, or `unknown`. | | `complained` | The recipient marked it as spam. | | `failed` | It wasn't sent. `reason` says why. | New statuses can appear, so handle values you don't know. A `failed` email's `reason` is one of: - `provider_error` or `provider_rejected`: the email provider refused it. - `recipient_suppressed`, `recipient_unreachable`, or `missing_recipient`: PostHog skipped it because of the recipient. - `sending_paused` or `sending_suspended`: check the **Reputation** tab. - `canceled`, `workflow_unavailable`, or an error such as `timeout`: the send stopped before it went out. More of these can appear. A lookup returns `404` for an email sent a few seconds ago, because its first status takes a few seconds to arrive. Retry shortly. It also returns `404` for an email older than 30 days, or an ID from another project. ## Find an email by its idempotency key If the response to a send was lost, you don't have its message ID. Look the email up by the idempotency key you sent instead: ```bash curl "https://us.posthog.com/api/messaging/emails/status/?idempotency_key=password-reset-8f14e45f" \ -H "Authorization: Bearer $POSTHOG_PROJECT_SECRET_API_KEY" ``` It returns the same fields as a lookup by ID, for the latest send with that key. Compare its `created_at` with when you sent: an earlier time means an earlier send with the same key. A `404` doesn't mean the email wasn't sent. To make sure it goes out once, send it again with the same key within 7 days. ## An email didn't arrive Work down the list: 1. **Did the send return a message ID?** If not, its error `code` says why. See [retries and errors](https://posthog.com/docs/workflows/transactional/retries-and-errors.md). 2. **Is it in the Log?** If not, check that your key is from the right project. 3. **Is it `queued`?** Transactional emails go out ahead of marketing emails, so this is usually short. If it lasts minutes, [contact support](https://app.posthog.com/#panel=support). 4. **Is it `failed` or `bounced`?** `reason` says why. 5. **Is it `delivered`?** The mail server accepted it. Check the spam folder, and check that your [domain's DNS records](https://posthog.com/docs/workflows/domain.md#the-dns-records) are still in place. Open the send in the [**Log**](https://posthog.com/docs/workflows/transactional.md#see-each-send) to see each step, and what the person did around it: ![One send in the Log, with its steps from sent to clicked and what the person did around it](https://res.cloudinary.com/dmukukwp6/image/upload/w_1600,c_limit,q_auto,f_auto/pp_recipient_activity_light_bb68d5b296.png) To list your sends and their outcomes, see the [email logs API reference](https://posthog.com/docs/api/email-logs.md).