Public/Set-GCExternalContact.ps1

<#
.SYNOPSIS
    Updates an existing external contact.

.DESCRIPTION
    Updates the specified external contact in Genesys Cloud.
    Uses the PUT /api/v2/externalcontacts/contacts/{contactId} endpoint.

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

.PARAMETER Body
    The updated external contact definition object.

.EXAMPLE
    $contactBody = @{ firstName = 'Jane'; lastName = 'Doe' }
    Set-GCExternalContact -ContactId 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' -Body $contactBody

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

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

        [Parameter(Mandatory = $true)]
        [object]$Body
    )

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