canonical: https://jentic.com/apis/ns1.com/ns1

# NS1 API

The NS1 API (now IBM NS1 Connect) provides programmatic control over managed DNS, traffic management, and connected DNS infrastructure. Thirty-seven endpoints cover DNS zones and records, data sources and feeds for dynamic traffic steering, monitoring jobs and regions, account settings, teams, API keys, usage statistics, and dedicated DNS networks. It is the backbone for ops teams running production-grade DNS with conditional routing, health checks, and observability built in.

## For AI agents

Manage NS1 DNS zones, records, data feeds, monitoring jobs, teams, and API keys through 37 endpoints. Authenticated via X-NSONE-Key header.

## Scope

Does not handle CDN, WAF, certificate issuance, or domain registration - use for managed DNS, traffic steering, and DNS monitoring only.

## Capabilities

- Create, update, and delete DNS zones and individual record sets
- Configure data sources and feeds that drive dynamic traffic-steering answers
- Provision and tune monitoring jobs for endpoint health checks across NS1 regions
- Manage account teams, member roles, and per-key API permissions
- Pull QPS and usage statistics for billing reconciliation and capacity planning
- Inspect dedicated DNS networks and their assigned scopes

## Use cases

### Programmatic DNS Zone and Record Management

Platform teams automate DNS provisioning by calling /zones and `/zones/{zone}/{domain}/{type}` from CI pipelines and infrastructure-as-code tools. Creating a zone, adding records, and rotating values become idempotent steps in a deploy script, eliminating manual portal clicks. NS1's record types support standard A, AAAA, CNAME, MX, and TXT plus answer metadata for traffic steering.

Example prompt: PUT /zones with name=example.com then POST `/zones/example.com/api.example.com/A` with answer 192.0.2.10

### Dynamic Traffic Steering with Data Feeds

NS1's signature capability is using live data feeds to drive answer selection. Operators register data sources and feeds via `/data/sources` and `/data/feeds`, then attach feeds to record answers so DNS responses shift based on latency, health, or custom signals. This use case turns DNS into an active load-balancing layer instead of a static lookup table.

Example prompt: POST `/data/sources` to register a Datadog feed, then POST `/data/sources/{sourceId}/publish` with a metric payload and verify the steered record updates

### Endpoint Health Monitoring

NS1 monitoring jobs run health checks from regional probes and feed results back into traffic steering. Ops teams call `/monitoring/jobs` and `/monitoring/regions` to provision checks, choose probe regions, and inspect outage histories. Combining jobs with data feeds gives self-healing DNS that pulls bad endpoints out automatically.

Example prompt: POST `/monitoring/jobs` with type=tcp, host=api.example.com, port=443 and configure regions=us-east, eu-west

### AI Agent DNS Operations via Jentic

SRE-focused AI agents use Jentic to run NS1 operations safely without holding the X-NSONE-Key in their context. The agent searches for the operation, loads the schema, and executes with credentials injected at request time, so it can rotate records or pause monitoring jobs in response to alerts.

Example prompt: Use Jentic to search 'add NS1 A record', load `/zones/{zone}/{domain}/{type}`, and execute with the record values

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/zones` | List all DNS zones on the account |
| PUT | `/zones/{zone}` | Create or update a DNS zone |
| POST | `/zones/{zone}/{domain}/{type}` | Create a DNS record under a zone |
| GET | `/monitoring/jobs` | List monitoring jobs and their statuses |
| POST | `/data/sources` | Register a data source for traffic steering |
| POST | `/data/sources/{sourceId}/publish` | Publish data into a registered source |
| GET | `/account/apikeys` | List account API keys and permissions |
| GET | `/stats/qps` | Retrieve queries-per-second statistics |

## Key resources

- **Zones** — DNS zone create, list, update, delete operations
- **Records** — Per-record management under each zone
- **Data Sources & Feeds** — Live data inputs that drive dynamic traffic-steering answers
- **Monitoring** — Health-check jobs and probe region configuration
- **Account & Teams** — Account settings, teams, and per-key permissions
- **Stats** — QPS and usage statistics for billing and capacity planning
- **Networks** — Dedicated DNS networks and their assigned scopes

## Why Jentic

- **Setup:** Wiring the NS1 API by hand means passing your key in the X-NSONE-Key header on every call to api.nsone.net and mapping zones, records, monitoring jobs, and data sources yourself. Through Jentic you install once, import the NS1 API from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** NS1 puts the zone in the URL path (`/zones/{zone}/{domain}/{type}`), so a rule can pin your agent to one zone and nothing else. You choose the operations it may call, so record creation and data-source publishing are not included unless you add them.
- **Credential handling:** Your NS1 API key is stored once, encrypted, by your own Jentic One instance and injected as the X-NSONE-Key header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'add an NS1 A record' or 'create a DNS monitoring job', and Jentic returns the matching /zones, `/monitoring/jobs`, or `/data/sources` operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cloudflare** — Managed DNS plus CDN, WAF, and edge compute
- **DigitalOcean** — Cloud compute and infrastructure provider with its own DNS service
- **Google APIs** — Google Cloud DNS and identity APIs that often coexist with NS1

## FAQ

### What authentication does the NS1 API use?

The NS1 API uses an API key passed in the X-NSONE-Key request header. Keys are scoped via `/account/apikeys` and can be restricted per resource. Through Jentic, NS1 keys live encrypted in the vault and the X-NSONE-Key header is injected at execution time so the raw key never appears in agent prompts.

### Can I create DNS records programmatically with the NS1 API?

Yes. POST `/zones/{zone}/{domain}/{type}` creates a record under an existing zone, where {type} is the record type (A, AAAA, CNAME, MX, TXT, etc.). PUT against the same path updates an existing record.

### What are the rate limits for the NS1 API?

NS1 publishes per-account API rate limits at https://ns1.com/api; limits depend on plan tier. The API returns a 429 with retry-after when an account exceeds its allotment, so clients should implement exponential backoff.

### How do I set up traffic steering through Jentic?

Search Jentic for 'NS1 traffic steering data feed', load `/data/sources` and `/data/sources/{sourceId}/publish`, and execute the pair to register a source and push values into it. The flow is pip install jentic, then await client.search, load, and execute.

### Is the NS1 API free?

NS1 (IBM NS1 Connect) is a paid service with usage-based DNS query and feature pricing. The API itself has no separate fee but usage counts against the plan; current pricing is on the NS1 website.

### Which DNS record types does the NS1 API support?

Standard record types A, AAAA, CNAME, MX, TXT, NS, SRV, and others are supported via the `/zones/{zone}/{domain}/{type}` path, with the {type} segment selecting the record type. NS1 also supports answer metadata that drives geo, latency, and weighted steering.

### Can I limit what my agent is allowed to do with the NS1 API?

Yes. Because you run Jentic One yourself, your own rules decide which NS1 operations and credentials the agent may use. NS1 puts the zone in the URL path (`/zones/{zone}/{domain}/{type}`), so a rule can pin the agent to a single zone and nothing else. You also choose the exact operations it can call, so record creation via POST `/zones/{zone}/{domain}/{type}` or data-source publishing via POST `/data/sources` are excluded unless you explicitly allow them.
