Account Routes

token_auth = dmda.DomoTokenAuth(
    domo_instance=os.environ["DOMO_INSTANCE"],
    domo_access_token=os.environ["DOMO_ACCESS_TOKEN"],
)

Account Route Error Types

Retrieval Routes


source

get_oauth_accounts

 get_oauth_accounts (auth:domolibrary.client.DomoAuth.DomoAuth,
                     debug_api:bool=False, debug_num_stacks_to_drop=1,
                     parent_class:str=None,
                     session:httpx.AsyncClient=None)

source

get_accounts

 get_accounts (auth:domolibrary.client.DomoAuth.DomoAuth,
               debug_api:bool=False, debug_num_stacks_to_drop=1,
               parent_class:str=None, session:httpx.AsyncClient=None)

retrieve a list of all the accounts the user has read access to. Note users with “Manage all accounts” will retrieve all account objects


source

get_available_data_providers

 get_available_data_providers (auth:domolibrary.client.DomoAuth.DomoAuth,
                               debug_api:bool=False,
                               debug_num_stacks_to_drop=1,
                               parent_class:str=None,
                               session:httpx.AsyncClient=None)

source

Account_GET_Error

 Account_GET_Error
                    (res:domolibrary.client.ResponseGetData.ResponseGetDat
                    a, account_id:int=None, message:str=None)

base exception

providers = (await get_available_data_providers(auth = token_auth)).response

