Skip to content

Run the directory sync now (admin-only)

POST
/api/admin/ldap/sync
curl --request POST \
--url https://example.com/api/admin/ldap/sync \
--header 'Content-Type: application/json' \
--header 'X-Ssoossh-Key-Secret: <X-Ssoossh-Key-Secret>' \
--data '{}'

Runs the same pass the scheduler runs, on this instance, and returns what it concluded. One at a time: a pass already in progress makes this a 409 rather than stacking a second one over the same users. With dry_run the pass reads the directory and changes nothing, reporting the disables and re-enables it would have performed — which is what makes it safe to press during an incident.

With nss.enabled on, a pass that is not a dry run also runs the NSS directory’s full sync on this instance afterwards and reports it under nss: the POSIX accounts and groups the filters select, with each group’s members limited to the accounts stored. The NSS sync has no dry run.

Sync options

Media typeapplication/json
One of:
object

Example generated

{}

What the pass concluded

Media typeapplication/json

LastRun is the most recent pass on any instance, absent when none has ever run.

object
actor_username

ActorUsername is the admin who triggered it, absent for a scheduled pass. The username rather than the id, since it is displayed.

string
disabled
integer
dry_run
boolean
error

Error is why the pass could not run — an unreachable directory, a failed bind. Empty for a pass that completed, whatever it concluded about individual users.

string
failed
integer
finished_at

FinishedAt is absent while the pass runs, which is also how a pass that died with its process reads afterwards.

string
found
integer
id
required
string
instance

Instance is the host that ran it. Jobs are not leader-elected, so every instance runs its own pass and this says whose log to read.

string
missing
integer
nss

NSS is what the NSS directory’s full sync concluded when an admin ran this pass by hand with nss.enabled on: POST /api/admin/ldap/sync runs both, except on a dry run. Absent otherwise, and on every scheduled pass, which the NSS sync does not ride on.

object
accounts
required
object
created
required
integer
failed
required

Failed is the entries that could not be checked or written.

integer
missing
required

Missing is the rows marked missing for the first time; Tombstoned the rows missing for nss.tombstone_after and now deleted.

integer
refused
required

Refused is the new entries not stored because another row, a tombstone included, holds their number or name.

integer
seen
required

Seen is the entries the directory returned.

integer
skipped
required

Skipped is the entries rejected because a value did not parse (a name the POSIX rules refuse, a uid that is not a number, a relative home); each is logged with its DN.

integer
tombstoned
required
integer
updated
required
integer
error

Error is why the run stopped short: the directory could not be reached or searched, or another run was in progress on this instance. Nothing is marked missing by a run that stopped short.

string
finished_at

FinishedAt is absent when the run stopped on an error.

string
full
required

Full is true for a full run, which is the only kind that marks entries missing; the admin trigger always runs one.

boolean
groups
required
object
created
required
integer
failed
required

Failed is the entries that could not be checked or written.

integer
missing
required

Missing is the rows marked missing for the first time; Tombstoned the rows missing for nss.tombstone_after and now deleted.

integer
refused
required

Refused is the new entries not stored because another row, a tombstone included, holds their number or name.

integer
seen
required

Seen is the entries the directory returned.

integer
skipped
required

Skipped is the entries rejected because a value did not parse (a name the POSIX rules refuse, a uid that is not a number, a relative home); each is logged with its DN.

integer
tombstoned
required
integer
updated
required
integer
started_at
required
string
reenabled
integer
started_at
required
string
trigger
required

Trigger is “schedule” or “manual”.

string
users_seen
integer

Example generated

{
"actor_username": "example",
"disabled": 1,
"dry_run": true,
"error": "example",
"failed": 1,
"finished_at": "example",
"found": 1,
"id": "example",
"instance": "example",
"missing": 1,
"nss": {
"accounts": {
"created": 1,
"failed": 1,
"missing": 1,
"refused": 1,
"seen": 1,
"skipped": 1,
"tombstoned": 1,
"updated": 1
},
"error": "example",
"finished_at": "example",
"full": true,
"groups": {
"created": 1,
"failed": 1,
"missing": 1,
"refused": 1,
"seen": 1,
"skipped": 1,
"tombstoned": 1,
"updated": 1
},
"started_at": "example"
},
"reenabled": 1,
"started_at": "example",
"trigger": "example",
"users_seen": 1
}

Invalid request body

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

Not authenticated

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

Not authorized as admin

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

A sync is already running

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

The directory could not be reached

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}