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

Get One Replica Set Re-Election Job

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 retrieve a single re-election job by its unique identifier. Poll this endpoint until the job reaches a terminal status.

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

GET /groups/{GROUP-ID}/replicaSets/{RS-ID}/reElectionJobs/{REELECTION-JOB-ID}

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.

RS-ID

string

Required

Name of the replica set that contains the re-election job.

REELECTION-JOB-ID

string

Required

Unique 24-hexadecimal digit string that identifies the re-election job, as returned by the step down or step up endpoint.

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.

The response returns a single re-election job.

Name
Type
Description

id

string

Unique 24-hexadecimal digit string that identifies the re-election job.

groupId

string

Unique 24-hexadecimal digit string that identifies the project.

action

string

Action that this job performs. Returns one of the following values: STEP_DOWN or STEP_UP.

replicaSetName

string

Name of the target replica set.

hostname

string

Hostname of the target process.

port

integer

Port of the target process.

status

string

Status of the job. Returns one of the following values: QUEUED, RUNNING, COMPLETED, FAILED, or EXPIRED.

noOp

boolean

Flag that indicates whether the operation completed as a no-op.

message

string

Human-readable detail about the job. Ops Manager populates this field after the agent reports a result.

created

string

Timestamp, in ISO 8601 UTC format, when Ops Manager created the job.

lastUpdated

string

Timestamp, in ISO 8601 UTC format, when Ops Manager last updated the job.

expires

string

Timestamp, in ISO 8601 UTC format, after which an Automation Agent no longer picks up this job.

Status
Terminal
Meaning

QUEUED

No

Ops Manager created the job. It is waiting for the target host's Automation Agent to pick it up.

RUNNING

No

The agent is running the job.

COMPLETED

Yes

The operation finished. Check noOp to determine whether the operation made a change.

FAILED

Yes

The operation could not complete. See message for the reason.

EXPIRED

Yes

No agent picked up the job before expiresAfterSeconds elapsed.

1curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \
2 --header "Accept: application/json" \
3 --include \
4 --request GET "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/replicaSets/{RS-ID}/reElectionJobs/{REELECTION-JOB-ID}?pretty=true"
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
1{
2 "id": "665a1234567890abcdef1234",
3 "groupId": "5c8100bcf2a30b12ff88258f",
4 "action": "STEP_UP",
5 "replicaSetName": "rs0",
6 "hostname": "node2.example.com",
7 "port": 27017,
8 "status": "COMPLETED",
9 "noOp": false,
10 "message": null,
11 "created": "2026-08-11T05:37:59Z",
12 "lastUpdated": "2026-08-11T05:38:45Z",
13 "expires": "2026-08-11T05:39:59Z"
14}
HTTP Status
Error Code
Description

200

--

Returns the re-election job document.

401

USER_UNAUTHORIZED

The API key does not have the Project Automation Admin role.

404

REELECTION_JOB_NOT_FOUND

REELECTION-JOB-ID is unknown or malformed, or the job does not belong to the replica set named in RS-ID.