Repository files navigation POST /loginRequest Params: NoneRequest Body: {
"username" : " string" ,
"password" : " string"
} Response: 200 OK (login success) or 201 Created (register success){
"access_token" : " jwt_token"
} GET /usersRequest Params: NoneHeaders: Authorization: Bearer <token>Response: [
{
"id" : 1 ,
"username" : " string"
}
] POST /roomsRequest Params: NoneHeaders: Authorization: Bearer <token>Request Body: {
"name" : " string" ,
"description" : " string"
} Response: {
"id" : 1 ,
"name" : " string" ,
"description" : " string" ,
"OwnerId" : 1 ,
"roomType" : " group-chat" ,
...
} Get All Rooms (joined by user) GET /roomsRequest Params: NoneHeaders: Authorization: Bearer <token>Response: [
{
"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/:RoomIdRequest Params: RoomId (path param, integer): Room IDHeaders: Authorization: Bearer <token>Response: [
{
"id" : 1 ,
"UserId" : 2 ,
"RoomId" : 1 ,
"text" : " Hello!" ,
"createdAt" : " 2025-07-02T08:00:00.000Z" ,
"updatedAt" : " 2025-07-02T08:00:00.000Z"
}
] POST /chats/:RoomIdRequest Params: RoomId (path param, integer): Room IDHeaders: Authorization: Bearer <token>Request Body: {
"text" : " string" ,
"ChatId" : 1 // optional, for reply/threads
} Response: {
"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-chatsRequest Params: RoomId (path param, integer): Room IDHeaders: Authorization: Bearer <token>Request Body: Response: {
"id" : 1 ,
"UserId" : 1 ,
"RoomId" : 1 ,
"text" : " AI response" ,
...
} POST /rooms/:RoomId/summariesRequest Params: RoomId (path param, integer): Room IDHeaders: Authorization: Bearer <token>Response: {
"id" : 1 ,
"UserId" : 1 ,
"RoomId" : 1 ,
"text" : " Summary text" ,
...
} POST /rooms/privateRequest Params: NoneHeaders: Authorization: Bearer <token>Request Body: {
"targetUserId" : 2 ,
"message" : " string"
} Response: {
"message" : " Private chat created successfully" ,
"room" : {
"id" : 1 ,
"name" : " private-chat-UserA-and-UserB" ,
"roomType" : " private-chat" ,
"OwnerId" : 1 ,
...
}
} POST /rooms/:RoomId/invitationsRequest Params: RoomId (path param, integer): Room IDHeaders: Authorization: Bearer <token>Request Body: Response: {
"message" : " User <username> has been invited to room <room name>"
} All errors will return a JSON response with a message field describing the error. All endpoints (except /login) require JWT authentication via the Authorization header. Replace <token> with your JWT access token. Replace path params (e.g., :RoomId) with actual values.
You can’t perform that action at this time.