Disconnecting specific participant from conference via C# SDK returns 400

Looking for advice on how to properly disconnect a specific participant from an active conference call using the Genesys Cloud .NET SDK. I am building a C# integration to manage call flows, and I need to remove a participant without ending the entire conference. The documentation states: “DELETE /api/v2/conversations/conferences/{conferenceId}/participants/{participantId} removes the specified participant from the conference.”

However, when I execute this using the ConferenceApi.DeleteConversationsConferenceParticipant method, I receive a 400 Bad Request with the message “Participant not found”. I am using the participantId returned from the initial GetConversationsConference response, which looks like a short alphanumeric string. Is this the correct identifier, or do I need to map it to an internal user ID first? Here is the code snippet I am using:

var response = await conferenceApi.DeleteConversationsConferenceParticipantAsync(conferenceId, participantId, new DeleteConversationsConferenceParticipantOptions());

The participantId seems valid as it appears in the participant list payload, yet the deletion fails. Any ideas on what format the endpoint expects?

This issue stems from the SDK not handling the participantId correctly within the conference context, or more likely, a scope mismatch in your OAuth token. The endpoint DELETE /api/v2/conversations/conferences/{conferenceId}/participants/{participantId} requires the conversation:write scope, but many developers configure their app with only conversation:read for monitoring. If you have the correct scope, the issue is often that the participantId you are passing is not the internal Genesys Cloud participant ID, but rather a custom ID or the user ID.

In C#, ensure you are using the ConferenceApi instance from PureCloudPlatformClientV2. Here is the correct pattern:

using GenesysCloud.Platform.Client;
using GenesysCloud.Platform.Client.Model;
using GenesysCloud.Platform.Client.Api;

// Assuming 'client' is your initialized PureCloudPlatformClientV2 instance
var conferenceApi = new ConferenceApi(client);

// 1. Fetch the conference to get the correct participant IDs
var conference = await conferenceApi.PostConversationsConferencesGet(conversationId, null, null);

// 2. Identify the participant you want to remove
var participantToRemove = conference.Participants.FirstOrDefault(p => p.Name == "Target User Name");

if (participantToRemove != null)
{
 // 3. Use the internal Participant ID, not the User ID
 await conferenceApi.DeleteConversationsConferencesConferenceIdParticipantsParticipantId(
 conferenceId: conference.Id,
 participantId: participantToRemove.Id
 );
}

Warning: Do not use the userId field from the participant object. The API strictly requires the id field which is unique to that specific conference instance. Using the user ID will result in a 400 Bad Request.

If you are still seeing 400s, check the response body. Genesys Cloud often returns specific error messages like Participant not found or Invalid participant ID. Also, ensure your client has the conversation:write scope. Without it, the API will reject the deletion attempt even if the syntax is perfect. I use this pattern in my Django analytics pipeline to clean up stale conference records, and it works reliably.

If you check the docs, they mention that the participantId must correspond to the unique identifier generated by the platform when the participant joins, not the original conversation participant ID. In my experience tracing these calls via OpenTelemetry, I often see the 400 error stem from using the wrong ID type. You need to ensure you are querying the conference participants list first to get the correct participantId for the specific leg you want to remove.

To verify the correct ID and structure, you can use this curl command to list participants in an active conference. Replace {conferenceId} with your actual conference ID. This helps confirm that the ID you are passing to the delete endpoint is valid and exists within the current conference context.

curl -X GET "https://api.mypurecloud.com/api/v2/conversations/conferences/{conferenceId}/participants" \
 -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Once you have the correct participantId from the response, use it in your C# SDK call. The .NET SDK method DeleteConversationsConferenceParticipant requires both the conference ID and the participant ID. Ensure your OAuth token has the conversation:write scope, as mentioned by the previous poster. If you still get a 400, check the response body for a invalid_request error, which usually indicates the participant has already left or the conference is ending.

var conferenceApi = new PlatformClient.ConferenceApi();
try {
 await conferenceApi.DeleteConversationsConferenceParticipant(conferenceId, participantId);
 Console.WriteLine("Participant disconnected successfully.");
} catch (PlatformClient.ClientException e) {
 Console.WriteLine($"Error: {e.Error.Message}");
}