Visit Later
N/a
General Notes
- Conditionally deletes the associated conversation if
conversationIdis set on the widget - Repositions remaining widgets in the canvas to fill the gap (decrements
positionby 1 for all sibling widgets withposition > deletedWidget.position) - All DB operations (widget deletion, conversation deletion, repositioning) are wrapped in a MongoDB transaction for atomicity
- SUPER_ADMIN can delete any widget (bypasses userId ownership check); regular users can only delete their own widgets
Flow
Test cases
Method & URL
DELETE v1/widgets/:widgetId
Request
Headers
authorization
- Required
- Type : <string>
- Bearer session token
Query
Body
Path parameter
widgetId
- Required
- Type : <string>
- MongoDB ObjectId (24 hex characters)
Response
2xx
success
- Type : true (boolean)
- This indicates that request was executed successfully
message
- Type : <string> | null
- null on success
data
- Type : <object>
- Empty object
400
success
- Type : false (boolean)
message
- Type : <string>
- "Something went wrong. We're on it." (invalid widgetId format)
404
success
- Type : false (boolean)
message
- Type : <string>
- Widget not found