Installs a signed license key file in an Ops Manager installation to add coverage after you generate a license key in the Key Portal. If Ops Manager accepts the license key, it recalculates the license key status and returns it, and records a License installed audit event.
Required Roles
To access this resource, your API key must have the Global Owner role. The Global Owner role is the highest role in Ops Manager. Only users with this role can view and manage license keys.
Request
Send a PUT request with the license key file contents as the body.
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
PUT /admin/licensesRequest Path Parameters
This endpoint doesn't use HTTP request path parameters.
Request Query Parameters
This endpoint accepts the following query parameters:
Name | Type | Necessity | Description | Default |
|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating whether the response body is in a prettyprint format. |
|
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:
|
|
Request Body Parameters
Send the contents of the license key file as the request body. Set the Content-Type header to application/json. The endpoint doesn't use named body parameters.
Response
If Ops Manager accepts the license key, the response contains the recalculated license key status. The response contains the following fields:
Field | Type | Description |
|---|---|---|
| object | Aggregated license key status of the Ops Manager installation. This field is |
| string | License key state of the installation. Ops Manager returns one of |
| string | Identifies what produced the |
| boolean | Indicates whether the state is |
| object | Next scheduled change to the license key state. This field is |
| string | Evaluator that drives the next change. |
| string | Date and time when the current state ends. |
| string | State that follows the current state. |
| array of objects | Warnings that are open. Ops Manager opens a renewal warning before your order end date. To learn more, see Ops Manager License Keys Overview. |
| string | Evaluator that raised the warning. |
| string | Date and time when the warning opened. |
| array of objects | Subjects that the warning covers. Each object contains an |
| array of objects | Contribution of each evaluator to the |
| string | Evaluator that produced the verdict. |
| string | State that the evaluator calculated. |
| string | Date and time when the breach takes effect, such as the order end date. This date is in the future while the state is |
| string | Date and time when the renewal warning window opens. This field is |
| object | Details that are specific to the evaluator. This field is |
| object | Next change to the verdict state. The object contains |
| array of objects | License keys that are installed on the Ops Manager installation. |
| string | Unique identifier of the license key. Use this value to release the license key. The Ops Manager interface shows this value as the license key ID. |
| boolean | Indicates whether Ops Manager can use the license key for coverage. |
| string | Date and time when MongoDB generated the license key. |
| string | Date and time when the license key was installed. |
| string | Status of the license key. Ops Manager returns one of |
| string | Reason code for a |
| string | Sentence that describes why the license key is |
| string | Date and time when the coverage of the license key ends. This field is |
| array of objects | Grants that the license key contains. For a |
| string | Type of the grant, such as |
| string | Identifier of the grant. This field is |
| string | Date and time when the grant starts. |
| string | Date and time when the grant ends. |
| array of objects | Entitlements that the grant carries. Each object uses the fields described for |
| object | Entitlements that are active now, grouped by entitlement type. Each key is an entitlement type, such as |
| string | Entitlement type. |
| string | Product name that the entitlement applies to. This field is |
| boolean | Indicates whether the entitlement is in effect. |
| object | Validity window of the entitlement. The object contains |
Errors
If Ops Manager rejects the license key, the response has the HTTP status from the following table. The errorCode field of the response body contains the error code, and the detail field contains the message.
The messages use the word artifact to refer to a license key.
Error Code | HTTP Status | Message |
|---|---|---|
| 400 | This file could not be read. It may be corrupted or was modified after signing. Contact your MongoDB account team to obtain a replacement. |
| 400 | This file cannot be verified - it may have been modified after signing. Contact your MongoDB account team to obtain a replacement. |
| 400 | This file was signed for a different version of Ops Manager or by an untrusted key. Contact your MongoDB account team for a compatible file. |
| 400 | This file's signing certificate is not valid for this Ops Manager. Contact your MongoDB account team to obtain a replacement. |
| 403 | This artifact is bound to specific Ops Manager instances and cannot be installed on this one. Contact your MongoDB account team. |
| 409 | This artifact is not newer than one already installed on this Ops Manager. Install the latest artifact issued by your MongoDB account team. |
Example Request
Use curl to send a PUT request to the /admin/licenses endpoint:
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --include \ --request PUT \ "https://<OpsManagerHost>:<Port>/api/public/v1.0/admin/licenses?pretty=true" \ --data @{LICENSE-KEY-FILE}Example Response
The following examples show the response headers and the response body of a successful request.
Response Header
The following headers show an unauthorized response and a successful response:
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-aliveHTTP/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}Response Body
The following example shows the response body:
{ "enforcement": { "effectiveState": "LICENSED", "cause": "term:LICENSED", "enforced": false, "transition": { "evaluatorId": "term", "inStateUntil": "2027-06-30T00:00:00Z", "nextState": "GRACE" }, "warnings": [], "verdicts": [ { "evaluatorId": "term", "state": "LICENSED", "breachAt": "2027-06-30T00:00:00Z", "warningStart": "2027-02-28T00:00:00Z", "metadata": null, "transition": { "inStateUntil": "2027-06-30T00:00:00Z", "nextState": "GRACE" } } ] }, "licenses": [ { "artifactId": "{ARTIFACT-ID}", "usable": true, "generatedAt": "2026-10-01T12:00:00Z", "installedAt": "2026-11-04T15:30:00Z", "status": "ACTIVE", "statusCause": null, "statusReason": null, "termEnd": "2027-06-30T00:00:00Z", "grants": [ { "grantType": "contract", "grantId": "{GRANT-ID}", "startDate": "2026-07-01T00:00:00Z", "endDate": "2027-06-30T00:00:00Z", "entitlements": [] } ] } ], "activeEntitlements": {}}Example Error Response
The following example shows the response body when Ops Manager rejects the license key:
{ "error": 409, "reason": "Conflict", "detail": "This artifact is not newer than one already installed on this Ops Manager. Install the latest artifact issued by your MongoDB account team.", "errorCode": "ARTIFACT_OUTDATED", "parameters": []}