Skip to main content

Add To Whitelist API

POST /addToWhitelist

Description

This API endpoint allows adding an IP address to a whitelist. The whitelist is used to permit specific IP addresses to access certain resources.

Request Body

The request utilizes GraphQL to perform the addToWhitelist mutation.

Mutation:

mutation addToWhitelist ($ipAddress: String!) {
addToWhitelist (ipAddress: $ipAddress) {
id
ipAddress
}
}

Variables:

{
"ipAddress": "<IP_Address>"
}
  • ipAddress (String): The IP address to be added to the whitelist.

Response:

  • Success (200 OK):

    • The response includes details of the added IP address with its assigned ID.
    {
    "data": {
    "addToWhitelist": {
    "id": "<ID>",
    "ipAddress": "<IP_Address>"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with adding the IP address, such as it already being in the whitelist or server errors, the response will include an appropriate error message and status code.

Note:

Make sure that the IP address format is valid before making the request. The response will confirm if the IP address was successfully added to the whitelist.