This document outlines the API endpoints and WebSocket events required by the Cooperation Page frontend. Currently, the frontend is configured to use mock data for development purposes, but it expects the following endpoints to be implemented on the backend.
- REST API:
https://api.punoted.net/groups(and/map,/materials) - WebSocket:
wss://api.punoted.net/groups/ww/{groupId}/{userId}?token={authToken}
- Endpoint:
GET /groups - Headers:
Authorization: Bearer {authToken} - Description: Retrieves all groups the user is a member of (both active and pending invitations).
- Response (200 OK):
FullGroupData[][ { "id": "group_123", "name": "My Production Group", "ownerId": "user_456", "members": [ { "uid": "user_456", "username": "OwnerUser", "displayName": "Owner", "role": "owner" } ], "updated_at": "2026-04-18T10:00:00Z", "isPending": false } ]
- Endpoint:
POST /groups - Headers:
Authorization: Bearer {authToken},Content-Type: application/json - Body:
Group(minimal group object){ "name": "New Group", "ownerId": "user_456" } - Response (200/201):
{ "group": Group }(The newly created group with generatedid)
- Endpoint:
POST /groups/{groupId}/save_chain - Headers:
Authorization: Bearer {authToken},Content-Type: application/json - Body:
{ "chain_data": Chain } - Response (200 OK):
{ "message": "Saved", "new_updated_at": "2026-04-18T10:05:00Z" }
- Endpoint:
DELETE /groups/{groupId} - Headers:
Authorization: Bearer {authToken},Content-Type: application/json - Body:
{ "user_id": "user_456" } - Response:
204 No Content
- Endpoint:
PUT /groups/{groupId}/members/{memberId}/role - Headers:
Authorization: Bearer {authToken},Content-Type: application/json - Body:
{ "new_role": "editor" | "viewer" } - Response:
200 OK
- Endpoint:
DELETE /groups/{groupId}/member - Headers:
Authorization: Bearer {authToken},Content-Type: application/json - Body:
{ "member_uid": "user_789" } - Response:
200 OK
- Endpoint:
POST /groups/{groupId}/invite - Headers:
Authorization: Bearer {authToken},Content-Type: application/json - Body:
{ "invitee_uid": "user_999", "role": "viewer" } - Response:
200 OK
- Endpoint:
POST /groups/{groupId}/invite/accept(or/reject) - Headers:
Authorization: Bearer {authToken} - Response:
200 OK
- Endpoint:
GET /groups/all_users - Headers:
Authorization: Bearer {authToken} - Response: Array of user objects
{ "uid": "...", "username": "...", "displayName": "..." }
- Endpoint:
GET /groups/{groupId}/live-node-data?planet_id={planetId}&material={ticker} - Headers:
Authorization: Bearer {authToken} - Response:
{ "userFlows": [...], "userStorage": [...] }
- Endpoint:
GET /map/planets/search?query={search_term} - Response: Array of
SearchResultPlanetobjects.
- Endpoint:
GET (or POST) /materials - Response:
{ "data": [ Material objects ] }
Connection URL: ww/{groupId}/{userId}?token={authToken}
All messages sent by the client follow this structure:
{
"type": "MESSAGE_TYPE",
"userId": "sender_uid",
"payload": { ... }
}Types sent by Client:
INITIAL_LOAD_REQUEST: Requests the initial chain state.NODE_MOVE: Broadcasts node movement (dragging).EDGE_UPDATE: Broadcasts new/removed connections.CURSOR_MOVE: Broadcasts mouse cursor position (x,y,userDisplayName).NODE_LOCKED/NODE_UNLOCK: Signals a user is editing a node.
Types expected by Client:
INITIAL_LOAD_REQUEST(Response):{ "type": "INITIAL_LOAD_REQUEST", "payload": { "chain": Chain } }FULL_CHAIN_STATE: Completely replaces the client's chain.CHAIN_UPDATE: Granular chain update.NODE_MOVE: Received from other users dragging a node.NODE_UPDATE/NODE_ADD/NODE_REMOVE: Granular node modifications.EDGE_UPDATE: Granular edge modifications.GROUP_MEMBER_UPDATE: Notification that members/roles changed.NODE_LOCKED/NODE_LOCK_DENIED/NODE_UNLOCK: Syncing edit locks.CURSOR_MOVE: Received from other users' mice.GROUP_INVITE: Notification of a new group invite.USER_LEAVE: Notification that another user disconnected.