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, starting with one, that Atlas returns of the
total number of objects. | 1 |
itemsPerPage | integer | Optional | Number of items that Atlas returns per page, up to a maximum
of 500. | 100 |
includeCount | boolean | Optional | Flag that indicates whether Atlas returns the totalCount
parameter in the response body. | true |
pretty | boolean | Optional | Flag that indicates whether Atlas returns the JSON
response in the
prettyprint format. | false |
envelope | boolean | Optional | Flag that indicates whether Atlas wraps the response in an envelope. Some API clients cannot access the HTTP response headers or
status code. To remediate this, set Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter 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 |