print(f"there are {len(providers)} available ")
pd.DataFrame(providers)[0:5]
there are 1154 available 
id key name url defaultConnectorId defaultConnectorLabel authenticationScheme authenticationSchemeConfiguration translationMap connectorValidatorPresent ... scope producer version dateCreated dateUpdated visibility type capabilities customerOAuthConfigurationDataProviderType advancedUiConnectorId
0 710 10k 10k http://www.10000ft.com/ com.domo.connector.10k 10k fields [{'id': 3581, 'name': 'apiKey', 'type': 'passw... {} False ... GLOBAL DOMO 0 1494789166000 1490641118000 WITH_CONNECTOR STANDARD {'readingSecretsSupported': False, 'writingSec... None None
1 4792 test-temp-97e6f554-6000-4a7f-96ce-be4449fa30a7 2-7 test Third Party None None None None [] {} False ... GLOBAL DOMO 0 1678915048000 1678915048000 WITH_CONNECTOR STANDARD {'readingSecretsSupported': False, 'writingSec... None None
2 1269 abc-news-3a4136be-9552-4eed-a438-a07e7f723cc9 ABC News Third Party None com.thirdparty.connector.3a4136be-9552-4eed-a4... None None [] {} False ... GLOBAL DOMO 0 1528294791000 1528201713000 WITH_CONNECTOR STANDARD {'readingSecretsSupported': False, 'writingSec... None None
3 643 abs-indicators-abd9d37e-acb9-4677-9a70-7d680dd... ABS Indicators Third Party None None None None [] {} False ... GLOBAL DOMO 0 1494789166000 1494789166000 WITH_CONNECTOR STANDARD {'readingSecretsSupported': False, 'writingSec... None None
4 4876 abstract-credential-store Abstract Credential Store None None None fields [{'id': 16655, 'name': 'credentials', 'type': ... {} False ... GLOBAL DOMO 0 1672760351000 1672760351000 ALWAYS STANDARD {'readingSecretsSupported': False, 'writingSec... None None

5 rows × 24 columns

sample implementation of get_accounts

pd.DataFrame((await get_accounts(auth=token_auth)).response[0:5])
id userId name displayName type valid allowExternalUse dataProviderType credentialsType createdAt createdBy modifiedAt modifiedBy secretManagerAccountId configurations accountId accountTemplateId accountTemplateAuthorizationId
0 125 1893952720 sudo_demo sudo_demo data True True domo-access-token fields 1717452645000 1893952720 1717452645000 1893952720 None {} 125 None None
1 102 1893952720 my_domo_community_access_token - updated 2024-... dp24 - update 2025-03-11 17:27:21.566530 data True True abstract-credential-store fields 1711242208000 1893952720 1741714041000 1893952720 None {} 102 None None
2 124 1893952720 zzz zzz data True True domo-access-token fields 1716999578000 1893952720 1716999578000 1893952720 None {} 124 None None
3 100 1893952720 Domo Access Token Account (2) domo-community_NF data True True domo-access-token fields 1711241637000 1893952720 1716996226000 1893952720 None {} 100 None None
4 120 1893952720 domo-access-token config_test_factory data True True domo-access-token fields 1715202870000 1893952720 1715202870000 1893952720 None {} 120 None None
pd.DataFrame((await get_oauth_accounts(auth=token_auth, debug_api=False)).response[0:5])
userId datasourceCount id name displayName type enabled dataProviderType credentialsType origin createdAt createdBy modifiedAt modifiedBy configurationsList owners configurationAsList configurations
0 612085674 0 1 OZ test OZ test data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731503516000 612085674 1731505069000 612085674 [] [{'type': 'USER', 'id': '612085674'}] [] {}
1 1893952720 0 3 test_api test_api data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731507343000 1893952720 1731507343000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}
2 1893952720 0 4 test_api test_api data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731507679000 1893952720 1731507679000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}
3 1893952720 0 5 Jira On Prem OAuth Config OAuth Configuration domolibrary test account - updated 2025-04-10 data True jira-on-prem-oauth-config oauth OAUTH_CONFIGURATION 1731511049000 1893952720 1744316847000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}
4 1893952720 0 6 test_api test_dl data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731513504000 1893952720 1731513504000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}

source

get_oauth_account_by_id

 get_oauth_account_by_id (auth:domolibrary.client.DomoAuth.DomoAuth,
                          account_id:int, debug_api:bool=False,
                          debug_num_stacks_to_drop:int=1,
                          parent_class:str=None,
                          session:httpx.AsyncClient=None,
                          return_raw:bool=False)

retrieves all_oauth_accounts and filters to the selected one. There does not appear to be an API implementation of retrieving one OAuth Account


source

get_account_by_id

 get_account_by_id (auth:domolibrary.client.DomoAuth.DomoAuth,
                    account_id:int, debug_api:bool=False,
                    debug_num_stacks_to_drop:int=1, parent_class:str=None,
                    session:httpx.AsyncClient=None, is_unmask:bool=False)

retrieves metadata about an account


source

Account_NoMatch

 Account_NoMatch (res:domolibrary.client.ResponseGetData.ResponseGetData,
                  account_id=None, message='Account not found --  has it
                  been shared with the user?')

base exception

sample implementation of get_account_by_id

(await get_account_by_id(auth=token_auth, account_id=71)).response
{'id': 71,
 'userId': 1893952720,
 'name': 'domo_creds',
 'displayName': 'DomoLibrary - update 2025-04-10 20:36:24.106444',
 'type': 'data',
 'valid': True,
 'allowExternalUse': False,
 'dataProviderType': 'abstract-credential-store',
 'credentialsType': 'fields',
 'createdAt': 1684447092000,
 'createdBy': 1893952720,
 'modifiedAt': 1744317387000,
 'modifiedBy': 1893952720,
 'secretManagerAccountId': None,
 'configurations': {},
 'accountId': 71,
 'accountTemplateId': None,
 'accountTemplateAuthorizationId': None}
oauth_account_id = 1

(
    await get_oauth_account_by_id(
        auth=token_auth,
        account_id=oauth_account_id,
    )
).response
{'userId': 612085674,
 'datasourceCount': 0,
 'id': 1,
 'name': 'OZ test',
 'displayName': 'OZ test',
 'type': 'data',
 'enabled': True,
 'dataProviderType': 'snowflake-oauth-config',
 'credentialsType': 'oauth',
 'origin': 'OAUTH_CONFIGURATION',
 'createdAt': 1731503516000,
 'createdBy': 612085674,
 'modifiedAt': 1731505069000,
 'modifiedBy': 612085674,
 'configurationsList': [],
 'owners': [{'type': 'USER', 'id': '612085674'}],
 'configurationAsList': [],
 'configurations': {}}

Account Config


source

get_oauth_account_config

 get_oauth_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                           account_id:int, data_provider_type:str,
                           return_raw:bool=False, debug_api:bool=False,
                           debug_num_stacks_to_drop:int=1,
                           parent_class:str=None,
                           session:httpx.AsyncClient=None)

retrieves metadata about an account


source

get_account_config

 get_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                     account_id:int, data_provider_type:str=None,
                     return_raw:bool=False, debug_api:bool=False,
                     debug_num_stacks_to_drop:int=1,
                     parent_class:str=None,
                     session:httpx.AsyncClient=None, is_unmask:bool=True)
Type Default Details
auth DomoAuth
account_id int
data_provider_type str None
return_raw bool False
debug_api bool False
debug_num_stacks_to_drop int 1
parent_class str None
session AsyncClient None
is_unmask bool True unmasks encrypted values IF config allows
Returns ResponseGetData

sample implementation of get_account_config

account_id = 145

(await get_account_config(
    auth=token_auth,
    account_id=account_id,
    debug_api=False,
    return_raw=False,
    is_unmask = True,
)).response
{'credentials': '********',
 'allowExternalUse': 'true',
 '_search_metadata': {'account_id': 145,
  'data_provider_type': 'abstract-credential-store'}}
oauth_account_id = 1

res = await get_oauth_account_by_id(
    auth=token_auth,
    account_id=oauth_account_id,
    debug_api=False,
)

data_provider_type = res.response["dataProviderType"]

(
    await get_oauth_account_config(
        auth=token_auth,
        account_id=oauth_account_id,
        data_provider_type=data_provider_type,
    )
).response
{'client-secret': '123',
 'allowExternalUse': 'true',
 'client-id': '123',
 '_search_metadata': {'account_id': 1,
  'data_provider_type': 'snowflake-oauth-config'}}

CRUD Routes

CREATE and Delete


source

delete_oauth_account

 delete_oauth_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                       account_id:str, debug_api:bool=False,
                       debug_num_stacks_to_drop=1, parent_class:str=None,
                       session:httpx.AsyncClient=None)

