- API >
- API Resources >
- Personal API Keys (Deprecated) >
- Personal API Key Whitelist
Personal API Key Whitelist¶
On this page
Note
Groups and projects are synonymous terms. Your {GROUP-ID}
is the
same as your project ID. For existing groups, your group/project ID
remains the same. The resource and corresponding endpoints use the
term groups
.
Important
Personal API keys are deprecated, use Programmatic API Keys instead.
The /users/USER-ID/whitelist
resource retrieves and updates your API
whitelist. If you have the Owner
role, you
can perform whitelisted API operations from the IP addresses you have added to
this list.
The resource’s POST
and DELETE
operations are themselves whitelisted.
They must originate from an address already on your API whitelist.
You can access the API whitelist only for the current user. The username and API key you use to authenticate must be those of the user identified in the endpoint. The endpoint identifies the user by user ID. To retrieve user IDs, see Get All Users in One Project.
Note
The /users/USER-ID/whitelist
resource should not be confused with the
/groups/GROUP-ID/whitelist
resource, which controls client access to
the project’s MongoDB clusters.
Endpoints¶
Get the API Whitelist for the Current User¶
Get the API Whitelist Entry for a Specified Address or CIDR Block¶
The following retrieves the whitelist entry that contains an ipAddress
value that matches IP-ADDRESS
.
The following retrieves the whitelist entry that contains a cidrBlock
value that matches CIDR-BLOCK
. Replace the forward slash (/
) in the
CIDR-notated address range with %2F
. For example, specify 1.2.3.4%2F16
for 1.2.3.4/16
.
Add Entries to the User’s API Whitelist¶
The entity body must be an array of objects, even if it contains only one
object. Each object should specify either the cidrBlock
field or
ipAddress
field, but not both.
If an address is already in the whitelist, it will be ignored.
If you specify a single IP address with the /32
subnet mask, Atlas does not
store the /32
, as the /32
does not change the address. For example, an
address of 12.34.56.78
is the same as 12.34.56.78/32
.
Delete an Entry from the User’s API Whitelist¶
You cannot remove your current IP address from the whitelist.
Sample Entity¶
Entity Fields¶
Name | Type | Description |
---|---|---|
cidrBlock |
string | A CIDR-notated range of IP addresses. |
created |
date | The date this IP address was added to the whitelist. |
ipAddress |
string | A whitelisted IP address. |
lastUsed |
date | The date of the most recent request that originated from this IP address. Note that this field is only updated when a resource that is protected by the whitelist is accessed. |
lastUsedAddress |
string | The last call to the API was issued from this address. |
count |
integer | The total number of requests that originated from this IP address. Note that this field is only updated when a resource that is protected by the whitelist is accessed. |
Links¶
Relation | Description |
---|---|
self |
Me |
http://mms.mongodb.com/user |
The user that owns this whitelist. |