Notifications
Document one-way JSON-RPC calls that don’t expect a response
Notifications in JSON-RPC are one-way method calls that don’t expect a response from the server. They’re useful for fire-and-forget operations like logging, analytics, or triggering background processes.
Basic notifications
Define a notification by omitting the result
property:
openrpc.yml
Logging notifications
Use notifications for logging and monitoring:
openrpc.yml
Real-time updates
Send real-time updates without expecting responses:
openrpc.yml
Background processing
Trigger background tasks without waiting for completion:
openrpc.yml
Cache invalidation
Notify about cache invalidation events:
openrpc.yml
Audit logging
Record audit events for compliance:
openrpc.yml
Notification best practices
- Use notifications for fire-and-forget operations where you don’t need to know if the operation succeeded
- Consider using regular methods with results for critical operations that need confirmation
- Include enough context in notification parameters for proper processing
- Use structured schemas even for notifications to maintain API consistency
- Consider implementing client-side queuing for notifications in unreliable network conditions
Notifications are perfect for decoupling systems and improving performance by not waiting for non-critical operations to complete.