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.

I tried to use the export job endpoints, but I’m not sure how to target specific flows. 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?

1 Like

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/flows?divisionId={division_id}" \
 -H "Authorization: Bearer {access_token}"
2 Likes