Syncs your LDAP data based on the data sync configurations. This endpoint requires 2FA.
Make sure LDAP is enabled before using this endpoint.
Permission required: sync-auth-services-users.
Changelog
| Version | Description |
|---|---|
| 9.0.0 | Moved to premium plans. Added the LDAP_Background_Sync_disabled and LDAP_Sync_failed errors. |
| 5.2.0 | Include syncAvatars |
| 4.0.0 | Added |
The authenticated user token.
The authenticated user ID.
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.
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.
OK
{
"message": "Sync_in_progress",
"success": true
}Bad Request
2FA code missing
The request has no valid x-2fa-code and x-2fa-method headers. details.method shows the 2FA method to use.
{
"success": false,
"error": "TOTP Required [totp-required]",
"errorType": "totp-required",
"details": {
"method": "totp",
"codeGenerated": false,
"availableMethods": [
"totp"
]
}
}LDAP is disabled
LDAP is not enabled in the workspace (LDAP_Enable is off).
{
"success": false,
"error": "LDAP_disabled"
}Missing permission
The user doesn't have the sync-auth-services-users permission.
{
"success": false,
"error": "error-not-authorized"
}Background sync is disabled
None of the background sync settings is enabled (LDAP_Background_Sync, LDAP_Background_Sync_Avatars, or LDAP_Background_Sync_ABAC_Attributes with ABAC enabled).
{
"success": false,
"error": "LDAP_Background_Sync_disabled"
}Premium license required
The workspace doesn't have a premium license with the ldap-enterprise module.
{
"success": false,
"error": "This is an enterprise feature [error-action-not-allowed]",
"errorType": "error-action-not-allowed"
}Sync could not run
The sync could not run, for example because the LDAP server is unreachable. details.error contains the cause, for example Timeout.
{
"success": false,
"error": "LDAP_Sync_failed",
"details": {
"error": "Timeout"
}
}The error that stopped the sync. Returned with LDAP_Sync_failed.
Unauthorized
{
"success": false,
"error": "You must be logged in to do this."
}