Exporting Architect Flows via CX as Code CLI

Does anyone know the correct syntax to export all Architect flows as JSON using the CX as Code CLI?

  • I am running genesyscloud arch flow export-all but it fails with a 403 Forbidden.
  • My service account has the architect:flow:view permission.
  • The error payload shows {"errors":[{"code":"forbidden","message":"Insufficient permissions"}]}.
  • I need to ingest these into my gRPC event processor for validation.
  • Should I use a specific export format flag?

The problem here is architect:flow:view isn’t enough for bulk exports. The CLI needs architect:flow:export too. check the service account in admin. also, make sure the token scope includes architect:flow:export. my dashboards broke until i added that.

you need to add architect:flow:export. just view won’t cut it for the cli bulk command. the 403 is accurate here. i’ve seen this trip people up because the ui lets you view flows without the export scope, but the cli api endpoint is stricter.

check the service account permissions in admin. if you’re using oauth, make sure the client scope actually includes that permission too. sometimes the token is valid but lacks the specific resource scope.

also, watch out for flow locks. if an architect has a flow open in edit mode, the export might hang or fail silently on that specific item. not a 403, but annoying.

once you grant the export perm, run it again. you’ll get a tarball or json dump depending on your flags.

i usually pipe this into kafka connect for a data lake sync. if you’re doing that, watch the schema registry. architect flows change structure often. exactly-once semantics help here but aren’t default. just a heads up.

1 Like

The easiest way to fix this is…

  1. go to admin > security > service accounts.
  2. edit your account.
  3. add architect:flow:export to permissions.
  4. regenerate token.

works for me. don’t forget the token refresh.

3 Likes

have you tried checking the service account roles in admin? sometimes the permission is there but the role binding is stale. i usually just re-assign the architect flow export role to force a sync. also verify the oauth client has the scope. pretty annoying when the ui says yes but the api says no.