> ## 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 LDAP Connection >
Premium tag
Test if Rocket.Chat can connect to the specified LDAP server using the port and host provided in the Rocket.Chat settings. Make sure LDAP is enabled in **Manage** → **Workspace** → **Settings** → **LDAP** → **Enable** before using this endpoint. Permission required: `test-admin-options` From Rocket.Chat 9.0.0, LDAP is available on Starter workspaces and on all premium plans (Commercial, Government, and Defense). It is not available on Community workspaces, where this endpoint returns `error-action-not-allowed`. See Our Plans for details. ### Changelog | Version | Description | | ------- | ----------- | |9.0.0 | Added premium plan availability details. | ## OpenAPI ````json POST /api/v1/ldap.testConnection { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "User Management" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "LDAP" }, { "name": "Permissions" }, { "name": "Roles" }, { "name": "Users" }, { "name": "SAML" } ], "paths": { "/api/v1/ldap.testConnection": { "parameters": [], "post": { "tags": [ "LDAP" ], "summary": "Test LDAP Connection", "description": "
\"Premium
\n\nTest if Rocket.Chat can connect to the specified LDAP server using the port and host provided in the Rocket.Chat settings.\nMake sure LDAP is enabled in **Manage** → **Workspace** → **Settings** → **LDAP** → **Enable** before using this endpoint.\n\nPermission required: `test-admin-options`\n\nFrom Rocket.Chat 9.0.0, LDAP is available on Starter workspaces and on all premium plans (Commercial, Government, and Defense). It is not available on Community workspaces, where this endpoint returns `error-action-not-allowed`. See Our Plans for details.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n|9.0.0 | Added premium plan availability details. |", "operationId": "post-api-v1-ldap.testConnection", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "success": { "type": "boolean" } } }, "examples": { "Success Example": { "value": { "message": "Connection_success", "success": true } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Not available on Community workspaces": { "value": { "success": false, "error": "This is an enterprise feature [error-action-not-allowed]", "errorType": "error-action-not-allowed" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } } } } }, "components": { "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The authenticated user token.", "required": true, "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The authenticated user ID.", "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." } } } } } } } } } ````