ReferenceReference by module

Notifications API

Every Notifications action (20) and data model (7): endpoints, scopes, input, preconditions, events and examples.

Who is told about what — by email, SMS, WhatsApp or in the app.

Module code notifications · 20 actions · 7 data models · 18 events. A key or token never does more here than the person behind it can; row-level security applies exactly as in the app. Scopes: notifications (everything), notifications:read (read only) or notifications:<capability>.

Resources

ResourceTableList and readPOSTPATCHDELETE
notification_channelsnotification_channel/api/v1/notification_channels
notification_deliveriesnotification_delivery/api/v1/notification_deliveries
notification_email_templatesnotification_email_template/api/v1/notification_email_templates
notification_inboxesnotification_inbox/api/v1/notification_inboxes
notification_preferencesnotification_preference/api/v1/notification_preferences
notification_rulesnotification_rule/api/v1/notification_rules
notification_user_settingsnotification_user_setting/api/v1/notification_user_settings

Lists take limit (up to 200), cursor, order (e.g. -created_at), fields and q; every other query parameter is a column filter: ?status=paid, ?total[gte]=100, ?id[in]=a,b, ?x=null.

Actions

ActionNeedsWhat it does
notifications.create_channelnotifications:manageAdd a delivery channel
notifications.create_rulenotifications:manageAdd a notification rule
notifications.delete_channelnotifications:deleteRemove a delivery channel
notifications.delete_rulenotifications:deleteRemove a notification rule
notifications.mark_readnotifications:readMark notifications read
notifications.purge_historynotifications:deleteSweep delivery history
notifications.queue_deliverynotifications:handleQueue a notification
notifications.record_site_emailnotifications:handleRecord a site email
notifications.reset_email_templatenotifications:manageRestore the default wording
notifications.retry_deliverynotifications:manageRetry a notification
notifications.save_email_templatenotifications:manageSave a customer email
notifications.send_customer_messagenotifications:handleSend a message to the customer
notifications.send_emailnotifications:handleSend an email
notifications.send_testnotifications:manageSend a test notification
notifications.send_test_email_templatenotifications:manageSend a test email
notifications.set_preferencenotifications:readSet a notification preference
notifications.set_rule_activenotifications:manageSwitch a rule on or off
notifications.set_user_settingsnotifications:readSet my notification schedule
notifications.settle_deliverynotifications:handleRecord a delivery outcome
notifications.update_rulenotifications:manageEdit a notification rule

notifications.create_channel

Add a delivery channel — Where notifications go: a webhook, a set of addresses, a Slack channel or a push endpoint.

Needs notifications:manage · changes data

POSThttps://app.getera.io/api/v1/notification_channels/actions/create_channel
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.create_channel

Input

FieldTypeRequiredNotes
typestring (enum)yesChannel · Allowed values: webhook, email, slack, push
namestringyesName · max 120
urlstringURL · Webhook and push channels. · max 2000
recipientsstringRecipients · Email channels. Comma-separated. · max 2000
configstringConfiguration · JSON. Slack channels carry the account and the channel id here. · max 8000
credential_iduuidCredential · Holds the signing secret or the OAuth token. Never stored on the channel itself.

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
invalid_urlThat does not look like a web address.
insecure_urlThe address must use https.
url_requiredA webhook or push channel needs a URL.
recipients_requiredAn email channel needs at least one address.
too_many_recipientsAn email channel may carry at most ten addresses.
invalid_configThe configuration must be a JSON object.
name_takenThis workspace already has a channel of that type with that name.

Events it publishes: notifications.channel_created

What it writes: notification_channel (insert) — Adds the channel, unverified until something has reached it

curl -X POST https://app.getera.io/api/v1/notification_channels/actions/create_channel \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"type":"webhook","name":"Name"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.channel_created"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationChannels.createChannel({
  type: "webhook",
  name: "Name"
})
era notification_channels create_channel \
  --type "webhook" \
  --name "Name"
