Revoke Service Account Token
On this page
Cloud Manager will no longer support Automation, Backup, and Monitoring for MongoDB 3.6 and 4.0 after August 30th, 2024. Please upgrade your MongoDB deployment or migrate to Atlas.
- OAuth 2.0 authentication for programmatic access to Cloud Manager is available as a Preview feature.
- The feature and the corresponding documentation might change at any time during the Preview period. To use OAuth 2.0 authentication, create a service account to use in your requests to the Cloud Manager Public API.
Resource
POST https://cloud.mongodb.com/api/oauth/revoke
Request Path Parameters
This endpoint doesn't use HTTP request path parameters.
Request Query Parameters
The following query parameters are optional:
Name | Type | Necessity | Description | Default |
---|---|---|---|---|
pretty | boolean | Optional | Flag that indicates whether the response body should be in a
prettyprint format. | false |
envelope | boolean | Optional | Flag that indicates whether or not to wrap the response in an envelope. Some API clients cannot access the HTTP response headers or
status code. To remediate this, set For endpoints that return a list of results, the | false |
backupJobsEnabledOnly | boolean | Optional | Flag indicating whether to exclude daemons not enabled for
backing up databases from the response. Set this to false to
include daemon configurations with the backupJobsEnabled
flag set to false . | true |
Request Body Parameters
All body parameters are required.
Name | Type | Description |
---|---|---|
TOKEN | string | The access token that you want to revoke. To learn more, see Generate Service Account Token. |
Response
Example Request
Replace {BASE64-AUTH}
in the following example with your base64-encoded service account client ID and secret. To learn more, see Make an API Request.
curl -X POST https://cloud.mongodb.com/api/oauth/revoke \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Authorization: Basic {BASE64-AUTH}" \ -d "token={TOKEN}&token_type_hint=access_token"
Example Response
Response Header
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}
400 Bad Request Date: {dateInUnixFormat} Content-Type: application/json Content-Length: {requestLengthInBytes} Server: mdbws Strict-Transport-Security: max-age=31536000; includeSubdomains; X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion} ...
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
403 Forbidden 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} ...
429 Too Many Requests Retry-After: {retryAfterValue} 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} ...
500 Internal Server Error Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion} ...
503 Service Unavailable Retry-After: {retryAfterValue} Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion} ...
Response Body
This endpoint doesn't return a response body.
{ "error_description": "The provided credentials are not valid.", "error": "invalid_request" }
{ "error_description": "Invalid grant type.", "error": "unsupported_grant_type" }
{ "error_description": "Invalid grant.", "error": "invalid_grant" }
{ "error_description": "Invalid credentials provided.", "error": "invalid_client" }
{ "error_description": "IP access list validation failed for the service account.", "error": "access_denied" }
{ "error_description": "Resource {URL} is limited to 10 requests every 1 minutes.", "error": "rate_limited" }
{ "error_description": "Unexpected error.", "error": "server_error" }