Email Domains API Code Samples
Selection of code samples that demonstrate the use of the Email Domains API. Copy and edit these code samples to suit your needs.
When using the code samples, remember to replace:
- {vanity_name} with your tenant name
- {api_key} with your API key
- {security_token} with a valid security token
These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Email Domains" in API Reference.
Retrieve a list of allowed email domains
Use this sample request to retrieve all the email domains that can sign into Visier.
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/email-domains' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns the allowed email domains.

{
"domains": [
"visier.com"
]
}
Add domains to the list of allowed domains
Use this sample request to add email domains to the allowlist that can sign into Visier.
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/email-domains' \
-H "apikey: {api_key}" \
-H "Cookie: VisierASIDToken={security_token}" \
-H "Content-Type: application/json" \
-d '{
"domains": ["testDomain.com"],
"confirmNotAllowedDomain": true
}'
The response returns the allowed email domains.

{
"domains": [
"visier.com",
"testDomain.com"
]
}
Remove domains from the list of allowed domains
Use this sample request to remove email domains from the allowlist that can sign into Visier. By removing domains from the allowed email domains list, you may remove your own email domain in the allowlist. If this happens, you will lock yourself out from signing into Visier with your username and password. If you are an SSO user, you can still sign in with SSO.
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/email-domains' \
-H "apikey: {api_key}" \
-H "Cookie: VisierASIDToken={security_token}" \
-H "Content-Type: application/json" \
-d '{
"domains": ["testDomain.com"],
"confirmNotAllowedDomain": true
}'
The response returns the allowed email domains.

{
"domains": [
"visier.com"
]
}