CX as Code CLI: Exporting Architect Flows via API

Trying to pull all Architect flows as JSON for a backup script. The docs mention the CLI, but I need to automate it via the API directly.

Hit GET /api/v2/architect/flows with a valid token. Got a 200 OK, but the response body is just an empty array [].

I have architect:flow:read permissions. The flows exist in the UI. Am I missing a query param or is this endpoint restricted for bulk exports?

That endpoint only returns flows if you pass a divisionId. Without it, the API returns an empty list because it doesn’t know which org unit to query.

curl -X GET "https://api.mypurecloud.com/api/v2/architect/flows?divisionId={division_id}" \
 -H "Authorization: Bearer {access_token}"