canonical: https://jentic.com/apis/netbox.dev/netbox-api

# NetBox API

Jentic publishes the only available OpenAPI specification for NetBox API, keeping it validated and agent-ready. NetBox is the open-source source-of-truth platform for network and data centre infrastructure: device inventory, IP address management, VLANs, circuits, racks, cables, and tenancy modelled in one queryable system. The 844 endpoints under this YAML-sourced import cover every NetBox model, so an automation pipeline can read inventory, allocate IPs, register devices, and inspect circuit terminations as part of a wider change workflow.

## For AI agents

Read and write infrastructure source-of-truth data in NetBox: devices, IPs, VLANs, circuits, racks, sites, and tenancy.

## Scope

Does not handle device configuration push, network monitoring, or DHCP issuance - use as a source-of-truth read and write API for network and data centre inventory only.

## Capabilities

- Allocate, reserve, and release IP addresses and prefixes through the IPAM endpoints
- Inventory devices, racks, modules, and cables across one or many sites
- Manage circuits and circuit terminations from upstream providers
- Track VLANs, VLAN groups, and routing prefixes per site or tenant
- Read and write tenancy data so each tenant's infrastructure is scoped
- Use brief=true filters to keep list payloads small on large NetBox installs

## Use cases

### Automated IP Allocation

Network engineering teams call `/ipam/prefixes` to pull the next available address when provisioning a device, then write it to `/ipam/ip-addresses` with the assigned object reference. The pattern replaces a shared spreadsheet with a queryable source of truth and keeps Terraform or Ansible runs idempotent.

Example prompt: Reserve the next available /32 from prefix 10.20.0.0/24 in NetBox and assign it to interface eth0 of device r1-edge.

### Device Inventory Sync

Operations teams use `/dcim/devices` and the related rack and site endpoints to keep NetBox in sync with the physical environment. A scheduled job reads inventory from a network discovery tool, writes new devices to NetBox, updates serials, and reports drift so the next change request lands against accurate data.

Example prompt: Create a device named r1-edge in site dc-east, rack r-12, role edge-router, with the serial number ABC123.

### Circuit and Provider Tracking

Network teams use the /circuits/ endpoints to record provider circuits and their terminations against sites and devices. The model captures circuit type, commit rate, and termination interface, so an outage on a provider circuit can be correlated to the affected sites without a separate tracker.

Example prompt: List all circuits terminating at site dc-east and return the provider name, circuit id, and commit rate for each.

### AI Agent Integration via Jentic

An AI agent uses Jentic to query and update NetBox during a change workflow. Jentic exposes the dcim, ipam, circuits, and tenancy endpoints by intent, so an agent given a request to allocate an IP and add a device finds the right operations, supplies the model, and executes without hand-coding 844 endpoints.

Example prompt: Use Jentic to search for allocate next available ip in netbox, load the schema, and reserve the next /32 from prefix 10.20.0.0/24.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/circuits/circuits/` | List provider circuits |
| GET | `/circuits/circuit-terminations/` | List circuit terminations |
| GET | `/circuits/circuit-types/` | List circuit type definitions |
| GET | `/circuits/provider-networks/` | List provider networks |
| GET | `/circuits/circuits/{id}/` | Get a circuit by id |

## Key resources

- **DCIM** — Devices, racks, sites, interfaces, cables, and modules
- **IPAM** — Prefixes, IP addresses, VLANs, VRFs, and aggregates
- **Circuits** — Provider circuits, circuit terminations, and provider networks
- **Tenancy** — Tenants and tenant groups for scoping infrastructure
- **Virtualization** — Virtual machines and clusters
- **Extras** — Custom fields, tags, journal entries, and webhooks

## Why Jentic

- **Setup:** Wiring the NetBox API by hand means passing the bearer token on every request and finding the right path among hundreds of circuit, device, and IP inventory endpoints against the host yourself. Through Jentic you install once, import NetBox from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** NetBox puts the object id in the URL path (`/circuits/circuits/{id}`/), so a rule can pin your agent to reads for one circuit or inventory object and nothing else. You choose the operations it may call, so writes to other object types are not included unless you add them.
- **Credential handling:** Your NetBox bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'allocate an IP address in NetBox' or 'list circuits', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **NetBox API (main import)** — Sister NetBox 3.4 spec import in the corpus, identical to this one
- **NetBox 2.4 (demo)** — Older NetBox 2.4 spec, narrower model coverage and fewer endpoints
- **DigitalOcean API** — Cloud provider API used to provision droplets that are then registered in NetBox
- **Cloudflare API** — DNS, CDN, and edge platform commonly fed by NetBox-derived inventory

## FAQ

### Why is there no official OpenAPI spec for NetBox API?

NetBox publishes a Swagger UI on every install but does not maintain a standards-validated OpenAPI 3.0 spec as a release artefact. Jentic generates and maintains this spec so AI agents and developers can call NetBox via structured tooling kept current with each release. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the NetBox API use?

NetBox uses bearer token authentication - generate a token in the NetBox UI under your user profile and pass it as Authorization: Token <key>. Jentic stores the token encrypted in your Jentic One instance so it is injected at execution time rather than passed through the agent context.

### Can I allocate the next available IP from a NetBox prefix through the API?

Yes. The IPAM endpoints under `/ipam/prefixes`/ expose an available-ips action that returns the next free address inside a given prefix. Combine it with a write to `/ipam/ip-addresses`/ to allocate and assign the address atomically.

### How do I list all devices at a site through Jentic?

Search Jentic for list netbox devices at a site, load the schema for the dcim devices endpoint, then execute with the site filter. The full flow is pip install jentic, search, load, execute.

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

NetBox does not impose API rate limits in the spec - limits depend on the operator's deployment. Treat large list calls as paginated and use brief=true for bulk reads to keep payload sizes small on heavily-populated installs.

### Does this spec differ from the netbox.dev/main import?

No, the two imports cover the same NetBox 3.4 OpenAPI document - one was sourced from the JSON variant on apis.guru and the other from the YAML variant. Endpoint counts, paths, and methods are identical. Pick whichever matches your existing import path.

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

Yes. Jentic One is self-hosted by you, so your own rules decide which NetBox operations and credentials the agent may use. Because NetBox carries the object id in the URL path, such as `/circuits/circuits/{id}`/, you can pin the agent to reads of a single circuit, device, or IP object and nothing else. You choose the operations it may call, so writes to other object types like `/dcim/devices`/ or `/ipam/ip-addresses`/ are excluded unless you add them.
