Getting started
base_urlIf set, environment variableMESHAGENT_API_URLis used. Defaulthttps://api.meshagent.com.tokenIf set, environment variableMESHAGENT_API_KEYis used. The user session token can also be used. The session token can be retrieved from ~/.meshagent/session.json which is set when using the meshagent cli to login.
meshagent.api.RoomException on non-2xx responses and validates responses with Pydantic models, so malformed payloads surface as rich errors.
Managing project room grants
Project room grants store a user’s allowedApiScope for a specific room. They are persisted as ProjectRoomGrant { room, user_id, permissions } records and later copied into the runtime ParticipantToken.
Key methods:
| Method | Description |
|---|---|
create_room_grant(project_id, room_id, user_id, permissions) | Creates a grant (POST /accounts/projects/{project_id}/room-grants). Accepts an ApiScope instance for permissions. |
update_room_grant(project_id, room_id, user_id, permissions) | Replaces the stored ApiScope for an existing grant (PUT /room-grants). |
get_room_grant(project_id, room_id, user_id) | Returns the persisted ProjectRoomGrant (GET /room-grants/{room_id}/{user_id}). |
list_room_grants(project_id, limit?, offset?, order_by?) | Lists every grant in a project with pagination support. |
list_room_grants_by_user(project_id, user_id, ...) | Lists the rooms a specific user can access. |
list_room_grants_by_room(project_id, room_id, ...) | Lists the users that have access to a room. |
list_unique_rooms_with_grants(project_id, ...) | Returns ProjectRoomGrantCount objects summarising how many grants exist per room. |
list_unique_users_with_grants(project_id, ...) | Returns ProjectUserGrantCount objects summarising grant counts per user. |
scope into the api grant of the token it mints (cloud_router_server.connect_room).
Other administration helpers
The client also exposes utilities for day-to-day project administration:- Room lifecycle: create, rename, delete rooms; fetch room metadata.
- Project membership: add/remove users, check roles, and list members.
- Storage helpers: upload and download files under
/accounts/projects/{project_id}/storage/*. - OAuth clients: create, update, list, and delete OAuth client records for project integrations.
What’s next?
- Explore the Room API overview to work with live collaborative rooms.
- Review the
ApiScopereference for details on permission shape. - Learn how room connections inherit grants in participant tokens.