Jae Wilson @DataCrew
Domo

Domo + CodeEngine - getting started (adding impersonation)

June 3, 2024

Hook

Running Domo API calls as the authenticated user is fine — until you need admin-level access to pull all cards, all datasets, or anything else that requires elevated permissions without handing out admin credentials.

Why It Matters

Every other place in Domo where you can access account objects, you can also print the password in cleartext if you know what you're doing. CodeEngine breaks that pattern. It lets you impersonate an admin user — effectively running with sudo — without ever exposing the underlying credentials to the function caller. This matters because it opens up a class of automation that previously required either giving users admin access or hardcoding sensitive credentials directly into scripts.

What You'll Learn

  • Understand why CodeEngine's account model is fundamentally different from other Domo credential patterns
  • Build a get_account function that retrieves typed account objects by name
  • Implement user impersonation in CodeEngine Python functions using domolibrary
  • Structure your CodeEngine functions with explicit input/output types for reliability
  • Use a shared account to pass elevated credentials without exposing the underlying secret