Bildirimler API
Bildirimler modülünün tüm işlemleri (20) ve veri modelleri (7): adresler, izinler, girdiler, ön koşullar, olaylar ve örnekler.
Kimin neden haberdar edileceği — e-posta, SMS, WhatsApp veya uygulama içi.
Modül kodu notifications · 20 işlem · 7 veri modeli · 18 olay. Bir anahtar ya da token, arkasındaki kişinin bu modülde yapabildiğinden fazlasını asla yapamaz; satır düzeyindeki güvenlik uygulamadakiyle birebir aynıdır. Yetki kapsamları: notifications (hepsi), notifications:read (yalnız okuma) ya da notifications:<yetenek>.
Kaynaklar
| Kaynak | Tablo | Listeleme ve okuma | POST | PATCH | DELETE |
|---|---|---|---|---|---|
notification_channels | notification_channel | /api/v1/notification_channels | |||
notification_deliveries | notification_delivery | /api/v1/notification_deliveries | |||
notification_email_templates | notification_email_template | /api/v1/notification_email_templates | |||
notification_inboxes | notification_inbox | /api/v1/notification_inboxes | |||
notification_preferences | notification_preference | /api/v1/notification_preferences | |||
notification_rules | notification_rule | /api/v1/notification_rules | |||
notification_user_settings | notification_user_setting | /api/v1/notification_user_settings |
Listeler limit (en çok 200), cursor, order (ör. -created_at), fields ve q alır; diğer her sorgu parametresi bir sütun süzgecidir: ?status=paid, ?total[gte]=100, ?id[in]=a,b, ?x=null.
İşlemler
| İşlem | Gereken izin | Ne yapar |
|---|---|---|
notifications.create_channel | notifications:manage | Teslimat kanalı ekle |
notifications.create_rule | notifications:manage | Bildirim kuralı ekle |
notifications.delete_channel | notifications:delete | Teslimat kanalını kaldır |
notifications.delete_rule | notifications:delete | Bildirim kuralını kaldır |
notifications.mark_read | notifications:read | Bildirimleri okundu işaretle |
notifications.purge_history | notifications:delete | Teslimat geçmişini temizle |
notifications.queue_delivery | notifications:handle | Bildirimi sıraya koy |
notifications.record_site_email | notifications:handle | Site e-postasını kaydet |
notifications.reset_email_template | notifications:manage | Varsayılan metni geri yükle |
notifications.retry_delivery | notifications:manage | Bildirimi yeniden dene |
notifications.save_email_template | notifications:manage | Müşteri e-postasını kaydet |
notifications.send_customer_message | notifications:handle | Müşteriye mesaj gönder |
notifications.send_email | notifications:handle | E-posta gönder |
notifications.send_test | notifications:manage | Test bildirimi gönder |
notifications.send_test_email_template | notifications:manage | Test e-postası gönder |
notifications.set_preference | notifications:read | Bildirim tercihini ayarla |
notifications.set_rule_active | notifications:manage | Kuralı aç veya kapat |
notifications.set_user_settings | notifications:read | Bildirim programımı ayarla |
notifications.settle_delivery | notifications:handle | Teslimat sonucunu kaydet |
notifications.update_rule | notifications:manage | Bildirim kuralını düzenle |
notifications.create_channel
Teslimat kanalı ekle — Bildirimlerin gittiği yer: bir webhook, bir adres listesi, bir Slack kanalı veya bir push uç noktası.
Gereken izin notifications:manage · veriyi değiştirir
https://app.getera.io/api/v1/notification_channels/actions/create_channel- Asıl adres:
POST /api/v1/actions/notifications.create_channel
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
type | string (enum) | evet | Kanal · İzin verilen değerler: webhook, email, slack, push |
name | string | evet | Ad · en çok 120 |
url | string | URL · Webhook ve anlık bildirim kanalları. · en çok 2000 | |
recipients | string | Alıcılar · E-posta kanalları. Virgülle ayrılmış. · en çok 2000 | |
config | string | Yapılandırma · JSON. Slack kanalları hesabı ve kanal kimliğini burada taşır. · en çok 8000 | |
credential_id | uuid | Kimlik bilgisi · İmzalama gizli anahtarını ya da OAuth anahtarını tutar. Hiçbir zaman kanalın kendisinde saklanmaz. |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
invalid_url | Bu bir web adresine benzemiyor. |
insecure_url | Adres https kullanmalı. |
url_required | Webhook veya push kanalı bir URL gerektirir. |
recipients_required | E-posta kanalı en az bir adres gerektirir. |
too_many_recipients | E-posta kanalı en fazla on adres taşıyabilir. |
invalid_config | Yapılandırma bir JSON nesnesi olmalı. |
name_taken | Bu çalışma alanında bu türde ve bu adda bir kanal zaten var. |
Yayımladığı olaylar: notifications.channel_created
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__create_channel",
"arguments": {
"type": "webhook",
"name": "Name"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 invalid_url, insecure_url, url_required, recipients_required, too_many_recipients, invalid_config, name_taken · 429 çok sık istek
notifications.create_rule
Bildirim kuralı ekle — Hangi olayların hangi kanala veya kişiye, hangi sözlerle ve ne sıklıkta ulaşacağı.
Gereken izin notifications:manage · veriyi değiştirir
https://app.getera.io/api/v1/notification_rules/actions/create_rule- Asıl adres:
POST /api/v1/actions/notifications.create_rule
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
channel_id | uuid | Kanal · Bir kanal kuralı için. · kimliği: notification_channel | |
name | string | evet | Ad · en çok 120 |
events | string | Etkinlikler · Virgülle ayrılmış. Her olay için boş bırakın. · en çok 2000 | |
condition | string | Koşul · JSON. Eşleşen her olayda tetiklenmesi için boş bırakın. · en çok 4000 | |
cooldown_minutes | number | Sessiz süre (dakika) | |
include_output | boolean | Sonucu ekle | |
include_trace | boolean | İzlemeyi ekle · Yalnızca webhook kanalları — izleme e-posta ve Slack için fazla büyük. | |
recipient | string (enum) | Kime haber verilsin · Bir kanal ya da olayda geçen kişiler (sahip, atanan, bahsedilen…) veya burada seçilenler. · İzin verilen değerler: channel, owner, assignee, mentioned, recipient, member, role, capability, customer | |
recipient_user_id | uuid | Üye · “Belirli bir üye” için. | |
recipient_role | string | Rol · “Bir role sahip herkes” için: rol anahtarı. · en çok 80 | |
recipient_capability | string | İzin · “Bir izne sahip herkes” için: module:capability. · en çok 80 | |
mediums | string | Ulaşma yolu · Virgülle ayrılmış: in_app, email, sms, whatsapp. · en çok 200 | |
category | string | Kategori · Kişinin açıp kapattığı şey. Boş, olayın modülü demektir. · en çok 41 | |
title_template | string | Başlık · Değişkenler: {{event_label}}, {{recipient.name}}, {{workspace.name}} ya da {{person}} gibi herhangi bir veri anahtarı. · en çok 300 | |
body_template | string | Mesaj · en çok 4000 | |
link_template | string | Bağlantı · Uygulama içinde bir yol. Boş, olayın ilgili olduğu kayıt demektir. · en çok 500 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
channel_not_found | Bu çalışma alanında böyle bir kanal yok. |
trace_needs_webhook | Yalnızca webhook kanalı iz taşıyabilir. |
invalid_condition | Koşul bir JSON nesnesi olmalı. |
cooldown_out_of_range | Bekleme süresi 0 dakika ile 7 gün arasında olmalı. |
name_taken | Bu çalışma alanında bu adda bir kural zaten var. |
rule_limit_reached | Bu çalışma alanı bu kanaldaki kural sınırına ulaştı. |
recipient_incomplete | Kural kime haber verdiğini tam olarak belirtmeli: bir kanal ya da kişiler ve onlara nasıl ulaşılacağı. |
Yayımladığı olaylar: notifications.rule_created
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__create_rule",
"arguments": {
"name": "Name"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 channel_not_found, trace_needs_webhook, invalid_condition, cooldown_out_of_range, name_taken, rule_limit_reached, recipient_incomplete · 429 çok sık istek
notifications.delete_channel
Teslimat kanalını kaldır — Bir kural hâlâ ona bağlıyken reddedilir; hiçbir kural sessizce sahipsiz kalmaz.
Gereken izin notifications:delete · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/notification_channels/actions/delete_channel- Asıl adres:
POST /api/v1/actions/notifications.delete_channel
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
channel_id | uuid | evet | Kanal |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
channel_not_found | Bu çalışma alanında böyle bir kanal yok. |
channel_in_use | Bir kural hâlâ bu kanala gönderiyor. |
Yayımladığı olaylar: notifications.channel_deleted
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__delete_channel",
"arguments": {
"channel_id": "CHANNEL_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:delete izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 channel_not_found, channel_in_use · 429 çok sık istek
notifications.delete_rule
Bildirim kuralını kaldır — Kuralı ve teslimat geçmişini kaldırır. Kanal kalır.
Gereken izin notifications:delete · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/notification_rules/actions/delete_rule- Asıl adres:
POST /api/v1/actions/notifications.delete_rule
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
rule_id | uuid | evet | Kural |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
rule_not_found | Bu çalışma alanında böyle bir kural yok. |
Yayımladığı olaylar: notifications.rule_deleted
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__delete_rule",
"arguments": {
"rule_id": "RULE_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:delete izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 rule_not_found · 429 çok sık istek
notifications.mark_read
Bildirimleri okundu işaretle — Uygulama içi bildirimlerinizin bir kısmını veya tamamını okundu işaretler (ya da birini yeniden okunmadı yapar).
Gereken izin notifications:read · veriyi değiştirir
https://app.getera.io/api/v1/notification_inboxes/actions/mark_read- Asıl adres:
POST /api/v1/actions/notifications.mark_read
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
ids | string | Bildirimler · Virgülle ayrılmış kimlikler. · en çok 8000 | |
all | boolean | Hepsi | |
unread | boolean | Bunun yerine okunmamış olarak işaretle |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
notification_not_found | Bu bildirimlerin hiçbiri sizin değil. |
Yayımladığı olaylar: notifications.inbox_read
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__mark_read",
"arguments": {
"ids": "Notifications"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 notification_not_found · 429 çok sık istek
notifications.purge_history
Teslimat geçmişini temizle — Saklama süresinden eski tamamlanmış teslimatları kaldırır. Bekleyenlere asla dokunulmaz.
Gereken izin notifications:delete · siler ya da geri alınamaz
https://app.getera.io/api/v1/notification_deliveries/actions/purge_history- Asıl adres:
POST /api/v1/actions/notifications.purge_history
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
days | number | Saklama süresi (gün) · en çok 3650 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
retention_too_short | Saklama süresi en az bir gün olmalı. |
Yayımladığı olaylar: notifications.history_purged
Neye yazar: 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}'{
"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{
"name": "era__notifications__purge_history",
"arguments": {
"days": 1
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:delete izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 retention_too_short · 429 çok sık istek
notifications.queue_delivery
Bildirimi sıraya koy — Teslimatı yazar ya da neden bilerek gönderilmediğini yazar.
Gereken izin notifications:handle · veriyi değiştirir
https://app.getera.io/api/v1/notification_deliveries/actions/queue_delivery- Asıl adres:
POST /api/v1/actions/notifications.queue_delivery
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
rule_id | uuid | evet | Kural |
event_name | string | evet | Etkinlik · en çok 120 |
source_id | string | Kaynak · Bunun kaynağı olan olay ya da çalıştırma. · en çok 200 | |
recipient_user_id | uuid | Alıcı · Bildirim tek bir kişiye yönelikse, tercihine uyulabilsin diye. | |
payload | string | Yük · JSON. Mesajın yazıldığı olay verisi. · en çok 100000 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
rule_not_found | Bu çalışma alanında böyle bir kural yok. |
event_not_matched | Bu kural bu olayı kapsamıyor. |
Yayımladığı olaylar: notifications.queued, notifications.suppressed
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__queue_delivery",
"arguments": {
"rule_id": "RULE_ID",
"event_name": "Event"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:handle izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 rule_not_found, event_not_matched · 429 çok sık istek
notifications.record_site_email
Site e-postasını kaydet — Web sitesinin müşteriye hemen gönderdiği e-posta, gönderim kaydına yazılır.
Gereken izin notifications:handle · veriyi değiştirir
403 machine_only).https://app.getera.io/api/v1/notification_deliveries/actions/record_site_email- Asıl adres:
POST /api/v1/actions/notifications.record_site_email
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
to | string | evet | Bitiş · en çok 320 |
subject | string | evet | Konu · en çok 300 |
text | string | Mesaj · en çok 20000 | |
html | string | HTML bölümü · en çok 300000 | |
event_name | string | evet | Etkinlik · en çok 120 |
source_id | string | Kaynak · en çok 200 | |
delivered | boolean | evet | Teslim edildi |
error | string | Hata · en çok 2000 | |
redacted | boolean | İçerik saklanmadı |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
invalid_recipient | Adres geçerli bir e-posta adresi olmalı. |
Neye yazar: notification_delivery (insert) — Writes the delivered (or failed) email row
Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:handle izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 invalid_recipient · 429 çok sık istek
notifications.reset_email_template
Varsayılan metni geri yükle — Bu çalışma alanının müşteri e-postası metnini bırakır; varsayılan yeniden geçerli olur.
Gereken izin notifications:manage · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/notification_email_templates/actions/reset_email_template- Asıl adres:
POST /api/v1/actions/notifications.reset_email_template
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
kind | string | evet | E-posta · en çok 40 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
unknown_email_template | E-posta, müşteri e-postalarından biri olmalı. |
Yayımladığı olaylar: notifications.email_template_changed
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__reset_email_template",
"arguments": {
"kind": "Email"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 unknown_email_template · 429 çok sık istek
notifications.retry_delivery
Bildirimi yeniden dene — Başarısız bir teslimatı, deneme sayısı sıfırlanmış olarak hemen gönderilmek üzere sıraya geri koyar.
Gereken izin notifications:manage · veriyi değiştirir
https://app.getera.io/api/v1/notification_deliveries/actions/retry_delivery- Asıl adres:
POST /api/v1/actions/notifications.retry_delivery
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
delivery_id | uuid | evet | Teslimat |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
delivery_not_found | Bu çalışma alanında böyle bir teslimat yok. |
delivery_not_failed | Yalnızca başarısız bir teslimat yeniden denenebilir. |
Yayımladığı olaylar: notifications.delivery_retried
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__retry_delivery",
"arguments": {
"delivery_id": "DELIVERY_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 delivery_not_found, delivery_not_failed · 429 çok sık istek
notifications.save_email_template
Müşteri e-postasını kaydet — Bu çalışma alanı için bir müşteri e-postasının metnini değiştirir.
Gereken izin notifications:manage · veriyi değiştirir
https://app.getera.io/api/v1/notification_email_templates/actions/save_email_template- Asıl adres:
POST /api/v1/actions/notifications.save_email_template
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
kind | string | evet | E-posta · en çok 40 |
subject | string | evet | Konu · en çok 300 |
body | string | evet | Gövde · en çok 20000 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
unknown_email_template | E-posta, müşteri e-postalarından biri olmalı. |
Yayımladığı olaylar: notifications.email_template_changed
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__save_email_template",
"arguments": {
"kind": "Email",
"subject": "Subject",
"body": "Body"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 unknown_email_template · 429 çok sık istek
notifications.send_customer_message
Müşteriye mesaj gönder — Bir müşteriye tek bir mesaj sıraya koyar — bağlı gelen kutusundan WhatsApp ya da SMS, markalı e-posta, ya da üçünün en uygunu.
Gereken izin notifications:handle · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır)
https://app.getera.io/api/v1/notification_deliveries/actions/send_customer_message- Asıl adres:
POST /api/v1/actions/notifications.send_customer_message
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
customer_id | uuid | evet | Müşteri |
medium | string (enum) | evet | Yapan · İzin verilen değerler: sms, whatsapp, email, auto |
text | string | evet | Mesaj · en çok 1600 |
subject | string | Konu · en çok 300 | |
event_name | string | evet | Etkinlik · en çok 120 |
source_id | string | Kaynak · en çok 200 |
Yayımladığı olaylar: notifications.queued
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__send_customer_message",
"arguments": {
"customer_id": "CUSTOMER_ID",
"medium": "sms",
"text": "Message",
"event_name": "Event"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:handle izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 429 çok sık istek
notifications.send_email
E-posta gönder — Bir e-posta kanalı ve gerçek gönderici üzerinden tek bir adrese tek bir mesaj sıraya koyar.
Gereken izin notifications:handle · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır)
https://app.getera.io/api/v1/notification_deliveries/actions/send_email- Asıl adres:
POST /api/v1/actions/notifications.send_email
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
to | string | evet | Bitiş · en çok 320 |
subject | string | evet | Konu · en çok 300 |
text | string | evet | Mesaj · en çok 20000 |
html | string | HTML bölümü · en çok 300000 | |
event_name | string | evet | Etkinlik · en çok 120 |
source_id | string | Kaynak · en çok 200 | |
channel_id | uuid | Kanal · kimliği: notification_channel | |
from_connection | string | Gönderen · mine = adına çalışılan kişinin kendi Gmail/Outlook hesabı · workspace = şirketin hesabı · ya da bir bağlantı kimliği. Boş = platformun gönderici adresi. · en çok 64 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
invalid_recipient | Adres bir e-posta adresi değil. |
no_email_channel | Gönderim yapılacak aktif bir e-posta kanalı yok. |
bad_connection | Gönderen “mine”, “workspace” ya da bir bağlantı kimliği olmalı. |
Yayımladığı olaylar: notifications.queued
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__send_email",
"arguments": {
"to": "To",
"subject": "Subject",
"text": "Message",
"event_name": "Event"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:handle izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 invalid_recipient, no_email_channel, bad_connection · 429 çok sık istek
notifications.send_test
Test bildirimi gönder — Gerçek gönderici üzerinden kanala tek bir mesaj sıraya koyar ve sonucu kaydeder.
Gereken izin notifications:manage · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır)
https://app.getera.io/api/v1/notification_deliveries/actions/send_test- Asıl adres:
POST /api/v1/actions/notifications.send_test
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
channel_id | uuid | evet | Kanal · kimliği: notification_channel |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
channel_not_found | Bu çalışma alanında böyle bir kanal yok. |
Yayımladığı olaylar: notifications.test_queued
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__send_test",
"arguments": {
"channel_id": "NOTIFICATION_CHANNEL_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 channel_not_found · 429 çok sık istek
notifications.send_test_email_template
Test e-postası gönder — Örnek değerlerle doldurulmuş bir müşteri e-postasını seçtiğiniz adrese gönderir.
Gereken izin notifications:manage · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır)
https://app.getera.io/api/v1/notification_deliveries/actions/send_test_email_template- Asıl adres:
POST /api/v1/actions/notifications.send_test_email_template
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
kind | string | evet | E-posta · en çok 40 |
to | string | evet | Gönderilecek adres · en çok 320 |
subject | string | Konu · en çok 300 | |
body | string | Gövde · en çok 20000 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
unknown_email_template | E-posta, müşteri e-postalarından biri olmalı. |
invalid_recipient | Adres bir e-posta adresi değil. |
no_email_channel | Gönderim yapılacak aktif bir e-posta kanalı yok. |
Yayımladığı olaylar: notifications.test_queued
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__send_test_email_template",
"arguments": {
"kind": "Email",
"to": "Send to"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 unknown_email_template, invalid_recipient, no_email_channel · 429 çok sık istek
notifications.set_preference
Bildirim tercihini ayarla — Birinin haberdar edilip edilmeyeceği, hangi kanal türünden ve ne zamana kadar sessize alındığı.
Gereken izin notifications:read · veriyi değiştirir
https://app.getera.io/api/v1/notification_preferences/actions/set_preference- Asıl adres:
POST /api/v1/actions/notifications.set_preference
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
user_id | uuid | Kişi · Kendinizinkini değiştirmek için boş bırakın. | |
channel_type | string (enum) | evet | Kanal · İzin verilen değerler: webhook, email, slack, push, in_app |
event_name | string | Olay ya da kategori · O kanal türündeki her olayı kapsaması için boş bırakın; nokta içermeyen bir anahtar bir kategoridir. · en çok 120 | |
enabled | boolean | evet | Bana haber ver |
muted_until | date-time | Sessize alma bitişi · Bir erteleme. Kendiliğinden kalkar. |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_your_preference | Başkasının tercihlerini değiştirmek yönetim yetkisi gerektirir. |
not_a_member | Bu kişi bu çalışma alanının üyesi değil. |
mute_in_past | Sessize alma süresi zaten geçmiş. |
Yayımladığı olaylar: notifications.preference_changed
Neye yazar: 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}'{
"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{
"name": "era__notifications__set_preference",
"arguments": {
"channel_type": "webhook",
"enabled": true
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_your_preference, not_a_member, mute_in_past · 429 çok sık istek
notifications.set_rule_active
Kuralı aç veya kapat — Kapalı bir kural hiçbir şeyle eşleşmez ve hiçbir şey sıraya koymaz.
Gereken izin notifications:manage · veriyi değiştirir
https://app.getera.io/api/v1/notification_rules/actions/set_rule_active- Asıl adres:
POST /api/v1/actions/notifications.set_rule_active
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
rule_id | uuid | evet | Kural |
active | boolean | evet | Aktif |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
rule_not_found | Bu çalışma alanında böyle bir kural yok. |
no_change | Kural zaten bu durumda. |
Yayımladığı olaylar: notifications.rule_enabled, notifications.rule_disabled
Neye yazar: 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}'{
"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{
"name": "era__notifications__set_rule_active",
"arguments": {
"rule_id": "RULE_ID",
"active": true
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 rule_not_found, no_change · 429 çok sık istek
notifications.set_user_settings
Bildirim programımı ayarla — Bir kişi için saat dilimi, dil, sessiz saatler ve e-posta özeti.
Gereken izin notifications:read · veriyi değiştirir
https://app.getera.io/api/v1/notification_user_settings/actions/set_user_settings- Asıl adres:
POST /api/v1/actions/notifications.set_user_settings
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
user_id | uuid | Kişi · Kendinizinkini değiştirmek için boş bırakın. | |
timezone | string | Saat dilimi · IANA adı, ör. Europe/Istanbul. Boş, çalışma alanınınki demektir. · en çok 64 | |
locale | string | Dil · en çok 16 | |
quiet_start | string | Sessiz saat başlangıcı · SS:DD. Sessiz saat istemiyorsanız boş bırakın. · en çok 5 | |
quiet_end | string | Sessiz saat bitişi · en çok 5 | |
digest | string (enum) | E-posta özeti · İzin verilen değerler: off, hourly, daily | |
digest_hour | number | Günlük özet saati · en az 0 · en çok 23 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_your_preference | Başkasının ayarlarını değiştirmek yönetim yetkisi gerektirir. |
not_a_member | Bu kişi bu çalışma alanının üyesi değil. |
invalid_timezone | Saat dilimi Europe/Istanbul gibi bir IANA adı olmalı. |
invalid_quiet_hours | Sessiz saatler SS:DD biçiminde bir başlangıç ve bitiş gerektirir ve ikisi farklı olmalı. |
Yayımladığı olaylar: notifications.settings_changed
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__set_user_settings",
"arguments": {
"user_id": "USER_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_your_preference, not_a_member, invalid_timezone, invalid_quiet_hours · 429 çok sık istek
notifications.settle_delivery
Teslimat sonucunu kaydet — Teslimatı tamamlandı işaretler ya da sonraki denemeyi planlar.
Gereken izin notifications:handle · veriyi değiştirir
https://app.getera.io/api/v1/notification_deliveries/actions/settle_delivery- Asıl adres:
POST /api/v1/actions/notifications.settle_delivery
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
delivery_id | uuid | evet | Teslimat |
success | boolean | evet | Başarılı |
response_status | number | Yanıt durumu · en az 100 · en çok 599 | |
error_message | string | Hata · en çok 2000 | |
duration_ms | number | Süre (ms) · en az 0 | |
response_body | string | Sağlayıcı yanıtı · en çok 2000 | |
permanent | boolean | Yeniden denenmesin · Gönderen, yeniden denemenin işe yaramayacağını biliyor — sağlayıcı ayarlanmamış, kanal desteklenmiyor. |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
delivery_not_found | Bu çalışma alanında böyle bir teslimat yok. |
delivery_already_settled | Bu teslimat zaten bitmiş. |
Yayımladığı olaylar: notifications.delivered, notifications.delivery_failed
Neye yazar: 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}'{
"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{
"name": "era__notifications__settle_delivery",
"arguments": {
"delivery_id": "DELIVERY_ID",
"success": true
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:handle izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 delivery_not_found, delivery_already_settled · 429 çok sık istek
notifications.update_rule
Bildirim kuralını düzenle — Kuralın olaylarını, alıcılarını, metnini veya bekleme süresini değiştirir.
Gereken izin notifications:manage · veriyi değiştirir
https://app.getera.io/api/v1/notification_rules/{id}/actions/update_rule- Asıl adres:
POST /api/v1/actions/notifications.update_rule
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
rule_id | uuid | evet | Doldurulduğu yer: adresteki {id} · Kural · kimliği: notification_rule |
name | string | Ad · en çok 120 | |
channel_id | uuid | Kanal · kimliği: notification_channel | |
events | string | Etkinlikler · en çok 2000 | |
cooldown_minutes | number | Sessiz süre (dakika) | |
recipient | string (enum) | Kime haber verilsin · Bir kanal ya da olayda geçen kişiler (sahip, atanan, bahsedilen…) veya burada seçilenler. · İzin verilen değerler: channel, owner, assignee, mentioned, recipient, member, role, capability, customer | |
recipient_user_id | uuid | Üye · “Belirli bir üye” için. | |
recipient_role | string | Rol · “Bir role sahip herkes” için: rol anahtarı. · en çok 80 | |
recipient_capability | string | İzin · “Bir izne sahip herkes” için: module:capability. · en çok 80 | |
mediums | string | Ulaşma yolu · Virgülle ayrılmış: in_app, email, sms, whatsapp. · en çok 200 | |
category | string | Kategori · Kişinin açıp kapattığı şey. Boş, olayın modülü demektir. · en çok 41 | |
title_template | string | Başlık · Değişkenler: {{event_label}}, {{recipient.name}}, {{workspace.name}} ya da {{person}} gibi herhangi bir veri anahtarı. · en çok 300 | |
body_template | string | Mesaj · en çok 4000 | |
link_template | string | Bağlantı · Uygulama içinde bir yol. Boş, olayın ilgili olduğu kayıt demektir. · en çok 500 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
rule_not_found | Bu çalışma alanında böyle bir kural yok. |
channel_not_found | Bu çalışma alanında böyle bir kanal yok. |
name_taken | Bu çalışma alanında bu adda bir kural zaten var. |
cooldown_out_of_range | Bekleme süresi 0 dakika ile 7 gün arasında olmalı. |
recipient_incomplete | Kural kime haber verdiğini tam olarak belirtmeli. |
Yayımladığı olaylar: notifications.rule_updated
Neye yazar: 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"}'{
"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"{
"name": "era__notifications__update_rule",
"arguments": {
"rule_id": "NOTIFICATION_RULE_ID",
"name": "Name"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde notifications:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 rule_not_found, channel_not_found, name_taken, cooldown_out_of_range, recipient_incomplete · 429 çok sık istek
Veri modelleri
NotificationChannel
Tablo notification_channel · Kaynak notification_channels
GET /api/v1/notification_channelsGET /api/v1/notification_channels/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
type | string · notification_channel_type | webhook, email, slack, push, in_app | ||
name | string · text | |||
config | object · jsonb | |||
active | boolean · bool | |||
verified_at | string (date-time) · timestamptz | evet | ||
created_by | string (uuid) · uuid | evet | app_user | |
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: workspace_id, type, name
NotificationDelivery
Tablo notification_delivery · Kaynak notification_deliveries
GET /api/v1/notification_deliveriesGET /api/v1/notification_deliveries/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
rule_id | string (uuid) · uuid | evet | notification_rule | |
channel_id | string (uuid) · uuid | evet | notification_channel | |
event_name | string · text | |||
source_id | string · text | evet | ||
state | string · notification_delivery_state | pending, in_progress, delivered, failed, suppressed | ||
attempts | integer · int4 | |||
last_attempt_at | string (date-time) · timestamptz | evet | ||
next_attempt_at | string (date-time) · timestamptz | evet | ||
response_status | integer · int4 | evet | ||
error_message | string · text | evet | ||
suppressed_reason | string · text | evet | ||
duration_ms | integer · int4 | evet | ||
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz | |||
payload | object · jsonb | |||
response_body | string · text | evet | ||
is_test | boolean · bool | |||
recipient_user_id | string (uuid) · uuid | evet | app_user | |
medium | string · text | channel, in_app, email, sms, whatsapp | ||
digest | boolean · bool |
Birincil anahtar: id
Denetimler:
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
Tablo notification_email_template · Kaynak notification_email_templates
GET /api/v1/notification_email_templatesGET /api/v1/notification_email_templates/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
kind | string · text | order_confirmed, fulfilment_created, tracking_updated, invoice, gift_card, quote, appointment_reminder | ||
subject | string · text | |||
body | string · text | |||
updated_by_user_id | string (uuid) · uuid | evet | app_user | |
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: workspace_id, kind
Denetimler:
CHECK (((length(body) >= 1) AND (length(body) <= 20000)))CHECK (((length(subject) >= 1) AND (length(subject) <= 300)))
NotificationInbox
Tablo notification_inbox · Kaynak notification_inboxes
GET /api/v1/notification_inboxesGET /api/v1/notification_inboxes/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
user_id | string (uuid) · uuid | app_user | ||
delivery_id | string (uuid) · uuid | evet | notification_delivery | |
rule_id | string (uuid) · uuid | evet | notification_rule | |
event_name | string · text | |||
category | string · text | |||
title | string · text | |||
body | string · text | evet | ||
link | string · text | evet | ||
read_at | string (date-time) · timestamptz | evet | ||
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
NotificationPreference
Tablo notification_preference · Kaynak notification_preferences
GET /api/v1/notification_preferencesGET /api/v1/notification_preferences/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
user_id | string (uuid) · uuid | app_user | ||
channel_type | string · notification_channel_type | webhook, email, slack, push, in_app | ||
event_name | string · text | |||
enabled | boolean · bool | |||
muted_until | string (date-time) · timestamptz | evet | ||
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: workspace_id, user_id, channel_type, event_name
NotificationRule
Tablo notification_rule · Kaynak notification_rules
GET /api/v1/notification_rulesGET /api/v1/notification_rules/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
channel_id | string (uuid) · uuid | evet | notification_channel | |
name | string · text | |||
events | string[] · text[] | |||
condition | object · jsonb | evet | ||
include_output | boolean · bool | |||
include_trace | boolean · bool | |||
include_rate_limits | boolean · bool | |||
include_usage | boolean · bool | |||
cooldown_minutes | integer · int4 | |||
last_fired_at | string (date-time) · timestamptz | evet | ||
active | boolean · bool | |||
created_by | string (uuid) · uuid | evet | app_user | |
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz | |||
recipient | string · text | channel, owner, assignee, mentioned, recipient, member, role, capability, customer | ||
recipient_user_id | string (uuid) · uuid | evet | app_user | |
recipient_role | string · text | evet | ||
recipient_capability | string · text | evet | ||
mediums | string[] · text[] | |||
category | string · text | |||
title_template | string · text | evet | ||
body_template | string · text | evet | ||
link_template | string · text | evet |
Birincil anahtar: id
Tekil: workspace_id, name
Denetimler:
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
Tablo notification_user_setting · Kaynak notification_user_settings
GET /api/v1/notification_user_settingsGET /api/v1/notification_user_settings/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
user_id | string (uuid) · uuid | app_user | ||
timezone | string · text | evet | ||
locale | string · text | evet | ||
quiet_start | string (time) · time | evet | ||
quiet_end | string (time) · time | evet | ||
digest | string · text | |||
digest_hour | integer · int4 | |||
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: workspace_id, user_id
Denetimler:
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)))
Olaylar
İş akışları ve webhook'lar bu olaylara tepki verir.
| Olay | Ne olur | Taşıdığı alanlar |
|---|---|---|
notifications.channel_created | Bir teslim kanalı eklendi. | channel_id, type |
notifications.channel_deleted | Bir teslim kanalı kaldırıldı. | channel_id |
notifications.delivered | Bir bildirim kanalına ulaştı. | delivery_id, response_status |
notifications.delivery_failed | Bir bildirim teslim edilemedi. | delivery_id, error |
notifications.delivery_retried | Başarısız bir bildirim elle kuyruğa geri kondu. | delivery_id |
notifications.email_template_changed | Bir müşteri e-postası yeniden yazıldı ya da varsayılanına döndürüldü. | kind, customised |
notifications.history_purged | Tamamlanan teslimler temizlendi. | days, removed |
notifications.inbox_read | Biri gelen kutusundaki bildirimleri okundu olarak işaretledi. | user_id, count |
notifications.preference_changed | Biri neyden haberdar edilmek istediğini değiştirdi. | user_id, channel_type, enabled |
notifications.queued | Bir bildirim teslim için sıraya alındı. | delivery_id, rule_id |
notifications.rule_created | Bir bildirim kuralı eklendi. | rule_id, channel_id |
notifications.rule_deleted | Bir bildirim kuralı kaldırıldı. | rule_id |
notifications.rule_disabled | Bir bildirim kuralı kapatıldı. | rule_id |
notifications.rule_enabled | Bir bildirim kuralı açıldı. | rule_id |
notifications.rule_updated | Bir bildirim kuralının olayları, alıcıları ya da metni değişti. | rule_id |
notifications.settings_changed | Biri saat dilimini, sessiz saatlerini ya da özetini değiştirdi. | user_id |
notifications.suppressed | Bir bildirim kasıtlı olarak gönderilmedi. | delivery_id, reason |
notifications.test_queued | Bir kanal için test bildirimi sıraya alındı. | delivery_id, channel_id |