The NS1 platform is built using an API-first architecture, providing users who prefer to work programmatically with the necessary tools to manage resources easily and optimize network configuration. The NS1 API is a standard REST API with JSON responses.
For a full index of API endpoints, refer to NS1's API documentation (https://ns1.com/api).
The HTTP method you use — GET, PUT, POST, or DELETE — determines the type of action to be taken by the API. Generally, in the case of PUT and POST requests, you will send a JSON body in the request with details about the resource you're creating or updating.
GET - This method requests a representation of the specified resource. Requests using GET retrieve some specified data set. Using the NS1 API, common GET requests include:
PUT - This method submits an entity to the specified resource — typically, creating a new object. Using the NS1 API, common PUT requests include:
POST - This method replaces all current representations of the target resource with the request payload. In other words, it edits or updates an existing resource. Some POST method request examples include:
DELETE - This method deletes the specified resource, for example:
The NS1 API uses API keys to authenticate requests. You can create your first API key within the NS1 portal (http://my.nsone.net) with the desired permissions. Refer to "Managing API keys" for details.
We strongly recommend that you save your API keys securely so not to expose the key secret. Also, we recommend enabling only the required permissions on each API key based on its intended application.
The API authentication header is represented in the API documentation by
"X-NSONE-Key: $NSONE_API_KEY" where
$NSONE_API_KEY is replaced by a valid NS1 API key secret. We recommend adding the API key as one of your environment variables to make it easier to copy and paste code snippets.
NS1 API requests must be made over HTTPS. Unauthenticated API calls, as well as those made over plain HTTP, will fail.