Create Whitelist Entries for One Organization API Key¶
Create one or more new whitelist entries for the specified API Key.
All requests to this endpoint must originate from an IP address in the organization's API access list.
Base URL: https://cloud.mongodb.com/api/atlas/v1.0
Resource¶
POST /orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/whitelist
Request Path Parameters¶
Name | Type | Description |
---|---|---|
ORG-ID | string | Unique identifier for the organization to which the target API Key belongs. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access. |
API-KEY-ID | string | Unique identifier for the Organization API Key for which you want to create a new whitelist entry. |
Request Query Parameters¶
This endpoint may use any of the HTTP request query parameters available to all Atlas API resources. These are all optional.
Name | Type | Necessity | Description | Default | ||||
---|---|---|---|---|---|---|---|---|
pageNum | integer | Optional | Page number (1-based). | 1 | ||||
itemsPerPage | integer | Optional | Maximum number of items to return, up to a maximum of 100. | 100 | ||||
includeCount | boolean | Optional | Specifies whether the response returns the totalCount field. | true | ||||
pretty | boolean | Optional | Indicates 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. Some API clients cannot access the HTTP response headers or
status code. To remediate this, set For endpoints that return one result, the response body includes:
For endpoints that return a list of results, the results object is an envelope. Atlas adds the status field to the response body. | false |
Request Body Parameters¶
Specify an array of documents, where each document represents one whitelist entry you want to add to the project. You must specify an array even if you are only associating a single whitelist entry to the project.
When you submit a POST
request containing ipAddress
or
cidrBlock
values which are not already present in the whitelist,
Atlas adds those entries to the list of existing entries in the
whitelist. Atlas does not set the whitelist to only contain the
entries specified in the request.
Atlas supports up to 500 API Keys within a single organization.
In the following table, [i]
represents an array index.
Name | Type | Description |
---|---|---|
[i].ipAddress | string | IP address to be added to the whitelist for the
API key. This field is mutually exclusive with the
cidrBlock field. |
[i].cidrBlock | string | Whitelist entry in CIDR notation to be added for the
API key. This field is mutually exclusive with the
ipAddress field. |
Response¶
Response Document¶
The response JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.
Name | Type | Description |
---|---|---|
results | array of objects | One object for each item detailed in the results Embedded Document section. |
links | array of objects | One or more links to sub-resources and/or related resources. The relations between URL |