Public/Invoke-GCConversationDisconnect.ps1

<#
.SYNOPSIS
    Disconnects a conversation.

.DESCRIPTION
    Performs a system disconnect on the specified conversation in Genesys Cloud.
    Calls POST /api/v2/conversations/{conversationId}/disconnect.

.PARAMETER ConversationId
    The unique identifier of the conversation to disconnect.

.EXAMPLE
    Invoke-GCConversationDisconnect -ConversationId 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

.NOTES
    Genesys Cloud API: POST /api/v2/conversations/{conversationId}/disconnect
#>

function Invoke-GCConversationDisconnect {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$ConversationId
    )

    $endpoint = "conversations/$ConversationId/disconnect"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method POST
}