Public/New-GCRecordingAnnotation.ps1

<#
.SYNOPSIS
    Creates a new annotation on a recording in Genesys Cloud.

.DESCRIPTION
    Posts a new annotation to the Genesys Cloud API for a specific recording
    within a conversation.
    API Endpoint: POST /api/v2/conversations/{conversationId}/recordings/{recordingId}/annotations

.PARAMETER ConversationId
    The unique identifier of the conversation.

.PARAMETER RecordingId
    The unique identifier of the recording to annotate.

.PARAMETER Body
    The request body containing the annotation details such as name, description,
    position, and duration. Should conform to the Genesys Cloud annotation schema.

.EXAMPLE
    $annotationBody = @{
        name = 'Customer Complaint'
        description = 'Customer expressed dissatisfaction with service'
        position = 30000
        duration = 15000
    }
    New-GCRecordingAnnotation -ConversationId 'conv-abc123' -RecordingId 'rec-def456' -Body $annotationBody
    Creates a new annotation on the specified recording starting at 30 seconds.

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

function New-GCRecordingAnnotation {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$ConversationId,

        [Parameter(Mandatory = $true)]
        [string]$RecordingId,

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

    $endpoint = "conversations/$ConversationId/recordings/$RecordingId/annotations"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method POST -Body $Body
}