tools/call
{
  "name": "era__notifications__create_channel",
  "arguments": {
    "type": "webhook",
    "name": "Name"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 invalid_url, insecure_url, url_required, recipients_required, too_many_recipients, invalid_config, name_taken · 429 slow down

notifications.create_rule

Add a notification rule — Which events reach a channel or a person, in which words, and how often.

Needs notifications:manage · changes data

POSThttps://app.getera.io/api/v1/notification_rules/actions/create_rule
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.create_rule

Input

FieldTypeRequiredNotes
channel_iduuidChannel · For a channel rule. · id of notification_channel
namestringyesName · max 120
eventsstringEvents · Comma-separated. Leave empty for every event. · max 2000
conditionstringCondition · JSON. Leave empty to fire on every matching event. · max 4000
cooldown_minutesnumberQuiet period (minutes)
include_outputbooleanInclude the result
include_tracebooleanInclude the trace · Webhook channels only — a trace is too large for email and Slack.
recipientstring (enum)Who is told · A channel, or people found in the event (owner, assignee, mentioned…) or chosen here. · Allowed values: channel, owner, assignee, mentioned, recipient, member, role, capability, customer
recipient_user_iduuidMember · For “a specific member”.
recipient_rolestringRole · For “everyone with a role”: the role key. · max 80
recipient_capabilitystringPermission · For “everyone holding a permission”: module:capability. · max 80
mediumsstringReach them by · Comma-separated: in_app, email, sms, whatsapp. · max 200
categorystringCategory · What a person switches on or off. Empty means the event’s module. · max 41
title_templatestringTitle · Variables: {{event_label}}, {{recipient.name}}, {{workspace.name}}, or any payload key like {{person}}. · max 300
body_templatestringMessage · max 4000
link_templatestringLink · A path in the app. Empty means the record the event is about. · max 500

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
channel_not_foundNo such channel in this workspace.
trace_needs_webhookOnly a webhook channel can carry a trace.
invalid_conditionThe condition must be a JSON object.
cooldown_out_of_rangeThe quiet period must be between 0 minutes and 7 days.
name_takenThis workspace already has a rule with that name.
rule_limit_reachedThis workspace already has the maximum number of rules on that channel.
recipient_incompleteThe rule must say fully who it tells: a channel, or people and how to reach them.

Events it publishes: notifications.rule_created

What it writes: notification_rule (insert) — Adds the rule, active

curl -X POST https://app.getera.io/api/v1/notification_rules/actions/create_rule \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Name"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.rule_created"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationRules.createRule({
  name: "Name"
})
era notification_rules create_rule \
  --name "Name"
tools/call
{
  "name": "era__notifications__create_rule",
  "arguments": {
    "name": "Name"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 channel_not_found, trace_needs_webhook, invalid_condition, cooldown_out_of_range, name_taken, rule_limit_reached, recipient_incomplete · 429 slow down

notifications.delete_channel

Remove a delivery channel — Refused while a rule still points at it, so no rule is silently orphaned.

Needs notifications:delete · removes or cannot be undone · asks a person to confirm when Era runs it

POSThttps://app.getera.io/api/v1/notification_channels/actions/delete_channel
API key or OAuth token · notifications:delete
  • Canonical address: POST /api/v1/actions/notifications.delete_channel

Input

FieldTypeRequiredNotes
channel_iduuidyesChannel

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
channel_not_foundNo such channel in this workspace.
channel_in_useA rule still sends to that channel.

Events it publishes: notifications.channel_deleted

What it writes: notification_channel (delete) — Removes the channel

curl -X POST https://app.getera.io/api/v1/notification_channels/actions/delete_channel \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"channel_id":"CHANNEL_ID"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.channel_deleted"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationChannels.deleteChannel({
  channel_id: "CHANNEL_ID"
})
era notification_channels delete_channel \
  --channel-id "CHANNEL_ID"
tools/call
{
  "name": "era__notifications__delete_channel",
  "arguments": {
    "channel_id": "CHANNEL_ID"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:delete · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 channel_not_found, channel_in_use · 429 slow down

notifications.delete_rule

Remove a notification rule — Removes the rule and its delivery history. The channel stays.

Needs notifications:delete · removes or cannot be undone · asks a person to confirm when Era runs it

POSThttps://app.getera.io/api/v1/notification_rules/actions/delete_rule
API key or OAuth token · notifications:delete
  • Canonical address: POST /api/v1/actions/notifications.delete_rule

Input

FieldTypeRequiredNotes
rule_iduuidyesRule

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
rule_not_foundNo such rule in this workspace.

Events it publishes: notifications.rule_deleted

What it writes: notification_rule (delete) — Removes the rule; its deliveries cascade

curl -X POST https://app.getera.io/api/v1/notification_rules/actions/delete_rule \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"rule_id":"RULE_ID"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.rule_deleted"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationRules.deleteRule({
  rule_id: "RULE_ID"
})
era notification_rules delete_rule \
  --rule-id "RULE_ID"
