Overview
TheInstanceServiceApi provides methods for managing Zitadel instances, including instance lifecycle, custom domains, and trusted domains. Most methods require system-level permissions.
Initialize the API
Instance Management
get_instance
get_instance
Returns the instance in the current context or by its ID.Required permissions:
iam.read(for current instance)system.instance.read(for specific instance ID)
list_instances
list_instances
Lists instances matching the given query. Requires system level permissions.Required permission:
system.instance.readupdate_instance
update_instance
Updates instance’s name in the current context or by its ID.Required permissions:
iam.write(for current instance)system.instance.write(for specific instance ID)
delete_instance
delete_instance
Deletes an instance with the given ID. Requires system level permissions.Required permission:
system.instance.deleteCustom Domain Management
add_custom_domain
add_custom_domain
Adds a custom domain to the instance. The domain must be unique across all instances and will be used to route requests.Required permission:
system.domain.writelist_custom_domains
list_custom_domains
Lists custom domains of the instance.Required permissions:
iam.read(for current instance)system.instance.read(for specific instance ID)
remove_custom_domain
remove_custom_domain
Removes a custom domain from the instance. This will stop routing requests from this domain.Required permission:
system.domain.writeTrusted Domain Management
add_trusted_domain
add_trusted_domain
Adds a trusted domain to the instance. Trusted domains can be used in API responses like OIDC discovery and email templates.Required permissions:
iam.write(for current instance)system.instance.write(for specific instance ID)
list_trusted_domains
list_trusted_domains
Lists trusted domains of the instance.Required permissions:
iam.read(for current instance)system.instance.read(for specific instance ID)
remove_trusted_domain
remove_trusted_domain
Removes a trusted domain from the instance.Required permissions:
iam.write(for current instance)system.instance.write(for specific instance ID)
Custom vs Trusted Domains
Custom Domains
- Must be unique across all instances
- Used to route requests to the instance
- Require system-level permissions
- Example:
auth.mycompany.com
Trusted Domains
- Can be shared across instances
- Used in API responses (OIDC discovery, emails)
- Useful for proxy setups and custom login UIs
- Example:
login.mycompany.com
Example: Set Up Custom Domain
Example: Configure Trusted Domains for Proxy Setup
Example: Multi-Instance Management
See Also
- Feature Service - Manage feature flags
- Settings Service - Configure instance settings
- Organization Service - Multi-tenant organization management