Friends
Friend-request lifecycle — send, accept, reject, block, unblock; list accepted + pending.
Friendships are a single row with requester_id + addressee_id. Blocking preserves the row but switches status; unblocking deletes it.
Source: apps/api/src/routes/client/friends.ts.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /client/friends/request | Send a friend request. |
| POST | /client/friends/:friendshipId/accept | Accept a pending request (only the addressee can). |
| POST | /client/friends/:friendshipId/reject | Delete a pending request (only the addressee can). |
| POST | /client/friends/:friendshipId/block | Block — either participant can. |
| POST | /client/friends/:friendshipId/unblock | Delete a blocked row. |
| GET | /client/friends | Accepted friendships with user detail. |
| GET | /client/friends/pending | Pending requests addressed to the caller. |
POST /client/friends/request
Request (SendFriendRequestInput)
| Field | Type | Required |
|---|---|---|
addressee_id | uuid | yes |
Response 201
Errors
400 INVALID_REQUEST— can't friend yourself.403 BLOCKED— existing row isblocked.409 ALREADY_EXISTS— a friendship already exists in either direction.500 CREATE_FAILED.
Try it:
POST
client auth/client/friends/requestcurl -X POST 'https://api.amba.dev/client/friends/request'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
POST /client/friends/:friendshipId/accept
Only succeeds if the caller is addressee_id and status is pending.
Errors
404 ACCEPT_FAILED— no pending request matched.500 ACCEPT_FAILED.
Try it:
POST
client auth/client/friends/%7B%7BfriendshipId%7D%7D/acceptcurl -X POST 'https://api.amba.dev/client/friends/%7B%7BfriendshipId%7D%7D/accept'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
POST /client/friends/:friendshipId/reject
Same eligibility as accept. Deletes the row.
Response 200
Try it:
POST
client auth/client/friends/%7B%7BfriendshipId%7D%7D/rejectcurl -X POST 'https://api.amba.dev/client/friends/%7B%7BfriendshipId%7D%7D/reject'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
POST /client/friends/:friendshipId/block
Either participant can block.
Errors
404 BLOCK_FAILED.
Try it:
POST
client auth/client/friends/%7B%7BfriendshipId%7D%7D/blockcurl -X POST 'https://api.amba.dev/client/friends/%7B%7BfriendshipId%7D%7D/block'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
POST /client/friends/:friendshipId/unblock
Deletes a blocked row owned by either participant.
Response 200
Try it:
POST
client auth/client/friends/%7B%7BfriendshipId%7D%7D/unblockcurl -X POST 'https://api.amba.dev/client/friends/%7B%7BfriendshipId%7D%7D/unblock'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /client/friends
Accepted friendships in either direction, with both user records attached.
Response 200
Try it:
GET
client auth/client/friendscurl -X GET 'https://api.amba.dev/client/friends'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /client/friends/pending
Pending requests where the caller is the addressee.
Response 200
Try it:
GET
client auth/client/friends/pendingcurl -X GET 'https://api.amba.dev/client/friends/pending'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl: