what is this error: ```TwirpError(code=failed_prec...
# ask-ai
b
what is this error:
Copy code
TwirpError(code=failed_precondition, message=remote unmute not enabled, status=412
t
Thanks for reaching out, Jupiter. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing this because the server blocked a request to remotely unmute a participant's track — remote unmute is disabled for your project/room. What it means • The server returned a Twirp
failed_precondition
(HTTP 412) because remote unmute is not enabled. Remote unmute is disabled by default for privacy/security. How to enable remote unmute • LiveKit Cloud: turn on "Admins can remotely unmute tracks" in your project settings (Project settings). • Self‑hosted: set
room.enable_remote_unmute: true
in your server config YAML. Once enabled, use the
MutePublishedTrack
API with
muted: false
to remotely unmute the track. Would you like steps for where to find that setting in the Cloud UI or the exact YAML snippet for self‑hosted configs? Sources: Managing participants | LiveKit docs
b
we can remotely mute a participant's track without setting anything, but unmute needs to?
t
You're correct — muting and unmuting are handled differently. Why: • Remote mute is allowed by default so admins/operators can silence a participant (moderation). • Remote unmute requires explicit enabling because unmuting someone remotely affects their audio privacy and could start sending their microphone without their consent. What to do if you need remote unmute: • LiveKit Cloud: enable "Admins can remotely unmute tracks" in Project Settings. • Self‑hosted: set
room.enable_remote_unmute: true
in your server YAML. If you want, I can show the exact YAML snippet or point to the Cloud UI setting location.
b
yes
t
Great — below are concise steps for both LiveKit Cloud and self-hosted setups. LiveKit Cloud (UI) 1. Open your project in the LiveKit Cloud dashboard. 2. Go to Project Settings. 3. Find the "Admins can remotely unmute tracks" option and enable it. 4. Save changes. Self-hosted (YAML) Add or update the
room.enable_remote_unmute
setting in your server config YAML:
Copy code
room:
  enable_remote_unmute: true
After enabling, use the
MutePublishedTrack
API with
muted: false
to remotely unmute a participant. Would you like the exact place to click in the Cloud UI (I can describe it step‑by‑step) or an example API request for
MutePublishedTrack
?
b
this mute and unmute rule applies to all remote and local participants, or just remote?
t
You're asking whether mute/unmute rules apply to all participants or just remote ones — they apply to all participants' published tracks. • Admins (roomAdmin) can remotely mute any participant (local or remote). • Remote unmute is disabled by default for privacy; enabling it (Cloud: "Admins can remotely unmute tracks" in Project Settings; self‑hosted:
room.enable_remote_unmute: true
) allows admins to remotely unmute any participant. • Participants can always mute/unmute their own tracks locally regardless of admin settings. Would you like the exact YAML snippet again or an example
MutePublishedTrack
request? Sources: Managing participants | LiveKit docs | Camera & microphone | LiveKit docs
b
who is this admin you say, is it the agent code, I unmute like this:
Copy code
async with LiveKitAPI() as lkapi:
                            await lkapi.room.mute_published_track(
                                MuteRoomTrackRequest(
                                    room=self.room_name,
                                    identity=participant.identity,
                                    track_sid=publication.sid,
                                    muted=False,
                                )
                            )
t
Good question — yes, “admin” means the caller has the RoomAdmin privilege, not a special built‑in user. What that means for your code • Your snippet is calling the server API correctly, but the API call will succeed only if the request is authenticated with a token/API key that has the RoomAdmin grant. • Remote unmute must also be enabled for the project/room (Cloud setting or
room.enable_remote_unmute: true
for self‑hosted). Next steps I can help with • Show how to create a RoomAdmin token (or confirm the token your agent is using has the RoomAdmin grant). • Verify the project/room remote unmute setting. Which would you like me to show?
b
yes
t
You're asking for how to act as the "admin" that can remotely unmute — here are concise, actionable steps and example code. What "admin" means • Admin = a caller authenticated with a token (or API key) that includes the RoomAdmin grant for the target room. Only requests made with RoomAdmin privileges can call
MutePublishedTrack
to unmute others (and remote unmute must be enabled in settings). How to create a RoomAdmin token (concept) 1. Create a server-signed grant that includes
roomAdmin: true
for the target room or for all rooms. 2. Return that token to the agent/service that will call the LiveKit server API. Example (Python) — issuing a RoomAdmin token using the server SDK (pseudo/code sketch; adapt to your key storage and environment):
Copy code
from livekit_server_sdk import Keypair, AccessToken, Grants

api_key = "YOUR_API_KEY"        # server API key
api_secret = "YOUR_API_SECRET"  # server API secret

# create grants with roomAdmin
grants = Grants(room_admin=True, room="room_name")  # or room=None for all rooms
token = AccessToken(api_key, api_secret, identity="admin-agent", grants=grants).to_jwt()
print(token)
Use that token when calling the server API (your existing code) • Ensure the LiveKitAPI client is authenticated with the RoomAdmin token (for the server-side Twirp/gRPC client). • Your snippet is correct for calling the API; just confirm the client is using the RoomAdmin token:
Copy code
async with LiveKitAPI(token=room_admin_token) as lkapi:
    await lkapi.room.mute_published_track(
        MuteRoomTrackRequest(
            room=self.room_name,
            identity=participant.identity,
            track_sid=publication.sid,
            muted=False,
        )
    )
Remember to enable remote unmute • LiveKit Cloud: enable "Admins can remotely unmute tracks" in Project Settings. • Self-hosted: set
room.enable_remote_unmute: true
in your server YAML. If you want, I can: • Show the exact parameter names for your language SDK (confirm which SDK/version you're using), or • Verify whether your current token has RoomAdmin by inspecting it (paste a redacted token or tell me your SDK language). Which would you prefer?