Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

REST API

Direct answer

The NetBox REST API at /api/ exposes every object for create, read, update and delete with token authentication, filtering and pagination; pynetbox wraps it for Python.

When to use this

Use this when calling the NetBox REST API.

First 30 seconds

1. NetBox REST API with token auth, filtering, pagination; GraphQL for reads.

2. pynetbox SDK.

3. Least-privilege tokens (write-enabled only when needed).

4. Handle pagination.

5. Bulk operations.

Operational verification

client → token → REST/GraphQL → objects

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
NetBox source-of-truth automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformNetBox source-of-truth automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior. · Cross-platform automation / API / controller
Key commandGET <resource-uri>
Scope / prerequisiteUse this when calling the NetBox REST API.
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence0
On this pageJump to a specific section
Automation command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Ignoring pagination limits.
  • Tokens with write rights for read-only scripts.
Key points
  • REST API at /api/ with token authentication.
  • Supports filtering and pagination.
  • pynetbox wraps it for Python.
Key checks
  • curl -s -H 'Authorization: Token <t>' 'https://<netbox>/api/dcim/devices/?limit=100&offset=0' — paginated REST
  • python3 -c "import pynetbox;nb=pynetbox.api('https://<netbox>',token='<t>');print(nb.status())" — pynetbox
  • GraphQL endpoint (/graphql/) — flexible queries
ReferenceWhy it matters1 section · depth on demand

What it is

The NetBox REST API (/api/) supports filtering, pagination and bulk operations; pynetbox wraps it in Python.

ReferenceImportant terms & boundaries2 sections · depth on demand

How it works

The API mirrors the UI models under /api/<app>/<model>/, supports filtering by most fields (?site=oslo&role=core), pagination (limit/offset, next link) and bulk create/update/delete with lists. Tokens can be read-only or write-enabled.

Example

import pynetbox
nb = pynetbox.api("https://netbox.example.com", token=token)
for d in nb.dcim.devices.filter(site="oslo", role="access-switch"):
    print(d.name, d.primary_ip)
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docNetBox source-of-truth automation current

Authoritative/upstream documentation reviewed for bounded claims in NetBox > REST API. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://netbox.readthedocs.io/en/stable/ · confidence 94%
Confirmation

Confirm action

Continue?