Send a notification
const url = 'https://your-notavia-host/v1/notifications';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"channel":"email","recipient":{"address":"example","name":"example","external_user_id":"example","endpoint":"example","slack_user_id":"example","slack_channel_id":"example","teams_endpoint_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","discord_endpoint_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"},"subject":"example","html_body":"example","text_body":"example","template_key":"example","template_data":{},"action_url":"example","category":"example","attachments":[{"filename":"example","content_type":"example","content_base64":"example"}],"from_name":"example","reply_to":"hello@example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-notavia-host/v1/notifications \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "channel": "email", "recipient": { "address": "example", "name": "example", "external_user_id": "example", "endpoint": "example", "slack_user_id": "example", "slack_channel_id": "example", "teams_endpoint_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "discord_endpoint_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "subject": "example", "html_body": "example", "text_body": "example", "template_key": "example", "template_data": {}, "action_url": "example", "category": "example", "attachments": [ { "filename": "example", "content_type": "example", "content_base64": "example" } ], "from_name": "example", "reply_to": "hello@example.com" }'Persists the notification and dispatches it via the requested channel.
Returns 202 Accepted on the first successful call. Returns 200 OK
when the same Idempotency-Key is replayed within 24 hours.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Client-generated key (UUID recommended). Repeat requests with the same key within 24 hours return the original response without re-sending.
Request Body required
Section titled “Request Body required ”object
Notification channel identifier.
Identifies the notification target. At most one typed field should be
set; the server selects the correct field based on channel.
- Email / SMS / In-app: use
address(email address, phone number E.164, or opaque external user id). - Slack: use
slack_user_id(for DMs) orslack_channel_id(for channel posts). - Teams / Discord: use
endpoint(the endpoint key, e.g."billing-alerts") or the legacyteams_endpoint_id/discord_endpoint_id(UUID of the configured endpoint). external_user_idresolves the recipient via stored preference/inbox records.nameis used only for emailTo:display name and in-app display.
object
The key of a Discord or Teams endpoint (e.g. "billing-alerts"). Preferred over the legacy
UUID fields. When set, teams_endpoint_id / discord_endpoint_id are ignored.
Slack user id (Uxxxxxxxx) for DM delivery. Mutually exclusive with slack_channel_id.
Slack channel id (Cxxxxxxxx) for channel-post delivery. Mutually exclusive with slack_user_id.
UUID of the TeamsWebhookEndpoint to send to. Legacy — prefer endpoint (the key).
UUID of the DiscordWebhookEndpoint to send to. Legacy — prefer endpoint (the key).
Email subject line. Ignored for non-email channels.
Inline HTML body. Ignored when template_key is set. Email/in-app only.
Inline plain-text body. Email/SMS only.
Key of a stored template. Required for Slack, Teams, Discord channels.
Liquid template variables merged at render time.
object
Optional CTA URL surfaced in in-app notifications.
Preference category key. Suppresses the send when the recipient has opted out.
File attachments for email notifications (email channel only). Maximum 10 files; maximum 15 MB per file and 15 MB total. File content must be base64-encoded. Bytes are stored ephemerally and deleted after delivery — only metadata is retained in the audit log.
object
File name shown to the recipient, e.g. "statement.pdf".
MIME type of the file, e.g. "application/pdf".
Base64-encoded file content.
Optional per-message sender display name (email channel only). Overrides the
environment’s default display name; the From address itself is fixed by the
environment’s sender identity. Must not contain <, >, or control characters.
Ignored when the managed sender is operator-locked.
Optional per-message Reply-To address (email channel only). Must be a bare, valid email address.
Responses
Section titled “ Responses ”Idempotent replay — previously accepted notification returned.
object
Notification channel identifier.
object
object
object
A step in the message’s life: Queued, Sending, Sent, Retrying, Failed, Delivered, Bounced, Complained, DeliveryDelayed, Opened, Clicked, FailedOver, AttemptFailed. FailedOver means a provider refused the message and the next provider in your chain was tried; AttemptFailed means a provider refused it and there was nowhere left to go. Deliberately an open string, not an enum — new values are added over time and must not break a generated client.
Metadata for files that were attached to this email notification.
Bytes are purged after delivery; the purged flag indicates whether
this has occurred. Omitted when the notification had no attachments.
object
Original file name.
MIME type of the file.
File size in bytes.
True when the attachment bytes have been deleted from ephemeral storage after delivery. The metadata fields (filename, content_type, size_bytes) are always retained.
Example
{ "status": "queued", "channel": "email", "events": [ { "type": "FailedOver" } ]}Notification accepted and queued for dispatch.
object
Notification channel identifier.
object
object
object
A step in the message’s life: Queued, Sending, Sent, Retrying, Failed, Delivered, Bounced, Complained, DeliveryDelayed, Opened, Clicked, FailedOver, AttemptFailed. FailedOver means a provider refused the message and the next provider in your chain was tried; AttemptFailed means a provider refused it and there was nowhere left to go. Deliberately an open string, not an enum — new values are added over time and must not break a generated client.
Metadata for files that were attached to this email notification.
Bytes are purged after delivery; the purged flag indicates whether
this has occurred. Omitted when the notification had no attachments.
object
Original file name.
MIME type of the file.
File size in bytes.
True when the attachment bytes have been deleted from ephemeral storage after delivery. The metadata fields (filename, content_type, size_bytes) are always retained.
Example
{ "status": "queued", "channel": "email", "events": [ { "type": "FailedOver" } ]}Validation or request error.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Missing or invalid credentials.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Credentials do not have the required scope.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Conflict (e.g. duplicate key, idempotency collision).
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}