Not Able to Update Realms For Enterprise connections Using API

I can update a Realms domain using the Auth0 dashboard, but when I attempt to do the same using the Auth0 API, it’s not working. It throws an error stating that Realms are only supported for database connections. What could be causing this discrepancy, and how can I successfully update a Realms domain via the Auth0 API?

Hi @saravanan109587

The name of the property is ‘domain_aliases’ under the ‘options’ property. It expects an array. Here’s a working example in Python (PATCH call to modify the Connection)

	payload = {	
		'options':  {
		'use_wsfed': False,
			'useCommonEndpoint': False,
			'basic_profile': False,
			'ext_profile': False,
			'ext_groups': False,
			'ext_nested_groups': False,
			'api_enable_users': False,
			'waad_protocol': 'openid-connect',
			'identity_api': 'microsoft-identity-platform-v2.0',
			'should_trust_email_verified_connection': 'never_set_emails_as_verified',
			'domain': 'my_azure_domain.com',
			'tenant_domain': 'my_domain.com',
			'client_id': 'abc',
			'client_secret': '123',
			'domain_aliases':["mydomain.com"],
			'realms': ["Azure"]
			}
		}

	r = requests.patch(url + f'/api/v2/connections/<your conn_id>', headers=headers, json=payload).json()
	pprint(r)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.