Relay docs

suiss Relay · Docs

Identifiers, events and enums

Draft reference for Relay's planned ID format and prefixes, event naming, event catalog entries, headers and shared enumerations.

This is a draft reference. Prefixes, names and values may change before release.

ID format

External IDs are a type prefix plus 26 lowercase Crockford base32 characters encoding a UUIDv7:

ntf_01jb8x2k4m6n8p0q2r4s6t8v1b
  • Time-ordered, case-insensitive and URL-safe.
  • The prefix identifies the type and is checked when the ID is resolved.
  • IDs are opaque; do not parse them.
  • Record time comes from the database clock.
PrefixObject
ten_Tenant
stn_Sub-tenant
sub_Subscriber (human recipient)
agt_Agent recipient
rcp_Recipient, without saying which kind
evt_Event (intake)
ntf_Notification
dlv_Delivery
att_Delivery attempt
dle_Delivery ledger event
oev_Outbound event
wfl_Workflow
tpl_Template
wp_Waitpoint
wpr_Waitpoint reply
mbx_Mailbox
mbr_Mailbox record
dlq_Dead-letter record
fan_Fan-out or batch

Workflows are addressed in the API by their readable key (slug), such as order-shipped, not by ID.

Event naming

  • Every event name has the form noun.verb_past and lives in one catalog. One concept never has two names; for example, cancelled is the only spelling.
  • The catalog is written as AsyncAPI 3.1 with JSON Schema 2020-12. Each event type's schema is versioned, and a schema change opens a new version of that type.
  • The same catalog feeds the webhook portal, SDKs and webhook verifiers.
  • A tenant's own event types for the webhook channel use the same catalog structure, scoped to the tenant.

Events mentioned in these docs

EventMeaning
notification.suppressedA notification or delivery was not sent; carries reason and rule_id
notification.render_failedRendering failed; carries failure_reason
device.reassignedA device token moved to another subscriber
device.unregisteredA device token was disabled after a permanent failure
address.disabledAn address was disabled after a permanent failure
waitpoint.createdA waitpoint was opened
waitpoint.escalatedAn escalation tier ran
waitpoint.resolvedA valid reply was recorded
waitpoint.expiredThe deadline passed
waitpoint.cancelledThe waitpoint was cancelled
waitpoint.stalledThe waiter's heartbeat stopped
waitpoint.response_rejectedA reply was rejected
agent.ceiling_exceededAn agent exceeded its send cap
mailbox.record_dead_letteredA mailbox record exceeded its redelivery count
mailbox.abuse_reportedA recipient reported a message as abuse
webhook.attempt_exhaustedA webhook message used up its retry schedule
webhook_endpoint.disabledA webhook endpoint was disabled
webhook_endpoint.recoveredA webhook endpoint recovered
inbox.item_createdReal-time: a new inbox item
inbox.item_updatedReal-time: an inbox item changed
inbox.items_bulk_updatedReal-time: a bulk inbox operation
inbox.counters_changedReal-time: new counters
stream.resync_requiredReal-time: the client must resync

The definitive list is the published event catalog.

Headers

HeaderDirectionMeaning
Authorization: BearerRequestAccess token or subscriber token
Idempotency-KeyRequestRequired on every mutating request
Idempotency-ReplayedResponsetrue when the response is a replay
Request-IdResponseOn every response
Relay-VersionRequestDated API version, YYYY-MM-DD
Relay-BetaRequestTurns on a beta feature
Relay-Batch-Max-EventsResponseBatch row limit
Relay-Batch-Max-Recipients-Per-EventResponseRecipients per event limit
RateLimit, RateLimit-PolicyResponseRate limit state and policy
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-ResetResponseRate limit state, for compatibility
Retry-AfterResponseDelta seconds
Deprecation, Sunset, Link rel="deprecation"ResponseVersion retirement notices
webhook-id, webhook-timestamp, webhook-signatureOutbound webhookSignature profile
webhook-delivery: abort-messageConsumer responseStop retrying this message

Shared enumerations

NameValues
Environmentlive, test
Regiontr, eu, us
Tenant stateactive, suspended, closed
Message classsecurity, action_required, transactional, operational, social, marketing, system
Security subtypeotp_oob, email_verification
Sender typehuman, system, agent
Prioritylow, normal, high
Channelpush, email, sms, whatsapp, voice, in_app, webhook, plus chat app channels
Delivery statusqueued, sent, delivered, unknown_pending, unknown, failed, skipped, expired, cancelled
Delivery certaintynone, accepted, delivered
Attempt statepending, in_flight, succeeded, failed, unknown
Failure classtransient, permanent_target, permanent_content, policy, quota, auth, sender_config, unknown
Engagementseen, read, clicked, archived
Click classhuman, likely_bot
Ledger event actorrelay, provider_api, provider_webhook, client_sdk, user
Decisionsend, skip, defer, digest, expire, cancel
Preference valueopt_in, opt_out, unset
Consent statenone, granted, revoked
Consent typeexplicit_opt_in, soft_opt_in, legitimate_interest, none
Recipient legal typeindividual, merchant
Device OS permissiongranted, denied, provisional, not_determined
Send modelive, shadow, dry_run, off
Timingimmediate, next_break
On expire (security)drop, inbox_only
Workflow managerpanel, code
Interaction kindnotify, question, review
Waitpoint stateopen, stalled, resolved, expired, cancelled
Evidence levelchannel_claim, relay_session, access_aas_ref
Trust labelauthenticated, unauthenticated, spam, blocked
Mailbox record stateavailable, leased, acked, dead_lettered, held
Webhook terminal statedelivered, failed_permanent, exhausted, expired, window_exceeded, dead_lettered, cancelled
Webhook signature schemev1a (Ed25519), v1 (HMAC-SHA256)
Inbox item stateseen, read, archived, hidden, snoozed