source

create_oauth_account

 create_oauth_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                       account_name:str=None, data_provider_type:str=None,
                       origin:str='OAUTH_CONFIGURATION', config:dict=None,
                       create_body:dict=None, debug_api:bool=False,
                       session:httpx.AsyncClient=None,
                       parent_class:str=None, debug_num_stacks_to_drop=1)

source

generate_create_oauth_account_body

 generate_create_oauth_account_body (account_name, data_provider_type,
                                     origin, config)

source

delete_account

 delete_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                 account_id:str, debug_api:bool=False,
                 debug_num_stacks_to_drop=1, parent_class:str=None,
                 session:httpx.AsyncClient=None)

source

create_account

 create_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                 account_name:str=None, data_provider_type:str=None,
                 config_body:dict=None, payload:dict=None,
                 debug_api:bool=False, session:httpx.AsyncClient=None,
                 parent_class:str=None, debug_num_stacks_to_drop=1)
Type Default Details
auth DomoAuth
account_name str None
data_provider_type str None
config_body dict None properly formatted AccountConfig
payload dict None final payload
debug_api bool False
session AsyncClient None
parent_class str None
debug_num_stacks_to_drop int 1
Returns ResponseGetData

source

generate_create_account_body

 generate_create_account_body (account_name, data_provider_type,
                               config_body)

source

Account_CreateParams_Error

 Account_CreateParams_Error (message:str)

base exception


source

Account_CRUD_Error

 Account_CRUD_Error
                     (res:domolibrary.client.ResponseGetData.ResponseGetDa
                     ta, account_id=None, message:str=None)

base exception

create_body = {
    "name": "test_api",
    "displayName": "test_dl",
    "dataProviderType": "snowflake-oauth-config",
    "origin": "OAUTH_CONFIGURATION",
    "configurations": {"client-id": "777", "client-secret": "777"},
}

res = await create_oauth_account(auth=token_auth, create_body=create_body)
res
ResponseGetData(status=200, response={'id': 129, 'name': 'test_api', 'displayName': 'test_dl', 'type': 'data', 'enabled': False, 'allowExternalUse': False, 'dataProviderType': 'snowflake-oauth-config', 'credentialsType': 'oauth', 'origin': 'OAUTH_CONFIGURATION', 'createdAt': None, 'createdBy': 1893952720, 'modifiedAt': None, 'modifiedBy': 1893952720, 'configurationsList': [], 'configurationAsList': [], 'configurations': {}, 'secretManagerAccountId': None}, is_success=True, parent_class=None)
await delete_oauth_account(
    account_id = res.response['id'],
    auth = token_auth
)
ResponseGetData(status=200, response='deleted account 129', is_success=True, parent_class=None)

UPDATE


source

update_oauth_account_config

 update_oauth_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                              account_id:int, config_body:dict,
                              data_provider_type:str=None,
                              debug_api:bool=False,
                              debug_num_stacks_to_drop:int=1,
                              parent_class:str=None,
                              session:httpx.AsyncClient=None)

source

update_account_config

 update_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                        account_id:int, config_body:dict,
                        data_provider_type:str=None, debug_api:bool=False,
                        debug_num_stacks_to_drop:int=1,
                        parent_class:str=None,
                        session:httpx.AsyncClient=None)

source

Account_Config_Error

 Account_Config_Error
                       (res:domolibrary.client.ResponseGetData.ResponseGet
                       Data, account_id=None, message:str=None)

base exception

sample implementation of update_account