tools/call
{
  "name": "era__notifications__delete_rule",
  "arguments": {
    "rule_id": "RULE_ID"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:delete · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 rule_not_found · 429 slow down

notifications.mark_read

Mark notifications read — Marks some or all of your in-app notifications read (or one unread again).

Needs notifications:read · changes data

POSThttps://app.getera.io/api/v1/notification_inboxes/actions/mark_read
API key or OAuth token · notifications:read
  • Canonical address: POST /api/v1/actions/notifications.mark_read

Input

FieldTypeRequiredNotes
idsstringNotifications · Comma-separated ids. · max 8000
allbooleanAll of them
unreadbooleanMark unread instead

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
notification_not_foundNone of those notifications are yours.

Events it publishes: notifications.inbox_read

What it writes: notification_inbox (update) — Stamps read_at on your notifications

curl -X POST https://app.getera.io/api/v1/notification_inboxes/actions/mark_read \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"ids":"Notifications"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.inbox_read"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationInboxes.markRead({
  ids: "Notifications"
})
era notification_inboxes mark_read \
  --ids "Notifications"
tools/call
{
  "name": "era__notifications__mark_read",
  "arguments": {
    "ids": "Notifications"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:read · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 notification_not_found · 429 slow down

notifications.purge_history

Sweep delivery history — Removes finished deliveries older than the retention window. Pending ones are never touched.

Needs notifications:delete · removes or cannot be undone

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/purge_history
API key or OAuth token · notifications:delete
  • Canonical address: POST /api/v1/actions/notifications.purge_history

Input

FieldTypeRequiredNotes
daysnumberKeep for (days) · max 3650

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
retention_too_shortRetention must be at least one day.

Events it publishes: notifications.history_purged

What it writes: notification_delivery (delete) — Removes delivered, failed and suppressed rows older than the window

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/purge_history \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"days":1}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.history_purged"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.purgeHistory({
  days: 1
})
era notification_deliveries purge_history \
  --days 1
tools/call
{
  "name": "era__notifications__purge_history",
  "arguments": {
    "days": 1
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:delete · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 retention_too_short · 429 slow down

notifications.queue_delivery

Queue a notification — Writes the delivery, or writes why it was deliberately not sent.

Needs notifications:handle · changes data

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/queue_delivery
API key or OAuth token · notifications:handle
  • Canonical address: POST /api/v1/actions/notifications.queue_delivery

Input

FieldTypeRequiredNotes
rule_iduuidyesRule
event_namestringyesEvent · max 120
source_idstringSource · The event or execution this came from. · max 200
recipient_user_iduuidRecipient · When the notification is aimed at one person, so their preference can be honoured.
payloadstringPayload · JSON. The event payload the message is written from. · max 100000

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
rule_not_foundNo such rule in this workspace.
event_not_matchedThat rule does not cover this event.

Events it publishes: notifications.queued, notifications.suppressed

What it writes: notification_delivery (insert) — Writes the delivery as pending, or as suppressed with a reason; notification_rule (update) — Stamps the rule’s quiet period when it fires; notification_inbox (insert) — Puts an in-app notification in each person’s bell

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/queue_delivery \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"rule_id":"RULE_ID","event_name":"Event"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.queued",
    "notifications.suppressed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.queueDelivery({
  rule_id: "RULE_ID",
  event_name: "Event"
})
era notification_deliveries queue_delivery \
  --rule-id "RULE_ID" \
  --event-name "Event"
tools/call
{
  "name": "era__notifications__queue_delivery",
  "arguments": {
    "rule_id": "RULE_ID",
    "event_name": "Event"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:handle · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 rule_not_found, event_not_matched · 429 slow down

notifications.record_site_email

Record a site email — Machine-only: an email the website already sent to a customer, written into the delivery log.

Needs notifications:handle · changes data

Run by Era itself (machine-only). Listed so the reference is complete; an API key or a token is refused (403 machine_only).
POSThttps://app.getera.io/api/v1/notification_deliveries/actions/record_site_email
API key or OAuth token · notifications:handle
  • Canonical address: POST /api/v1/actions/notifications.record_site_email

Input

FieldTypeRequiredNotes
tostringyesTo · max 320
subjectstringyesSubject · max 300
textstringMessage · max 20000
htmlstringHTML part · max 300000
event_namestringyesEvent · max 120
source_idstringSource · max 200
deliveredbooleanyesDelivered
errorstringError · max 2000
redactedbooleanBody not kept

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
invalid_recipientThe address is an email address.

What it writes: notification_delivery (insert) — Writes the delivered (or failed) email row

Errors: 401 no or expired credential · 403 the credential does not hold notifications:handle · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 invalid_recipient · 429 slow down

notifications.reset_email_template

Restore the default wording — Drops this workspace’s wording of one customer email; the default applies again.

Needs notifications:manage · removes or cannot be undone · asks a person to confirm when Era runs it

POSThttps://app.getera.io/api/v1/notification_email_templates/actions/reset_email_template
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.reset_email_template

Input

FieldTypeRequiredNotes
kindstringyesEmail · max 40

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
unknown_email_templateThe email must be one of the customer emails.

Events it publishes: notifications.email_template_changed

What it writes: notification_email_template (delete) — Removes the workspace’s wording

curl -X POST https://app.getera.io/api/v1/notification_email_templates/actions/reset_email_template \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"kind":"Email"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.email_template_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationEmailTemplates.resetEmailTemplate({
  kind: "Email"
})
era notification_email_templates reset_email_template \
  --kind "Email"
