Federating Partners Using API
This article provides information on Zscaler Private Access (ZPA) Business-to-Business (B2B) Partner Federation use cases using APIs. All APIs are rate limited. To learn more, see ZPA API Rate Limits and Understanding Business-to-Business (B2B) Federation.
Generating a Token for a Partner Federation Request
To generate a token for a B2B partner:
-
Send a
POSTrequest to the following endpoint:/mgmtconfig/v1/admin/customers/{customerId}/tenant-federation/token?microtenantId={microtenantId}. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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/customers/72057595111669760/tenant-federation/token?microtenantId=145260601092866314. -
Include the request headers to provide information about the request context:
- Content-Type:
application/json - Authorization:
Bearer <access_token>
- Content-Type:
-
Provide the following JSON payload and include
expiryTimeInSeconds, the time range in seconds that the access token is valid.
Minimum Criteria JSON Payload
{
"expiryTimeInSeconds": 0,
"notes": "string"
}
Example Minimum Criteria JSON Payload
{
"expiryTimeInSeconds": 86400,
"notes": "Federation request from Acme Corp to share PRA apps."
}
Example Response
{
"id": "145260601092866811",
"token": "eyJhbGciOiJIUzI1NiJ9.eyJjdXN0b21lcklkIjoxNDUyNjA2MDEwOTI4NjY...",
"tokenExpirationEpochSeconds": 1745265432
}
A successful response returns code 200. To learn more, see ZPA API Codes.
Verifying a Token for a Partner Federation Request
A business partner (host or guest) can verify a token and partner information, and then send a federation request back to the initiator. This process shares information about the business partner and uses the token.
To verify a token received from the host partner:
-
Send a
POSTrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation/token/verify?microtenantId={microtenantId}. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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/customers/72057595111669761/tenant-federation/token/verify?microtenantId=145260601092866314. -
Include the request headers to provide information about the request context:
- Content-Type:
application/json - Authorization:
Bearer <access_token>
- Content-Type:
-
Provide the following JSON payload and include the following details:
token: The Federation token generated by the business partner (guest or host) who initiated the Federation request.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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.
JSON Payload
{
"token": "string"
}
Example JSON Payload
{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJjdXN0b21lcklkIjoxNDUyNjA2MDEwOTI4NjY..."
}
Example Response
{
"success": true,
"partnerInfo": {
"partnerGid": "72057595111669760",
"partnerName": "Acme Corp",
"partnerScopeName": "Default",
"approvalStatus": "PENDING",
"federationStatus": "INACTIVE"
},
"partnerNotes": "Federation request from Acme Corp to share PRA apps.",
"tokenExpirationEpochSeconds": 1745265432
}
A successful response returns code 200. To learn more, see ZPA API Codes.
Approving a Partner Federation Request
To approve a partner federation request:
-
Send a
PUTrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation/approval?microtenantId={microtenantId}. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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/customers/72057595111669761/tenant-federation/approval?microtenantId=145260601092866314. -
Include the request headers to provide information about the request context:
- Content-Type:
application/json - Authorization:
Bearer <access_token>
- Content-Type:
-
Provide the following JSON payload and include the following details:
token: The Federation token generated by the business partner (guest or host) who initiated the Federation request. The provided token must match the token that was verified.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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.
Minimum Criteria JSON Payload
{
"token": "string",
"partnerNotes": "string"
}
Example Minimum Criteria JSON Payload
{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJjdXN0b21lcklkIjoxNDUyNjA2MDEwOTI4NjY...",
"partnerNotes": "Approved. Looking forward to the collaboration."
}
A successful response returns code 204. To learn more, see ZPA API Codes.
Updating the Provisioning Status
To update the provisioning status of the partner federation request:
-
Send a
PUTrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation/{federation_id}/provisioning-state/{status}?microtenantId={microtenantId}. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.federation_id: The unique identifier of the Federation you want to update the provisioning status for.status: The provisioning status of the Federation. The supported values are:APPROVED: The provisioning status of the Federation is approved.DENIED: The provisioning status of the Federation is denied.TERMINATED: The provisioning status of the Federation is terminated.
microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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/customers/72057595111669761/tenant-federation/approval?microtenantId=145260601092866314. -
Include the request headers to provide information about the request context:
- Content-Type:
application/json - Authorization:
Bearer <access_token>
- Content-Type:
A successful response returns code 204. To learn more, see ZPA API Codes.
Updating the Federation State
To update the status of an existing Federation to active or inactive when a Federation is in an approved provisioning state:
-
Send a
PUTrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation/{federation_id}/federation-state/{status}?microtenantId={microtenantId}. -
Provide the following in the request endpoint:
-
customerId: The ZPA tenant ID of the customer. -
federation_id: The unique identifier of the Federation you want to update the Federation status for. -
status: The provisioning status of the Federation. The supported values are:To terminate a federation, see Deleting a Federation.
-
microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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/customers/72057595111669760/tenant-federation/137629/federation-state/ACTIVE?microtenantId=145260601092866314. -
-
Include the request headers to provide information about the request context:
- Content-Type:
application/json - Authorization:
Bearer <access_token>
- Content-Type:
A successful response returns code 204. To learn more, see ZPA API Codes.
Getting All Partner Federations
To get all partner Federations for the specified customer (both the host and guest partner):
-
Sent a
GETrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation?microtenantId={microtenantId}&page={page}&pagesize={pagesize}&sortBy={creationTime}&sortDir={sortDir}. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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.page: Specifies the page number. This field is 1 by default.pagesize: Specifies the page size. If not provided, the default page size is 20. The maximum page size is 500.sortBy: Indicates the parameter that is used to sort the results (i.e.,creationTimeorprovisioningStatus).sortDir: Specifies the sort direction (i.e., ascending or descending order).
For example:
/mgmtconfig/v1/customers/72057595111669760/tenant-federation?page=1&pagesize=20µtenantId=145260601092866314.
Example Response
{
"totalPages": "1",
"totalCount": "2",
"list": [
{
"id": 137629,
"provisioningStatus": "APPROVED",
"notes": "Federation request from Acme Corp to share PRA apps.",
"isInitiator": true,
"partnerInfo": {
"partnerGid": 72057595111669761,
"partnerName": "Globex Inc",
"partnerScopeName": "Default",
"approvalStatus": "APPROVED",
"federationStatus": "ACTIVE"
},
"creationTime": 1744919532,
"modifiedTime": 1744920000
},
{
"id": 137630,
"provisioningStatus": "PENDING",
"notes": "Inbound federation request from Initech",
"isInitiator": false,
"partnerInfo": {
"partnerGid": 72057595111669762,
"partnerName": "Initech",
"partnerScopeName": "Default",
"approvalStatus": "PENDING",
"federationStatus": "INACTIVE"
},
"creationTime": 1745000000,
"modifiedTime": 1745000000
}
]
}
A successful response returns code 200. To learn more, see ZPA API Codes.
Getting Active Federated Partners
To get a list of all active federated partners:
-
Sent a
GETrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation/partners?microtenantId={microtenantId}&page=1&pagesize=20. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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.page: Specifies the page number. This field is 1 by default.pagesize: Specifies the page size. If not provided, the default page size is 20. The maximum page size is 500.
For example:
/mgmtconfig/v1/customers/72057595111669760/tenant-federation/partners?page=1&pagesize=20µtenantId=145260601092866314.
Example Response
{
"totalPages": "1",
"totalCount": "1",
"list": [
{
"partnerGid": 72057595111669761,
"partnerName": "Globex Inc",
"partnerScopeName": "Default",
"approvalStatus": "APPROVED",
"federationStatus": "ACTIVE"
}
]
}
A successful response returns code 200. To learn more, see ZPA API Codes.
Deleting a Federation
To delete a Federation:
-
Sent a
GETrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation/{federation_id}?microtenantId={microtenantId}. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.federation_id: The unique identifier of the Federation you want to delete.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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/customers/72057595111669760/tenant-federation/137629?microtenantId=145260601092866314.
A federation cannot be reactivated after it is deleted or terminated, and a new token-based handshake is required to reestablish a federation. The status of the federation is terminated when it is deleted.
A successful response returns code 204. To learn more, see ZPA API Codes.
Updating Federation Notes
To update the Federation notes:
-
Sent a
PUTrequest to the following endpoint:/mgmtconfig/v1/customers/{customerId}/tenant-federation/{federation_id}/notes?microtenantId={microtenantId}. -
Provide the following in the request endpoint:
customerId: The ZPA tenant ID of the customer.federation_id: The unique identifier of the Federation you want to update the notes for.microtenantId: The unique identifier of the Microtenant. If you are within a Microtenant, you must pass themicrotenantIdfield when making an API call to retrieve data from that Microtenant. ThemicrotenantIdcan 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, passmicrotenantIdas0when making requests to retrieve data from the Default Microtenant. If themicrotenantIdis 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:
/mmgmtconfig/v1/customers/72057595111669760/tenant-federation/137629/notes?microtenantId=145260601092866314. -
Include the request headers to provide information about the request context:
- Content-Type:
application/json - Authorization:
Bearer <access_token>
- Content-Type:
-
Provide the following JSON payload and include the updated
notesstring. The maximum supported characters is 1,000.
Minimum Criteria JSON Payload
{
"notes": "string"
}
Example Minimum Criteria JSON Payload
{
"notes": "Renegotiated terms on 2026-05-01."
}
If the caller is the initiator of the Federation, the initiator's notes are updated. If the caller is the partner, the partner's notes are updated.
A successful response returns code 204. To learn more, see ZPA API Codes.
Field Descriptions
The following table includes descriptions of available fields you can use for the federating partner use cases:
| Field | Description | Required | Value |
|---|---|---|---|
| customerId | The unique identifier of the ZPA tenant | Yes | Integer |
| 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. | No | Integer |
| expiryTimeInSeconds | The time to live of the generated token in seconds | Yes | Integer The minimum supported value is 3,600 seconds (1 hour), and the maximum supported value is 86,400 seconds (24 hours). |
| notes | The optional notes from the initiator that are visible to the partner | No | String |
| partnerNotes | The optional notes from the partner used for communication between partners | No | String The maximum supported characters is 1,000. |
| token | The Federation token previous generated by the initiator | Yes | String |
| federation_id | The unique identifier of the Federation | Yes | Integer |
| status | The provisioning status of the Federation | Yes | Enum Supported values:
|
| status | The Federation status. To learn more, see About Federated Partners. | Yes | Enum Supported values:
|
| search | The search string used to support search by features and fields for the API | No | String |
| page | Specifies the page number | No | Integer This field is 1 by default. |
| pagesize | Specifies the page size | No | Integer If not provided, the default page size is 20. The maximum page size is 500. |
| sortBy | Indicates the parameter that is used to sort the results | No | String Supported values:
|
| sortDir | Specifies the sort direction (i.e., ascending or descending order) | No | Enum Supported values:
|