LDAP Sync

Prev Next
Post
/api/v1/ldap.syncNow
Premium tag

Syncs your LDAP data based on the data sync configurations. This endpoint requires 2FA.

Make sure LDAP is enabled in Manage → Workspace → Settings → LDAP → Enable before using this endpoint.

Permission required: sync-auth-services-users.

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. Returns 403 with errorType: error-forbidden instead of 400 when refused.
5.2.0 Include syncAvatars
4.0.0 Added
Header parameters
X-Auth-Token
stringRequired

The authenticated user token.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The authenticated user ID.

ExamplerbAXPnMktTFbNpwtJ
x-2fa-code
string

Enter the 2FA code. This parameter is required if 2FA is enabled in your workspace. See the Introduction to Two-Factor Authentication document for details.

Example148750
x-2fa-method
string

Enter the method with which you get the 2FA code. It can be email, totp, or password. This parameter is required if 2FA is enabled in your workspace.

Responses
200

OK

Success Example
{
  "message": "Sync_in_progress",
  "success": true
}
object
message
string
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "TOTP Required [totp-required]",
  "errorType": "totp-required",
  "details": {
    "method": "totp",
    "codeGenerated": false,
    "availableMethods": [
      "totp"
    ]
  }
}
Example 2
{
  "success": false,
  "error": "LDAP_disabled"
}
Not available on Community workspaces
{
  "success": false,
  "error": "This is an enterprise feature [error-action-not-allowed]",
  "errorType": "error-action-not-allowed"
}
Expand All
object
success
boolean
error
string
errorType
string
details
object
method
string
codeGenerated
boolean
availableMethods
Array of string
string
401

Unauthorized

Authorization Error
{
  "success": false,
  "error": "You must be logged in to do this."
}
object
success
boolean
error
string
403

Forbidden

Example 3
{
  "success": false,
  "error": "error-not-authorized",
  "errorType": "error-forbidden"
}
object
success
boolean
error
string
errorType
string
Tags