tools/call
{
  "name": "era__notifications__reset_email_template",
  "arguments": {
    "kind": "Email"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 unknown_email_template · 429 slow down

notifications.retry_delivery

Retry a notification — Puts a failed delivery back on the queue, due now, with its attempts reset.

Needs notifications:manage · changes data

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/retry_delivery
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.retry_delivery

Input

FieldTypeRequiredNotes
delivery_iduuidyesDelivery

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
delivery_not_foundNo such delivery in this workspace.
delivery_not_failedOnly a failed delivery can be retried.

Events it publishes: notifications.delivery_retried

What it writes: notification_delivery (update) — Returns the delivery to pending, due now

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/retry_delivery \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"delivery_id":"DELIVERY_ID"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.delivery_retried"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.retryDelivery({
  delivery_id: "DELIVERY_ID"
})
era notification_deliveries retry_delivery \
  --delivery-id "DELIVERY_ID"
tools/call
{
  "name": "era__notifications__retry_delivery",
  "arguments": {
    "delivery_id": "DELIVERY_ID"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 delivery_not_found, delivery_not_failed · 429 slow down

notifications.save_email_template

Save a customer email — Replaces the wording of one customer email for this workspace.

Needs notifications:manage · changes data

POSThttps://app.getera.io/api/v1/notification_email_templates/actions/save_email_template
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.save_email_template

Input

FieldTypeRequiredNotes
kindstringyesEmail · max 40
subjectstringyesSubject · max 300
bodystringyesBody · max 20000

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
unknown_email_templateThe email must be one of the customer emails.

Events it publishes: notifications.email_template_changed

What it writes: notification_email_template (upsert) — Writes the workspace’s wording

curl -X POST https://app.getera.io/api/v1/notification_email_templates/actions/save_email_template \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"kind":"Email","subject":"Subject","body":"Body"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.email_template_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationEmailTemplates.saveEmailTemplate({
  kind: "Email",
  subject: "Subject",
  body: "Body"
})
era notification_email_templates save_email_template \
  --kind "Email" \
  --subject "Subject" \
  --body "Body"
tools/call
{
  "name": "era__notifications__save_email_template",
  "arguments": {
    "kind": "Email",
    "subject": "Subject",
    "body": "Body"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 unknown_email_template · 429 slow down

notifications.send_customer_message

Send a message to the customer — Queues one message to one customer — WhatsApp or SMS through a connected inbox, email through the branded sender, or the best of the three.

Needs notifications:handle · reaches outside (sends, publishes or charges)

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/send_customer_message
API key or OAuth token · notifications:handle
  • Canonical address: POST /api/v1/actions/notifications.send_customer_message

Input

FieldTypeRequiredNotes
customer_iduuidyesCustomer
mediumstring (enum)yesBy · Allowed values: sms, whatsapp, email, auto
textstringyesMessage · max 1600
subjectstringSubject · max 300
event_namestringyesEvent · max 120
source_idstringSource · max 200

Events it publishes: notifications.queued

What it writes: notification_delivery (insert) — Writes a pending delivery to one customer on one medium

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/send_customer_message \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"customer_id":"CUSTOMER_ID","medium":"sms","text":"Message","event_name":"Event"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.queued"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.sendCustomerMessage({
  customer_id: "CUSTOMER_ID",
  medium: "sms",
  text: "Message",
  event_name: "Event"
})
era notification_deliveries send_customer_message \
  --customer-id "CUSTOMER_ID" \
  --medium "sms" \
  --text "Message" \
  --event-name "Event"
tools/call
{
  "name": "era__notifications__send_customer_message",
  "arguments": {
    "customer_id": "CUSTOMER_ID",
    "medium": "sms",
    "text": "Message",
    "event_name": "Event"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:handle · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 429 slow down

notifications.send_email

Send an email — Queues one message to one address through an email channel and the real sender.

Needs notifications:handle · reaches outside (sends, publishes or charges)

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/send_email
API key or OAuth token · notifications:handle
  • Canonical address: POST /api/v1/actions/notifications.send_email

Input

FieldTypeRequiredNotes
tostringyesTo · max 320
subjectstringyesSubject · max 300
textstringyesMessage · max 20000
htmlstringHTML part · max 300000
event_namestringyesEvent · max 120
source_idstringSource · max 200
channel_iduuidChannel · id of notification_channel
from_connectionstringSend from · mine = the Run-as person’s own Gmail/Outlook · workspace = the company one · or a connection id. Empty = the platform sender. · max 64

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
invalid_recipientThe address is not an email address.
no_email_channelNo active email channel exists to send from.
bad_connectionSend from is mine, workspace or a connection id.

Events it publishes: notifications.queued

What it writes: notification_delivery (insert) — Writes a pending delivery addressed to one recipient

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/send_email \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"to":"To","subject":"Subject","text":"Message","event_name":"Event"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.queued"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.sendEmail({
  to: "To",
  subject: "Subject",
  text: "Message",
  event_name: "Event"
})
era notification_deliveries send_email \
  --to "To" \
  --subject "Subject" \
  --text "Message" \
  --event-name "Event"
