Public/Remove-GCExternalContact.ps1

<#
.SYNOPSIS
    Deletes an external contact.

.DESCRIPTION
    Removes the specified external contact from Genesys Cloud.
    Uses the DELETE /api/v2/externalcontacts/contacts/{contactId} endpoint.

.PARAMETER ContactId
    The unique identifier of the external contact to delete.

.EXAMPLE
    Remove-GCExternalContact -ContactId 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'

.NOTES
    Genesys Cloud API: DELETE /api/v2/externalcontacts/contacts/{contactId}
#>

function Remove-GCExternalContact {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$ContactId
    )

    $endpoint = "externalcontacts/contacts/$ContactId"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method DELETE
}