chore: migrate rooms.saveNotification endpoint to new API format w…

Merged
RO
7mo ago
+45-24

Proposed changes

This PR refactors the rooms.saveNotification endpoint to use the new API.v1.post format, replacing the deprecated addRoute method. AJV schema validation has been added for both the request body and response, improving input validation and aligning with Rocket.Chat API development guidelines.

Details of Changes

  • Migrated rooms.saveNotification to the new API format.
  • Added AJV schema validation for request body (roomId, notifications) and response (success).
  • Improved input validation and response structure.
  • Removed deprecated addRoute usage for this endpoint.

Testing

  • Verified the endpoint with existing end-to-end tests in apps/meteor/tests/end-to-end/api/rooms.ts.
  • All tests pass and the endpoint behaves as expected.
  • Manual testing:
    • Send a POST request to /api/v1/rooms.saveNotification with a valid roomId and notifications object.
    • Confirm a 200 response with { success: true }.
Screenshot 2026-02-22 160623

Impact

  • Aligns with the deprecation of addRoute.
  • Ensures automatic OpenAPI specification generation.
  • Maintains backward compatibility for clients using this endpoint.

Further Comments

This refactor improves maintainability and clarity of the API codebase. No breaking changes are introduced. All dependent tests and documentation have been reviewed.

Checklist

  • I have read the Contributing Guide.
  • I have signed the CLA.
  • Lint and unit tests pass locally.
  • I have added tests that prove my fix is effective.
  • I have added necessary documentation.
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • Breaking Changes

    • The public rooms.saveNotification API endpoint has been removed. Integrations using it must be updated to the new API surface.
  • Chore

    • Server-side handling for saving per-room notification settings was reorganized; notification settings continue to be persisted as before.

Task: ARCH-2020
[COMM-144]