Delete a User API Key¶
- You can't create new Personal API Keys.
- You can't access the API using your existing Personal API Keys starting March 1, 2021.
- You must update any existing scripts or tools to use Programmatic API Keys instead.
The Atlas API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request.
To learn how to configure API access for an Atlas project, see Configure Atlas API Access.
https://cloud.mongodb.com/api/atlas/v1.0
Use this endpoint to delete a user's API key. You must be the user specified in the digest authentication to successfully use this endpoint.
Resource¶
DELETE /users/{USER-ID}/keys/{KEY-ID}
Request Parameters¶
Request Path Parameters¶
Path Element | Required/Optional | Description |
---|---|---|
USER-ID | Required. | The unique identifier for your database user. Specify the value
of the id field for the desired user in the response body of
the /orgs/{ORG-ID}/users
endpoint. |
KEY-ID | Required | The unique identifier for the user API key that you want to delete.
Specify the value of the id field for the desired key in the
response body of the users/{USER-ID}/keys endpoint. |
Request Query Parameters¶
This endpoint might use any of the HTTP request query parameters available to all Atlas API resources. All of these are optional.
Name | Type | Necessity | Description | Default | ||||||
---|---|---|---|---|---|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating whether the response body should be in a
prettyprint format. | false | ||||||
envelope | boolean | Optional | Flag indicating if Atlas should wrap the response in a JSON envelope. This option may be needed for some API clients. These 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:
| false |
Request Body Parameters¶
This endpoint does not use HTTP request body parameters.
Response¶
This endpoint returns an empty JSON document.
Example Request¶
The following example disables a user API key:
curl -X DELETE --digest -i -u "{PUBLIC-KEY}:{PRIVATE-KEY}" \ "https://cloud.mongodb.com/api/atlas/v1.0/users/{USER-ID}/keys/{KEY-ID}"
Example Response¶
This endpoint does not return a response body.