try:
    print((await update_account_config(
        auth=token_auth,
        account_id=71,
        config_body={"credentials": "abc123"},
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 71, 'userId': 1893952720, 'name': 'domo_creds', 'displayName': 'DomoLibrary - update 2025-04-10 20:36:24.106444', 'type': 'data', 'valid': True, 'allowExternalUse': False, 'dataProviderType': 'abstract-credential-store', 'credentialsType': 'fields', 'createdAt': 1684447092000, 'createdBy': 1893952720, 'modifiedAt': 1744317387000, 'modifiedBy': 1893952720, 'secretManagerAccountId': None, 'configurations': {}, 'accountTemplateAuthorizationId': None, 'accountTemplateId': None, 'accountId': 71}
try:
    print((await update_oauth_account_config(
        auth=token_auth,
        account_id=5,
        config_body={"client_id": str(dt.datetime.now().strftime('%Y-%m-%d-%H%M'))},
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 5, 'name': 'Jira On Prem OAuth Config OAuth Configuration', 'displayName': 'domolibrary test account - updated 2025-04-10', 'type': 'data', 'enabled': True, 'allowExternalUse': True, 'dataProviderType': 'jira-on-prem-oauth-config', 'credentialsType': 'oauth', 'origin': 'OAUTH_CONFIGURATION', 'createdAt': 1731511049000, 'createdBy': 1893952720, 'modifiedAt': 1744316847000, 'modifiedBy': 1893952720, 'configurationsList': [], 'configurationAsList': [], 'configurations': {}, 'secretManagerAccountId': None}

source

update_oauth_account_name

 update_oauth_account_name (auth:domolibrary.client.DomoAuth.DomoAuth,
                            account_id:int, account_name:str,
                            debug_api:bool=False,
                            debug_num_stacks_to_drop:int=1,
                            parent_class:str=None,
                            session:httpx.AsyncClient=None)

source

update_account_name

 update_account_name (auth:domolibrary.client.DomoAuth.DomoAuth,
                      account_id:int, account_name:str,
                      debug_api:bool=False,
                      debug_num_stacks_to_drop:int=1,
                      parent_class:str=None,
                      session:httpx.AsyncClient=None)

sample implementation of update_account_name

try:
    print((await update_account_name(
        auth=token_auth,
        account_id=71,
        account_name=f"domolibrary test account - updated {dt.date.today()}",
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 71, 'userId': 1893952720, 'name': 'domo_creds', 'displayName': 'domolibrary test account - updated 2025-04-10', 'type': 'data', 'valid': True, 'allowExternalUse': False, 'dataProviderType': 'abstract-credential-store', 'credentialsType': 'fields', 'createdAt': 1684447092000, 'createdBy': 1893952720, 'modifiedAt': 1744318282000, 'modifiedBy': 1893952720, 'secretManagerAccountId': None, 'configurations': {}, 'accountTemplateId': None, 'accountTemplateAuthorizationId': None, 'accountId': 71}
try:
    print((await update_oauth_account_name(
        auth=token_auth,
        account_id=5,
        account_name=f"domolibrary test account - updated {dt.date.today()}",
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 5, 'name': 'Jira On Prem OAuth Config OAuth Configuration', 'displayName': 'domolibrary test account - updated 2025-04-10', 'type': 'data', 'enabled': True, 'allowExternalUse': True, 'dataProviderType': 'jira-on-prem-oauth-config', 'credentialsType': 'oauth', 'origin': 'OAUTH_CONFIGURATION', 'createdAt': 1731511049000, 'createdBy': 1893952720, 'modifiedAt': 1744318283000, 'modifiedBy': 1893952720, 'configurationsList': [{'id': None, 'name': 'client_id', 'value': '{encrypted}YmZhY2Q4MDAtMjFjNS00ZTI5LWJlMjctNTZmOTk3MjUyYTBltZ7+Fqn382pvgccb66ZMTdI7bBaHuCVfw7qcWwJ7wt8='}, {'id': None, 'name': 'client_secret', 'value': '{encrypted}ODIzOGY3MjQtNjM4Yy00YjkxLTk0ZDItM2Q3NzhiOTU1YjM095NmBv0/cS5RogukZ5DdxdfvZ7K6URQ/d1HgQlcrEak='}], 'configurationAsList': [{'id': None, 'name': 'client_id', 'value': '{encrypted}YmZhY2Q4MDAtMjFjNS00ZTI5LWJlMjctNTZmOTk3MjUyYTBltZ7+Fqn382pvgccb66ZMTdI7bBaHuCVfw7qcWwJ7wt8='}, {'id': None, 'name': 'client_secret', 'value': '{encrypted}ODIzOGY3MjQtNjM4Yy00YjkxLTk0ZDItM2Q3NzhiOTU1YjM095NmBv0/cS5RogukZ5DdxdfvZ7K6URQ/d1HgQlcrEak='}], 'configurations': {'client_secret': '{encrypted}ODIzOGY3MjQtNjM4Yy00YjkxLTk0ZDItM2Q3NzhiOTU1YjM095NmBv0/cS5RogukZ5DdxdfvZ7K6URQ/d1HgQlcrEak=', 'client_id': '{encrypted}YmZhY2Q4MDAtMjFjNS00ZTI5LWJlMjctNTZmOTk3MjUyYTBltZ7+Fqn382pvgccb66ZMTdI7bBaHuCVfw7qcWwJ7wt8='}, 'secretManagerAccountId': None}

Account Sharing


source

get_oauth_account_accesslist

 get_oauth_account_accesslist (auth:domolibrary.client.DomoAuth.DomoAuth,
                               account_id:str, return_raw:bool=False,
                               debug_api:bool=False,
                               debug_num_stacks_to_drop:int=1,
                               parent_class:str=None,
                               session:httpx.AsyncClient=None)

source

get_account_accesslist

 get_account_accesslist (auth:domolibrary.client.DomoAuth.DomoAuth,
                         account_id:str, debug_api:bool=False,
                         debug_num_stacks_to_drop:int=1,
                         parent_class:str=None,
                         session:httpx.AsyncClient=None,
                         return_raw:bool=False)
pd.DataFrame((await get_account_accesslist(auth=token_auth, account_id=71)).response)
type id accessLevel name
0 USER 233216585 CAN_VIEW test - updated via dl 2025-04-10
1 GROUP 1814479647 CAN_VIEW Admin Test
2 USER 55874022 CAN_VIEW Grant Smith
3 USER 1893952720 CAN_VIEW Jae Wilson1
4 USER 1216550715 OWNER 8:26 - go to sleep
pd.DataFrame((await get_oauth_account_accesslist(auth=token_auth, account_id=5, return_raw = False)).response)
type id accessLevel name
0 USER 1893952720 OWNER Jae Wilson1

source

ShareAccount_AccessLevel

 ShareAccount_AccessLevel (value, names=None, module=None, qualname=None,
                           type=None, start=1)

Enum that correlates to the v2 API which should also be the current version


source

ShareAccount_V1_AccessLevel

 ShareAccount_V1_AccessLevel (value, names=None, module=None,
                              qualname=None, type=None, start=1)

An enumeration.


source

ShareAccount

 ShareAccount ()

Initialize self. See help(type(self)) for accurate signature.


source

share_oauth_account

 share_oauth_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                      account_id:str, share_payload:dict,
                      debug_api:bool=False, parent_class:str=None,
                      debug_num_stacks_to_drop=1,
                      session:httpx.AsyncClient=None)

source

share_account

 share_account (auth:domolibrary.client.DomoAuth.DomoAuth, account_id:str,
                share_payload:dict, debug_api:bool=False,
                parent_class:str=None, debug_num_stacks_to_drop=1,
                session:httpx.AsyncClient=None)

for simplicity, this is the v2 api which should have been deployed to all Domo instances as of DP24


source

Account_AlreadyShared_Error

 Account_AlreadyShared_Error
                              (res:domolibrary.client.ResponseGetData.Resp
                              onseGetData, account_id:int=None,
                              message:str=None)

base exception


source

Account_Share_Error

 Account_Share_Error
                      (res:domolibrary.client.ResponseGetData.ResponseGetD
                      ata, account_id:int=None, message:str=None)

base exception

user_id = 929336557

share_payloads = [
    ShareAccount_AccessLevel.CAN_VIEW.generate_payload(user_id=user_id),
    ShareAccount_AccessLevel.NO_ACCESS.generate_payload(user_id=user_id),
]

account_id = 5

for payload in share_payloads:
    print((await share_oauth_account(
        auth=token_auth,
        account_id=account_id,
        share_payload=payload,
        debug_api=False,
    )).response)


source

share_account_v1

 share_account_v1 (auth:domolibrary.client.DomoAuth.DomoAuth,
                   account_id:str, share_payload:dict,
                   debug_api:bool=False, debug_num_stacks_to_drop:int=1,
                   parent_class:str=None, session:httpx.AsyncClient=None)

V1 API allows sharing with users ONLY. it does not support sharing with groups and has a more limited set of share rights (owner or read) see ShareAccount_V1_AccessLevel vs v2