POST /marketplace/messaging/send-email — transactional email with optional template or inline HTML — through the gu1 messaging API for customer communications.
Sends a single transactional email for the authenticated organization. Requires the Email marketplace integration and a configured messaging provider. See Messaging overview for prerequisites, billing, and senders.Documentation Index
Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
Use this file to discover all available pages before exploring further.
noreply@your-domain.com). The domain must be registered and verified for your organization under Settings → Email → Domains. You do not need a matching row under Senders when the domain is already verified. Mutually exclusive with fromSenderId.fromEmail.fromEmail and fromSenderId, the API uses the platform default Gu1 sender. That is expected behavior, not an error.
fromEmail)fromEmail, for example example@my-domain.com, the API validates the domain (my-domain.com) before attempting delivery. The response is always 400 with { "success": false, "error": "<English message>" }; the email is not sent until the domain is verified.
| Situation | API response |
|---|---|
| Domain never added in Gu1 for your org | Domain "my-domain.com" is not registered in Gu1. Add and verify it under Settings → Email → Domains before using sender "example@my-domain.com". |
| Domain exists in Gu1 but DNS not verified yet | Domain "my-domain.com" is not verified yet. Complete DNS records and click Verify under Settings → Email → Domains. |
| Domain verified | Request continues; any local part on that domain is allowed (example@…, noreply@…, etc.) without a Senders row. If the address exists in Senders, its display name is used. |
{{placeholders}} in subject, htmlBody, textBody, or in a stored template. Values may be strings, numbers, or booleans (coerced for rendering). Default {}.htmlBody or textBody in this mode.
templateId.
{{variables}} replaced via templateParams.{{variables}}.{{variables}}.htmlBody or textBody.
MessageDeliveryService / provider response.
{ "success": false, "error": "<English message>" } unless noted. All error strings are in English. Invalid JSON bodies may return a different shape from the validator (e.g. Zod field issues) at 400.
| Situation | Typical status | Example error (or note) |
|---|---|---|
| Email integration off for the org | 400 | Email integration is not active. Enable Email (global_sender_email) in Applications (Marketplace) for this organization. |
| Messaging provider URL not set (server) | 400 | MS_PROVIDER_URL is not configured on the server. Configure the messaging provider to send email. |
| Cost > 0 and no pack quota / credits | 400 | Insufficient balance for this send (cost … credits). Add tokens… (see response for full text) |
| Send succeeded but billing failed | 400 | Insufficient balance to record billing for this send. Current balance (…) is below required (…). … |
Both templateId and inline body | 400 (validation) | Use either templateId + templateParams, or htmlBody/textBody only — not both. |
| Neither template nor body | 400 (validation) | Provide templateId or htmlBody/textBody. |
Inline mode without subject | 400 (validation) | subject is required when not using a template. |
| Template UUID wrong / other org | 404 | Template not found or not accessible for this organization. |
| Template exists but not email channel | 400 | Template channel is "<channel>"; email is required. |
| Template + empty subject after render | 400 | The template has no subject or it is empty after replacing variables. Send subject in the request body or set the subject on the template. |
Both fromSenderId and fromEmail | 400 | Send only one of fromSenderId or fromEmail, not both. |
Unknown fromSenderId | 400 | fromSenderId does not match a sender for this organization. Check Settings → Email → Senders. |
fromEmail domain not registered for the org | 400 | Domain "…" is not registered in Gu1. Add and verify it under Settings → Email → Domains before using sender "…". |
| Domain registered but DNS not verified | 400 | Domain "…" is not verified yet. Complete DNS records and click Verify under Settings → Email → Domains. |
Empty inline subject after {{…}} | 400 | Subject is empty after replacing variables. |
| Empty body after render | 400 | htmlBody or textBody is empty after rendering. |
| No session org | 401 | { "error": "Organization ID not found" } (no success field) |
{ "success": false, "error": "…" } (e.g. provider rejection) at 200 or an error status depending on implementation—inspect success and error on every response.