Links
Comment on page

LDAP SyncNow

Sync LDAP users
Syncs your LDAP data based on the data sync configurations.
URL
Requires Auth
HTTP Method
/api/v1/ldap.syncNow
yes
POST

Headers

Argument
Example
Required
Description
X-User-Id
myuser-name
Required
The authenticated user ID.
X-Auth-Token
myauth-token
Required
Auth token.
x-2fa-code
148750
Required
The 2fa code.

Example Call

curl --location --request POST 'http://localhost:3000/api/v1/ldap.syncNow' \
--header 'x-auth-token: 0ueGH0dyW5ewtemsyiBlrC8pU4yBbRUtReXiglvisoZ' \
--header 'x-user-id: 2tTEqR7ZNMJ4HGGNa' \
--header 'x-2fa-code: 773917'

Example Result

{
"message": "Sync_in_progress",
"success": true
}

Error

Any of the following errors can occur on the endpoint.
  • Authorization: Requires an authentication token for the request to be made.
  • No Permission: This occurs when the authenticated user doesn't have the sync-auth-services-users permission.
  • LDAP Disabled: This occurs when the LDAP connection is disabled.
  • TOTP Required: Requires two-factor authentication for the request to be made.
  • Invalid TOTP: Requires a valid two-factor authentication code.
Authorization
No Permission
LDAP Disabled
TOTP Required
Invalid TOTP
{
"status": "error",
"message": "You must be logged in to do this."
}
{
"success": false,
"error": "error-not-authorized"
}
{
"success": false,
"error": "LDAP_disabled"
}
{
"success": false,
"error": "TOTP Required [totp-required]",
"errorType": "totp-required",
"details": {
"method": "totp",
"codeGenerated": false,
"availableMethods": [
"totp"
]
}
}
{
"success": false,
"error": "TOTP Invalid [totp-invalid]",
"errorType": "totp-invalid",
"details": {
"method": "totp",
"codeGenerated": false
}
}

Change Log

Version
Description
4.0.0
Added
5.2.0
Include syncAvatars on ldap.syncNow
Last modified 2mo ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.