Public/New-GCFlow.ps1

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

.DESCRIPTION
    Creates a new architect flow using the Genesys Cloud API.
    The body should contain the flow definition including name, type, and configuration.
    API Endpoint: POST /api/v2/flows

.PARAMETER Body
    The flow definition object to create. Should include properties such as name, type, and description.

.EXAMPLE
    $flowBody = @{ name = 'My New Flow'; type = 'inboundcall'; description = 'A new inbound call flow' }
    New-GCFlow -Body $flowBody
    Creates a new inbound call flow.

.NOTES
    Genesys Cloud API: POST /api/v2/flows
#>

function New-GCFlow {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [object]$Body
    )

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