- POST
/login - Request Params: None
- Request Body:
{ "username": "string", "password": "string" } - Response:
200 OK(login success) or201 Created(register success)
{ "access_token": "jwt_token" }
- GET
/users - Request Params: None
- Headers:
Authorization: Bearer <token> - Response:
200 OK
[ { "id": 1, "username": "string" } ]
- POST
/rooms - Request Params: None
- Headers:
Authorization: Bearer <token> - Request Body:
{ "name": "string", "description": "string" } - Response:
201 Created
{ "id": 1, "name": "string", "description": "string", "OwnerId": 1, "roomType": "group-chat", ... }
- GET
/rooms - Request Params: None
- Headers:
Authorization: Bearer <token> - Response:
200 OK
[ { "UserId": 2, "RoomId": 1, "createdAt": "2025-07-01T23:31:07.874Z", "updatedAt": "2025-07-01T23:31:07.874Z", "Room": { "id": 1, "name": "General Chat", "description": "Tempat ngobrol santai semua member.", "OwnerId": 2, "roomType": "group-chat", "createdAt": "2025-07-02T00:00:00.000Z", "updatedAt": "2025-07-02T00:00:00.000Z", "Owner": { "id": 2, "username": "Andi" } } } ]
- GET
/chats/:RoomId - Request Params:
RoomId(path param, integer): Room ID
- Headers:
Authorization: Bearer <token> - Response:
200 OK
[ { "id": 1, "UserId": 2, "RoomId": 1, "text": "Hello!", "createdAt": "2025-07-02T08:00:00.000Z", "updatedAt": "2025-07-02T08:00:00.000Z" } ]
- POST
/chats/:RoomId - Request Params:
RoomId(path param, integer): Room ID
- Headers:
Authorization: Bearer <token> - Request Body:
{ "text": "string", "ChatId": 1 // optional, for reply/threads } - Response:
200 OK
{ "id": 1, "UserId": 2, "RoomId": 1, "text": "string", "createdAt": "2025-07-02T08:00:00.000Z", "updatedAt": "2025-07-02T08:00:00.000Z" }
- POST
/rooms/:RoomId/ai-chats - Request Params:
RoomId(path param, integer): Room ID
- Headers:
Authorization: Bearer <token> - Request Body:
{ "message": "string" } - Response:
201 Created
{ "id": 1, "UserId": 1, "RoomId": 1, "text": "AI response", ... }
- POST
/rooms/:RoomId/summaries - Request Params:
RoomId(path param, integer): Room ID
- Headers:
Authorization: Bearer <token> - Response:
201 Created
{ "id": 1, "UserId": 1, "RoomId": 1, "text": "Summary text", ... }
- POST
/rooms/private - Request Params: None
- Headers:
Authorization: Bearer <token> - Request Body:
{ "targetUserId": 2, "message": "string" } - Response:
201 Created
{ "message": "Private chat created successfully", "room": { "id": 1, "name": "private-chat-UserA-and-UserB", "roomType": "private-chat", "OwnerId": 1, ... } }
- POST
/rooms/:RoomId/invitations - Request Params:
RoomId(path param, integer): Room ID
- Headers:
Authorization: Bearer <token> - Request Body:
{ "UserId": 2 } - Response:
201 Created
{ "message": "User <username> has been invited to room <room name>" }
- All errors will return a JSON response with a
messagefield describing the error.
- All endpoints (except
/login) require JWT authentication via theAuthorizationheader. - Replace
<token>with your JWT access token. - Replace path params (e.g.,
:RoomId) with actual values.