> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Test Exchange Connection >
Premium tag
Test whether Rocket.Chat can connect to Microsoft Exchange with the workspace Microsoft Exchange server-to-server settings. Requires the `outlook-calendar` license module and the `test-admin-options` permission. Server-to-server sync must be enabled (`Outlook_Calendar_Enabled` on and Integration mode set to server-to-server). ### Changelog | Version | Description | | ------- | ----------- | | 9.1.0 | Added | ## OpenAPI ````json POST /api/v1/exchange.testConnection { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Miscellaneous" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Commands" }, { "name": "Email Inbox" }, { "name": "Licenses" }, { "name": "Mailer" }, { "name": "Calendar Events" }, { "name": "Exchange" }, { "name": "Contacts" }, { "name": "WhatsApp" }, { "name": "Rasa App" }, { "name": "Jitsi App" } ], "paths": { "/api/v1/exchange.testConnection": { "post": { "summary": "Test Exchange Connection", "tags": [ "Exchange" ], "operationId": "post-api-v1-exchange.testConnection", "description": "
\"Premium
\n\nTest whether Rocket.Chat can connect to Microsoft Exchange with the workspace Microsoft Exchange server-to-server settings.\n\nRequires the `outlook-calendar` license module and the `test-admin-options` permission. Server-to-server sync must be enabled (`Outlook_Calendar_Enabled` on and Integration mode set to server-to-server).\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 9.1.0 | Added |", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "provider": { "type": "string", "description": "The configured Exchange sync provider. Either `ews` or `graph`." }, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "examples": { "Example 1": { "value": { "provider": "ews", "message": "Exchange_Test_Connection_successful", "success": true } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Server Sync Disabled": { "value": { "success": false, "error": "Exchange_Server_Sync_Disabled" } }, "Not Configured": { "value": { "success": false, "error": "Exchange_Test_Connection_not_configured" } }, "Authentication Failed": { "value": { "success": false, "error": "Exchange_Test_Connection_authentication_failed" } }, "Authorization Failed": { "value": { "success": false, "error": "Exchange_Test_Connection_authorization_failed" } }, "Mailbox Not Found": { "value": { "success": false, "error": "Exchange_Test_Connection_mailbox_not_found" } }, "Connection Failed": { "value": { "success": false, "error": "Exchange_Test_Connection_connection_failed" } }, "Host Not Allowed": { "value": { "success": false, "error": "Exchange_Test_Connection_host_not_allowed" } }, "NTLM Unavailable": { "value": { "success": false, "error": "Exchange_Test_Connection_ntlm_unavailable" } }, "Endpoint Not Recognized": { "value": { "success": false, "error": "Exchange_Test_Connection_endpoint_not_recognized" } }, "Rate Limited": { "value": { "success": false, "error": "Exchange_Test_Connection_rate_limited" } }, "License Required": { "value": { "success": false, "error": "This is an enterprise feature [error-action-not-allowed]", "errorType": "error-action-not-allowed" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Permission Error": { "value": { "success": false, "error": "User does not have the permissions required for this action [error-unauthorized]" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Unexpected Response": { "value": { "success": false, "error": "Exchange_Test_Connection_unexpected_response" } }, "Sync State Invalid": { "value": { "success": false, "error": "Exchange_Test_Connection_sync_state_invalid" } } } } } } } } } }, "components": { "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The `userId` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "rbAXPnMktTFbNpwtJ" } }, "responses": { "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Authorization Error": { "value": { "success": false, "error": "You must be logged in to do this." } } } } } } } } } ````