CX as Code CLI: Exporting Architect flows returns empty JSON array

I’m trying to automate the backup of our Architect flows using the Genesys Cloud CX as Code CLI. The goal is to capture the JSON definitions so we can version control them alongside our New Relic alert policies.

I ran the export command targeting the Architect resource type:

gc cxascode export --resource-type architect --output-dir ./flows

The CLI runs without errors, but the resulting JSON files are completely empty. It’s just an empty array [] for every flow. I’ve verified that the OAuth token has the architect:flow:read scope.

I checked the underlying API call using Postman. A GET to /api/v2/architect/flows returns the expected payload with all flow details. The issue seems to be specific to the CLI parsing or the export configuration.

Is there a specific flag required to expand the flow details during export? Or do I need to manually iterate through the flows and call the details endpoint via the SDK instead? The documentation for the CLI is pretty sparse on this edge case.

The CLI defaults to --flow-type architect but often misses versioned flows if you don’t specify the scope. Try adding –include-versions or check if your org uses the new flow structure. Also, ensure your access token has flow:read scope. Here’s a working curl to verify the export payload directly:

curl -X GET "https://api.mypurecloud.com/api/v2/architect/flows" \
 -H "Authorization: Bearer YOUR_TOKEN"