tools/call
{
  "name": "era__notifications__send_email",
  "arguments": {
    "to": "To",
    "subject": "Subject",
    "text": "Message",
    "event_name": "Event"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:handle · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 invalid_recipient, no_email_channel, bad_connection · 429 slow down

notifications.send_test

Send a test notification — Queues one message to the channel through the real sender and records the outcome.

Needs notifications:manage · reaches outside (sends, publishes or charges)

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/send_test
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.send_test

Input

FieldTypeRequiredNotes
channel_iduuidyesChannel · id of notification_channel

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
channel_not_foundNo such channel in this workspace.

Events it publishes: notifications.test_queued

What it writes: notification_delivery (insert) — Writes a pending test delivery

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/send_test \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"channel_id":"NOTIFICATION_CHANNEL_ID"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.test_queued"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.sendTest({
  channel_id: "NOTIFICATION_CHANNEL_ID"
})
era notification_deliveries send_test \
  --channel-id "NOTIFICATION_CHANNEL_ID"
tools/call
{
  "name": "era__notifications__send_test",
  "arguments": {
    "channel_id": "NOTIFICATION_CHANNEL_ID"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 channel_not_found · 429 slow down

notifications.send_test_email_template

Send a test email — Sends one customer email, filled with sample values, to an address you choose.

Needs notifications:manage · reaches outside (sends, publishes or charges)

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/send_test_email_template
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.send_test_email_template

Input

FieldTypeRequiredNotes
kindstringyesEmail · max 40
tostringyesSend to · max 320
subjectstringSubject · max 300
bodystringBody · max 20000

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
unknown_email_templateThe email must be one of the customer emails.
invalid_recipientThe address is not an email address.
no_email_channelNo active email channel exists to send from.

Events it publishes: notifications.test_queued

What it writes: notification_delivery (insert) — Writes a pending test delivery to one address

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/send_test_email_template \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"kind":"Email","to":"Send to"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.test_queued"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.sendTestEmailTemplate({
  kind: "Email",
  to: "Send to"
})
era notification_deliveries send_test_email_template \
  --kind "Email" \
  --to "Send to"
tools/call
{
  "name": "era__notifications__send_test_email_template",
  "arguments": {
    "kind": "Email",
    "to": "Send to"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 unknown_email_template, invalid_recipient, no_email_channel · 429 slow down

notifications.set_preference

Set a notification preference — Whether someone is told, on which channel type, and until when they are muted.

Needs notifications:read · changes data

POSThttps://app.getera.io/api/v1/notification_preferences/actions/set_preference
API key or OAuth token · notifications:read
  • Canonical address: POST /api/v1/actions/notifications.set_preference

Input

FieldTypeRequiredNotes
user_iduuidPerson · Leave empty to change your own.
channel_typestring (enum)yesChannel · Allowed values: webhook, email, slack, push, in_app
event_namestringEvent or category · Leave empty to cover every event on that channel type; a key without a dot is a category. · max 120
enabledbooleanyesTell me
muted_untildate-timeMuted until · A snooze. Clears itself.

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
not_your_preferenceChanging someone else’s preferences needs the manage capability.
not_a_memberThat person is not a member of this workspace.
mute_in_pastThe mute already expires in the past.

Events it publishes: notifications.preference_changed

What it writes: notification_preference (upsert) — Writes the person’s preference for that channel type and event

curl -X POST https://app.getera.io/api/v1/notification_preferences/actions/set_preference \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"channel_type":"webhook","enabled":true}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.preference_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationPreferences.setPreference({
  channel_type: "webhook",
  enabled: true
})
era notification_preferences set_preference \
  --channel-type "webhook" \
  --enabled true
