Skip to main content

Managing Customer Domains Using API

This article provides information on Zscaler Private Access (ZPA) customer domain use cases using APIs. All APIs are rate limited. To learn more, see ZPA API Rate Limits and Adding DNS Search Domains.

Getting All Domains for a Customer

To get all domains for a customer:

  1. Send a GET request to the following endpoint: /mgmtconfig/v1/admin/customers/{customerId}/v2/associationtype/{type}/domains?microtenantId={microtenantId}.

  2. Provide the following in the request endpoint:

    • customerId: The ZPA tenant ID of the customer.
    • type: The association type of the domain. You must pass SEARCH_SUFFIX as the value for type to retrieve details of DNS search domains.
    • microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass the microtenantId field when making an API call to retrieve data from that Microtenant. The microtenantId can be obtained from the API Keys page, or can be obtained programmatically using the ZPA cloud service API. Access to certain operations is limited when you are within a Microtenant. If you are within the Default Microtenant, pass microtenantId as 0 when making requests to retrieve data from the Default Microtenant. If the microtenantId is not passed in the request when creating or updating a resource, then the resource is created or updated in the Default Microtenant. To learn more, see Configuring Microtenants Using API.

    For example: /mgmtconfig/v1/admin/customers/72057594037927936/v2/associationtype/SEARCH_SUFFIX/domains?microtenantId=0.

A successful response returns code 200. To learn more, see ZPA API Codes.

Example Response​

[
{
"id": "24493",
"modifiedTime": "1753246146",
"creationTime": "1753246146",
"modifiedBy": "72057594038609323",
"domain": "beta.co",
"associationType": "SEARCH_SUFFIX",
"capture": true,
"name": "beta.co"
}
]

Creating or Updating a Domain for a Customer

To create or update a domain for a customer:

  1. Send a POST request to the following endpoint: /mgmtconfig/v1/admin/customers/{customerId}/v2/associationtype/{type}/domains?microtenantId={microtenantId}.

  2. Provide the following in the request endpoint:

    • customerId: The ZPA tenant ID of the customer.
    • type: The association type of the domain. You must pass SEARCH_SUFFIX as the value for type to create a DNS search domain.
    • microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass the microtenantId field when making an API call to retrieve data from that Microtenant. The microtenantId can be obtained from the API Keys page, or can be obtained programmatically using the ZPA cloud service API. Access to certain operations is limited when you are within a Microtenant. If you are within the Default Microtenant, pass microtenantId as 0 when making requests to retrieve data from the Default Microtenant. If the microtenantId is not passed in the request when creating or updating a resource, then the resource is created or updated in the Default Microtenant. To learn more, see Configuring Microtenants Using API.

    For example: /mgmtconfig/v1/admin/customers/72057594037927936/v2/associationtype/SEARCH_SUFFIX/domains?microtenantId=0.

  3. Include the request headers to provide information about the request context:

    • Content-Type: application/json
    • Authorization: Bearer <access_token>
  4. Provide the following JSON payload and include the following details:

    • assocationType: The association type of the domain. You must pass SEARCH_SUFFIX to create a DNS search domain.
    • domain: The domain of the customer.
    • name: The name of the customer.
    • microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass the microtenantId field when making an API call to retrieve data from that Microtenant. The microtenantId can be obtained from the API Keys page, or can be obtained programmatically using the ZPA cloud service API. Access to certain operations is limited when you are within a Microtenant. If you are within the Default Microtenant, pass microtenantId as 0 when making requests to retrieve data from the Default Microtenant. If the microtenantId is not passed in the request when creating or updating a resource, then the resource is created or updated in the Default Microtenant. To learn more, see Configuring Microtenants Using API.

A successful response returns code 204, meaning the domain is created or updated. To learn more, see ZPA API Codes.

JSON Payload​

[
{
"associationType": "SEARCH_SUFFIX",
"capture": true,
"domain": "string",
"name": "<name>",
"microtenantId": <microtenant ID>
}
]

Example JSON Payload​

[
{
"microtenantId": 0,
"domain": "beta.co",
"associationType": "SEARCH_SUFFIX",
"capture": true,
"name": "beta.co"
}
]