Automation · IPAM Automation
API Integration
Cheat sheet · https://pcornel.dk/topic.php?topic=5869
Answer
IPAM API integration lets provisioning tools request the next free address, reserve it and record the owner through the IPAM's REST API, such as NetBox's available-ips endpoint, in the same run that builds the system.
Remember
- Request and reserve in one call.
- Record owner and description.
- Handle API errors and retries.
First checks
curl -s -H 'Authorization: Token <t>' https://<netbox>/api/status/— API statuspython3 -c 'import pynetbox'— SDK- API token permissions — least privilege
Verify in this order
automation → IPAM API → data
Where it usually breaks
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
IPAM Automation → API Integration · operational reference
| Layer | IPAM Automation → API Integration operational reference |
|---|---|
| Runtime/ownership | IPAM API integration / NetBox REST patterns · identify controller/parser, durable intent, identity and target ownership before mutation |
| Persistent intent | Versioned definition/configuration with explicit dependencies, scope and credential boundary |
| Verification | GET the exact prefix/IP object by stable ID or scoped filters, perform a bounded create/update, then GET the returned object and validate uniqueness/status/tenant/VRF fields. |
| Expected interpretation | The integration uses the intended IPAM endpoint and scope, resolves one authoritative object, handles pagination/conflicts, and confirms the post-write allocation state from the API. |
| Recovery boundary | Preserve correlation IDs + pre-state, repair first failing boundary, then verify the target independently |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5869