tools/call
{
  "name": "era__notifications__set_preference",
  "arguments": {
    "channel_type": "webhook",
    "enabled": true
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:read · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 not_your_preference, not_a_member, mute_in_past · 429 slow down

notifications.set_rule_active

Switch a rule on or off — A rule that is off matches nothing and queues nothing.

Needs notifications:manage · changes data

POSThttps://app.getera.io/api/v1/notification_rules/actions/set_rule_active
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.set_rule_active

Input

FieldTypeRequiredNotes
rule_iduuidyesRule
activebooleanyesActive

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
rule_not_foundNo such rule in this workspace.
no_changeThe rule is already in that state.

Events it publishes: notifications.rule_enabled, notifications.rule_disabled

What it writes: notification_rule (update) — Flips the active flag and clears the quiet period

curl -X POST https://app.getera.io/api/v1/notification_rules/actions/set_rule_active \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"rule_id":"RULE_ID","active":true}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.rule_enabled",
    "notifications.rule_disabled"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationRules.setRuleActive({
  rule_id: "RULE_ID",
  active: true
})
era notification_rules set_rule_active \
  --rule-id "RULE_ID" \
  --active true
tools/call
{
  "name": "era__notifications__set_rule_active",
  "arguments": {
    "rule_id": "RULE_ID",
    "active": true
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 rule_not_found, no_change · 429 slow down

notifications.set_user_settings

Set my notification schedule — Timezone, language, quiet hours and email digest for one person.

Needs notifications:read · changes data

POSThttps://app.getera.io/api/v1/notification_user_settings/actions/set_user_settings
API key or OAuth token · notifications:read
  • Canonical address: POST /api/v1/actions/notifications.set_user_settings

Input

FieldTypeRequiredNotes
user_iduuidPerson · Leave empty to change your own.
timezonestringTimezone · IANA name, e.g. Europe/Istanbul. Empty means the workspace’s. · max 64
localestringLanguage · max 16
quiet_startstringQuiet from · HH:MM. Empty for no quiet hours. · max 5
quiet_endstringQuiet until · max 5
digeststring (enum)Email digest · Allowed values: off, hourly, daily
digest_hournumberDaily digest at (hour) · min 0 · max 23

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
not_your_preferenceChanging someone else’s settings needs the manage capability.
not_a_memberThat person is not a member of this workspace.
invalid_timezoneThe timezone must be an IANA name like Europe/Istanbul.
invalid_quiet_hoursQuiet hours need both a start and an end, as HH:MM, and they must differ.

Events it publishes: notifications.settings_changed

What it writes: notification_user_setting (upsert) — Writes the person’s schedule

curl -X POST https://app.getera.io/api/v1/notification_user_settings/actions/set_user_settings \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"user_id":"USER_ID"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.settings_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationUserSettings.setUserSettings({
  user_id: "USER_ID"
})
era notification_user_settings set_user_settings \
  --user-id "USER_ID"
tools/call
{
  "name": "era__notifications__set_user_settings",
  "arguments": {
    "user_id": "USER_ID"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:read · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 not_your_preference, not_a_member, invalid_timezone, invalid_quiet_hours · 429 slow down

notifications.settle_delivery

Record a delivery outcome — Marks a delivery done, or schedules the next attempt.

Needs notifications:handle · changes data

POSThttps://app.getera.io/api/v1/notification_deliveries/actions/settle_delivery
API key or OAuth token · notifications:handle
  • Canonical address: POST /api/v1/actions/notifications.settle_delivery

Input

FieldTypeRequiredNotes
delivery_iduuidyesDelivery
successbooleanyesSucceeded
response_statusnumberResponse status · min 100 · max 599
error_messagestringError · max 2000
duration_msnumberDuration (ms) · min 0
response_bodystringProvider response · max 2000
permanentbooleanDo not retry · The sender knows retrying cannot help — no provider configured, unsupported channel.

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
delivery_not_foundNo such delivery in this workspace.
delivery_already_settledThat delivery has already finished.

Events it publishes: notifications.delivered, notifications.delivery_failed

What it writes: notification_delivery (update) — Records the outcome and, on a retryable failure, when to try again; notification_channel (update) — Stamps verified_at the first time something reaches the channel

curl -X POST https://app.getera.io/api/v1/notification_deliveries/actions/settle_delivery \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"delivery_id":"DELIVERY_ID","success":true}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.delivered",
    "notifications.delivery_failed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationDeliveries.settleDelivery({
  delivery_id: "DELIVERY_ID",
  success: true
})
era notification_deliveries settle_delivery \
  --delivery-id "DELIVERY_ID" \
  --success true
tools/call
{
  "name": "era__notifications__settle_delivery",
  "arguments": {
    "delivery_id": "DELIVERY_ID",
    "success": true
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:handle · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 delivery_not_found, delivery_already_settled · 429 slow down

notifications.update_rule

Edit a notification rule — Changes a rule’s events, recipients, wording or quiet period.

Needs notifications:manage · changes data

POSThttps://app.getera.io/api/v1/notification_rules/{id}/actions/update_rule
API key or OAuth token · notifications:manage
  • Canonical address: POST /api/v1/actions/notifications.update_rule

Input

FieldTypeRequiredNotes
rule_iduuidyesFilled from the path {id} · Rule · id of notification_rule
namestringName · max 120
channel_iduuidChannel · id of notification_channel
eventsstringEvents · max 2000
cooldown_minutesnumberQuiet period (minutes)
recipientstring (enum)Who is told · A channel, or people found in the event (owner, assignee, mentioned…) or chosen here. · Allowed values: channel, owner, assignee, mentioned, recipient, member, role, capability, customer
recipient_user_iduuidMember · For “a specific member”.
recipient_rolestringRole · For “everyone with a role”: the role key. · max 80
recipient_capabilitystringPermission · For “everyone holding a permission”: module:capability. · max 80
mediumsstringReach them by · Comma-separated: in_app, email, sms, whatsapp. · max 200
categorystringCategory · What a person switches on or off. Empty means the event’s module. · max 41
title_templatestringTitle · Variables: {{event_label}}, {{recipient.name}}, {{workspace.name}}, or any payload key like {{person}}. · max 300
body_templatestringMessage · max 4000
link_templatestringLink · A path in the app. Empty means the record the event is about. · max 500

Preconditions

The action is refused with 409 and one of these codes:

CodeRefused when
rule_not_foundNo such rule in this workspace.
channel_not_foundNo such channel in this workspace.
name_takenThis workspace already has a rule with that name.
cooldown_out_of_rangeThe quiet period must be between 0 minutes and 7 days.
recipient_incompleteThe rule must say fully who it tells.

Events it publishes: notifications.rule_updated

What it writes: notification_rule (update) — Rewrites the rule’s events, recipients and wording

curl -X POST https://app.getera.io/api/v1/notification_rules/NOTIFICATION_RULE_ID/actions/update_rule \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Name"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "notifications.rule_updated"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.notificationRules.updateRule("NOTIFICATION_RULE_ID", {
  name: "Name"
})
era notification_rules update_rule NOTIFICATION_RULE_ID \
  --name "Name"
tools/call
{
  "name": "era__notifications__update_rule",
  "arguments": {
    "rule_id": "NOTIFICATION_RULE_ID",
    "name": "Name"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold notifications:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 rule_not_found, channel_not_found, name_taken, cooldown_out_of_range, recipient_incomplete · 429 slow down

Data models

NotificationChannel

Table notification_channel · Resource notification_channels

  • GET /api/v1/notification_channels
  • GET /api/v1/notification_channels/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
typestring · notification_channel_typewebhook, email, slack, push, in_app
namestring · text
configobject · jsonb
activeboolean · bool
verified_atstring (date-time) · timestamptzyes
created_bystring (uuid) · uuidyesapp_user
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Primary key: id

Unique: workspace_id, type, name

NotificationDelivery

Table notification_delivery · Resource notification_deliveries

  • GET /api/v1/notification_deliveries
  • GET /api/v1/notification_deliveries/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
rule_idstring (uuid) · uuidyesnotification_rule
channel_idstring (uuid) · uuidyesnotification_channel
event_namestring · text
source_idstring · textyes
statestring · notification_delivery_statepending, in_progress, delivered, failed, suppressed
attemptsinteger · int4
last_attempt_atstring (date-time) · timestamptzyes
next_attempt_atstring (date-time) · timestamptzyes
response_statusinteger · int4yes
error_messagestring · textyes
suppressed_reasonstring · textyes
duration_msinteger · int4yes
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz
payloadobject · jsonb
response_bodystring · textyes
is_testboolean · bool
recipient_user_idstring (uuid) · uuidyesapp_user
mediumstring · textchannel, in_app, email, sms, whatsapp
digestboolean · bool

Primary key: id

Checks:

  • CHECK (((attempts >= 0) AND (attempts <= 10)))
  • CHECK (((medium <> 'channel'::text) OR (channel_id IS NOT NULL)))
  • CHECK (((rule_id IS NOT NULL) OR is_test OR (payload ? 'to'::text) OR (payload ? 'customerId'::text)))
  • CHECK (((response_status IS NULL) OR ((response_status >= 100) AND (response_status < 600))))
  • CHECK (((state = 'suppressed'::os.notification_delivery_state) = (suppressed_reason IS NOT NULL)))

NotificationEmailTemplate

Table notification_email_template · Resource notification_email_templates

  • GET /api/v1/notification_email_templates
  • GET /api/v1/notification_email_templates/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
kindstring · textorder_confirmed, fulfilment_created, tracking_updated, invoice, gift_card, quote, appointment_reminder
subjectstring · text
bodystring · text
updated_by_user_idstring (uuid) · uuidyesapp_user
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Primary key: id

Unique: workspace_id, kind

Checks:

  • CHECK (((length(body) >= 1) AND (length(body) <= 20000)))
  • CHECK (((length(subject) >= 1) AND (length(subject) <= 300)))

NotificationInbox

Table notification_inbox · Resource notification_inboxes

  • GET /api/v1/notification_inboxes
  • GET /api/v1/notification_inboxes/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
user_idstring (uuid) · uuidapp_user
delivery_idstring (uuid) · uuidyesnotification_delivery
rule_idstring (uuid) · uuidyesnotification_rule
event_namestring · text
categorystring · text
titlestring · text
bodystring · textyes
linkstring · textyes
read_atstring (date-time) · timestamptzyes
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Primary key: id

NotificationPreference

Table notification_preference · Resource notification_preferences

  • GET /api/v1/notification_preferences
  • GET /api/v1/notification_preferences/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
user_idstring (uuid) · uuidapp_user
channel_typestring · notification_channel_typewebhook, email, slack, push, in_app
event_namestring · text
enabledboolean · bool
muted_untilstring (date-time) · timestamptzyes
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Primary key: id

Unique: workspace_id, user_id, channel_type, event_name

NotificationRule

Table notification_rule · Resource notification_rules

  • GET /api/v1/notification_rules
  • GET /api/v1/notification_rules/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
channel_idstring (uuid) · uuidyesnotification_channel
namestring · text
eventsstring[] · text[]
conditionobject · jsonbyes
include_outputboolean · bool
include_traceboolean · bool
include_rate_limitsboolean · bool
include_usageboolean · bool
cooldown_minutesinteger · int4
last_fired_atstring (date-time) · timestamptzyes
activeboolean · bool
created_bystring (uuid) · uuidyesapp_user
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz
recipientstring · textchannel, owner, assignee, mentioned, recipient, member, role, capability, customer
recipient_user_idstring (uuid) · uuidyesapp_user
recipient_rolestring · textyes
recipient_capabilitystring · textyes
mediumsstring[] · text[]
categorystring · text
title_templatestring · textyes
body_templatestring · textyes
link_templatestring · textyes

Primary key: id

Unique: workspace_id, name

Checks:

  • CHECK (((category = ''::text) OR (category ~ '^[a-z][a-z0-9_]{1,40}$'::text)))
  • CHECK (((recipient = 'channel'::text) = (channel_id IS NOT NULL)))
  • CHECK (((cooldown_minutes >= 0) AND (cooldown_minutes <= 10080)))
  • CHECK ((mediums <@ ARRAY['in_app'::text, 'email'::text, 'sms'::text, 'whatsapp'::text]))

NotificationUserSetting

Table notification_user_setting · Resource notification_user_settings

  • GET /api/v1/notification_user_settings
  • GET /api/v1/notification_user_settings/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
user_idstring (uuid) · uuidapp_user
timezonestring · textyes
localestring · textyes
quiet_startstring (time) · timeyes
quiet_endstring (time) · timeyes
digeststring · text
digest_hourinteger · int4
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Primary key: id

Unique: workspace_id, user_id

Checks:

  • CHECK (((digest = ANY (ARRAY['off'::text, 'hourly'::text, 'daily'::text])) AND ((digest_hour >= 0) AND (digest_hour <= 23))))
  • CHECK (((quiet_start IS NULL) = (quiet_end IS NULL)))

Events

Workflows and webhooks react to these events.

EventWhat happensPayload
notifications.channel_createdA delivery channel was added.channel_id, type
notifications.channel_deletedA delivery channel was removed.channel_id
notifications.deliveredA notification reached its channel.delivery_id, response_status
notifications.delivery_failedA notification could not be delivered.delivery_id, error
notifications.delivery_retriedA failed notification was put back on the queue by hand.delivery_id
notifications.email_template_changedA customer email was reworded or restored to its default.kind, customised
notifications.history_purgedFinished deliveries were swept.days, removed
notifications.inbox_readSomeone marked notifications in their inbox as read.user_id, count
notifications.preference_changedSomeone changed what they want to be told about.user_id, channel_type, enabled
notifications.queuedA notification was queued for delivery.delivery_id, rule_id
notifications.rule_createdA notification rule was added.rule_id, channel_id
notifications.rule_deletedA notification rule was removed.rule_id
notifications.rule_disabledA notification rule was switched off.rule_id
notifications.rule_enabledA notification rule was switched on.rule_id
notifications.rule_updatedA notification rule’s events, recipients or wording changed.rule_id
notifications.settings_changedSomeone changed their timezone, quiet hours or digest.user_id
notifications.suppressedA notification was deliberately not sent.delivery_id, reason
notifications.test_queuedA test notification was queued for a channel.delivery_id, channel_id
Was this page helpful?