For AI agents: a documentation index is available at https://www.mongodb.com/zh-cn/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

Resync a Process with the Public API

Note

Groups and projects are synonymous terms. Your {PROJECT-ID} is the same as your project ID. For existing groups, your group/project ID remains the same. This page uses the more familiar term group when referring to descriptions. The endpoint remains as stated in the document.

Use this endpoint to trigger an initial sync on a replica set member. Ops Manager sets lastResync for the process in the automation configuration and publishes the change. Use resync to recover a member stuck in RECOVERING because it fell behind the oplog window.

To ensure successful execution, restrict resync requests to secondary members of a replica set. Each replica set is limited to one concurrent resync, which is considered active until the deployment reaches goal state. Avoid requesting a resync on the primary member: the Automation Agent doesn't execute it, and the request requires manual intervention.

The request is asynchronous: 200 OK means Ops Manager published the change, not that the resync has finished. Poll the automation status resource until the plan completes, then poll v2.0 Get One Host by ID until replicaStateName is SECONDARY. An initial sync can take a long time on large data sets.

Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0

POST /groups/{GROUP-ID}/process/{HOST-PORT}:resync

The API key that makes this request must have the Project Automation Admin role.

Name
Type
Necessity
Description

GROUP-ID

string

Required

Unique 24-hexadecimal digit string that identifies your project.

HOST-PORT

string

Required

Target process, as hostname:port. For example, node1.example.com:27017.

Name
Type
Necessity
Description
Default

dryRun

boolean

Optional

If true, Ops Manager validates the request and returns the changed process without publishing it or adding an activity feed event. Ops Manager rejects any value other than true or false with 400 INVALID_QUERY_PARAMETER.

false

The following query parameters are optional:

Name
Type
Necessity
Description
Default

pretty

boolean

Optional

Flag indicating whether the response body is in a prettyprint format.

false

envelope

boolean

Optional

Flag that indicates whether to wrap the response in an envelope.

Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

For endpoints that return one result, the response body includes:

  • status: HTTP response code

  • content: Expected response body

false

This endpoint doesn't use HTTP request body parameters.

Ops Manager returns 200 OK and the target process as it appears in the automation configuration, with the change applied. lastResync is set. The body is the same whether you set dryRun or not.

Name
Type
Description

name

string

Name of the process in the automation configuration.

hostname

string

Hostname of the process.

processType

string

Type of process, for example mongod.

version

string

MongoDB version of the process.

disabled

boolean

true if the process is shut down.

lastRestart

string

Timestamp, in ISO 8601 UTC format, of the last requested restart.

lastResync

string

Timestamp, in ISO 8601 UTC format, of the last requested resync.

The document also contains the rest of the process's automation configuration, such as args2_6, featureCompatibilityVersion, and authSchemaVersion. See the Automation Configuration reference.

The following example triggers an initial sync on the process running on node1.example.com:27017.

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request POST "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/process/node1.example.com:27017:resync?pretty=true"
HTTP/1.1 401 UnauthorizedContent-Type: application/json;charset=ISO-8859-1Date: {dateInUnixFormat}WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=falseContent-Length: {requestLengthInBytes}Connection: keep-alive
HTTP/1.1 200 OKVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
{ "name": "rs0_1", "processType": "mongod", "version": "8.0.4", "hostname": "node1.example.com", "disabled": false, "lastResync": "2026-10-06T09:15:20Z", "authSchemaVersion": 5, "featureCompatibilityVersion": "8.0", "args2_6": { "net": { "port": 27017 }, "replication": { "replSetName": "rs0" }, "storage": { "dbPath": "/data/rs0_1" }, "systemLog": { "destination": "file", "path": "/data/rs0_1/mongodb.log" } }}
HTTP Status
Error Code
Description

200

--

The change was published, or computed with dryRun=true. Returns the process document.

400

PROCESS_RESYNC_NOT_SUPPORTED

The target is a mongos, a standalone, or an arbiter. Only data-bearing replica set members can be resynced.

409

PROCESS_RESYNC_IN_PROGRESS

Another resync is already outstanding for the target's replica set.

409

PROCESS_AGENT_NOT_REPORTING

The target host's Automation Agent has never reported to Ops Manager.

409

GROUP_IN_RESTORATION_MODE

The project is reconciling after a restore.

403

PROCESS_EXTERNALLY_MANAGED

The project's processes are managed by an external system.

409

AUTOMATION_CONFIG_DRAFT_ALREADY_EXISTS

You have an unpublished automation configuration draft in the project.

404

PROCESS_NOT_FOUND

HOST-PORT doesn't match a process in the project's automation configuration.

400

INVALID_QUERY_PARAMETER

dryRun isn't true or false.

409

AUTOMATION_CONFIG_CONCURRENT_MODIFICATION

Someone published a change while this request was in progress. Ops Manager returns this code only for a real request.

Ops Manager checks the shared errors in the order listed. See Process Lifecycle for prerequisites and limitations.