Add an allowed domain

This endpoint is only available to organization owners.

POST https://chat.zulip.org/api/v1/realm/domains

Add a domain to the set of allowed domains configured in the organization for user account email addresses.

Changes: Prior to Zulip 6.0 (feature level 143), organization administrators who were not owners could access this endpoint.

Usage examples

The -u line implements HTTP Basic authentication. See the Authorization header documentation for how to get those credentials for Zulip users and bots.

curl -sSX POST https://chat.zulip.org/api/v1/realm/domains \
    -u EMAIL_ADDRESS:API_KEY \
    --data-urlencode domain=example.com \
    --data-urlencode allow_subdomains=false

Parameters

domain string required

Example: "example.com"

The new domain.

Changes: In Zulip 4.0 (feature level 63), the unnecessary JSON-encoding of this parameter was removed.


allow_subdomains boolean required

Example: false

Whether subdomains are allowed for this domain.


Response

Return values

  • new_domain: (integer | string)[]

    An array containing the ID of the newly added domain and the submitted domain name string.

Example response(s)

Changes: As of Zulip 7.0 (feature level 167), if any parameters sent in the request are not supported by this endpoint, a successful JSON response will include an ignored_parameters_unsupported array.

A typical successful JSON response may look like:

{
    "msg": "",
    "new_domain": [
        1,
        "example.com"
    ],
    "result": "success"
}