Mute the mic using rest api patch request

I am trying to mute/unmute the mic using the patch request using the Zoom Rest API, but getting the error that the API end point is not recongnized.

here is the code:

    static async Task MuteMic(string accessToken, string meetingId, string userId)
    {
        string muteUrl = $"https://api.zoom.us/v2/meetings/{meetingId}/participants/{userId}/audio";

        var muteData = new
        {
            action = "mute"  
        };

        var jsonData = JsonConvert.SerializeObject(muteData);
        var content = new StringContent(jsonData, Encoding.UTF8, "application/json");

        var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);

        try
        {
           
            var response = await client.PatchAsync(muteUrl, content);

           
            var responseString = await response.Content.ReadAsStringAsync();
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine("Host microphone muted successfully.");
            }
            else
            {
                Console.WriteLine($"Failed to mute the microphone. Response: {responseString}");
                Console.WriteLine($"Error Code: {response.StatusCode}");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error occurred while muting the mic: " + ex.Message);
        }
    }

i have the correct client id and secret, i am able to start the meeting correctly, get the user id and meeting id, but when i call this function i get error code 2300 and that the api end is not recognized

Hi @workzoom59
Thanks for reaching out to us and welcome to the Zoom Developer Forum.
The error you are getting is expected, we do not have that endpoint available, that’s why you are getting that error

how can I achieve this functionality that I can programmatically mute my mic in a meeting that i am a participant or host both?

Hi @workzoom59
We do not have an endpoint to programmatically mute your mic in a meeting.