Soft deletion marks a resource as deleted without immediately removing its stored data. The resource disappears from ordinary views but can be restored or permanently removed later, providing protection against mistaken destructive requests. section 25.0 section 25.1
Implement soft deletion by making the deleted state explicit and adapting the resource methods around it:
- Store deletion status in a deleted Boolean field or a deleted value within an existing state enumeration. section 25.2
- Change DELETE to mark the resource as deleted rather than remove it, and make ordinary LIST requests exclude deleted resources by default. section 25.3 section 25.3.2
- Let GET return a known soft-deleted resource, while allowing LIST callers to request deleted resources explicitly, such as with includeDeleted. section 25.3.2
- Add undelete to restore a resource and expunge to remove it permanently; define errors for invalid repetition and decide how expiration is handled. section 25.3.3 section 25.3.9
- Preserve the existing referential-integrity rules instead of weakening deletion restrictions merely because the underlying data remains present. section 25.3.6
Chat-room API
A ChatRoom resource can expose deleted and expireTime fields. DELETE /chatRooms/{id} marks the room deleted and returns it; GET /chatRooms/{id} can still retrieve it; ordinary LIST omits it unless includeDeleted is true. POST /chatRooms/{id}:undelete restores it, while POST /chatRooms/{id}:expunge permanently removes it. section 25.3.2 section 25.3.9
Treat soft deletion as a trade-off: it reduces damage from mistakes but delays permanent removal and consumes storage. Regulated data may require immediate deletion or may prohibit expunging, so retention, privacy, and security requirements determine whether the pattern fits. Adding it to an existing API can also change method semantics enough to require a major version. section 25.3.8 section 25.4
Use the resource life cycle to distinguish active, soft-deleted, restored, expired, and expunged states. section 25.2

