Public/New-GCFlowVersion.ps1

<#
.SYNOPSIS
    Creates a new version of a flow in Genesys Cloud.

.DESCRIPTION
    Creates a new version of an existing architect flow using the Genesys Cloud API.
    API Endpoint: POST /api/v2/flows/{flowId}/versions

.PARAMETER FlowId
    The unique identifier of the flow to create a new version for.

.PARAMETER Body
    The version definition object containing the flow configuration for the new version.

.EXAMPLE
    New-GCFlowVersion -FlowId 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' -Body $versionBody
    Creates a new version of the specified flow.

.NOTES
    Genesys Cloud API: POST /api/v2/flows/{flowId}/versions
#>

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

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

    $endpoint = "flows/$FlowId/versions"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method POST -Body $Body
}