Unblock a user
Chat
Unblock a user
Remove the caller’s directed block on a user. Does NOT remove blocks the other party may have created.
DELETE
Unblock a user
Overview
Removes the directed blockcallerUserId → :userId. Because block is directed, calling unblock only removes the row the caller created. If the other user has also blocked the caller, that other block remains and areBlockedEither still returns true — so the chat surface stays sealed from the caller’s perspective.
The endpoint is idempotent: calling unblock when no block exists is a no-op and returns unblocked: false. The status code is still 200 — the resource is in the desired state.
Authentication
Bearer <accessToken> required. requireOnboarded middleware applied.
Path parameters
| Name | Type | Required | Notes | Example |
|---|---|---|---|---|
userId | string | yes | 24-char hex ObjectId of the user to unblock. | 66400a8f1c2b4d5e6f7a8b01 |
Query parameters
None.Request body
None.Response — 200 OK
| Field | Type | Notes | Example |
|---|---|---|---|
unblocked | boolean | true if a row was removed by this call. false if there was no block to remove (idempotent no-op). | true |
Example response (block removed)
Example response (no-op — no block existed)
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | :userId is missing from the path. (Mongoose ObjectId validation is forgiving here — non-hex values return unblocked: false rather than 400.) |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 403 | ONBOARDING_INCOMPLETE | Caller has not finished onboarding. |
Side effects
- If a
blocksrow existed for(caller, :userId), it is deleted. - Future contact between the two users is permitted only if there is no remaining block in either direction.
Unblocking does NOT automatically re-open a previously-closed conversation. If the conversation was created before either block, it still exists and
status is unchanged; the gates simply stop firing.See also
- Block user — the inverse.
- Match → Conversation handshake.