Today I want to talk to you not just about automation — but next-gen automation that’s transforming enterprise networks across the globe. If you’ve been managing networks manually or using traditional tools like CLI or SNMP, let me introduce you to the game changer: Cisco DNA Center APIs.
The first time I interacted with Cisco DNA Center (DNAC), I was amazed at the control and visibility it gave me. But when I discovered its APIs — that’s when things went to the next level. Imagine automating device onboarding, monitoring, configuration, even troubleshooting — all from your Python script or Ansible playbook! Yes, it’s possible. So let’s deep dive into this topic, simplify it, and even build a small lab so you can try it hands-on.
Table of Contents
Theory in Brief – What Are Cisco DNA Center APIs?
Simplifying Network Management with APIs
Cisco DNA Center is Cisco’s intent-based network controller that provides centralized management, automation, and assurance for enterprise networks. But what truly sets it apart is its rich and well-documented REST APIs, which allow you to integrate and automate almost every feature.
These APIs expose Cisco DNA Center’s full power to developers and NetOps teams. You can write scripts or tools that query network health, push configurations, get device inventory, or even trigger actions like path trace — all using simple REST API calls over HTTPS.
API Categories You Should Know
Cisco DNA Center APIs are organized into several domains:
- Intent APIs – for provisioning, monitoring, configuration
- Command Runner APIs – to run CLI commands on devices
- Assurance APIs – for health and telemetry data
- Path Trace APIs – for automated hop-by-hop traffic analysis
- Topology APIs – to discover and visualize network devices
These APIs work with OAuth2 tokens for authentication and typically return data in JSON format, making them easy to parse and integrate with Python, Ansible, or dashboards.
How Does It Work?
- Authenticate – Use your API credentials to get a token.
- Make Requests – Use HTTP verbs (GET, POST, PUT, DELETE) to interact with DNAC.
- Parse JSON Responses – Handle the returned data in your automation tools.
- Integrate or Trigger Actions – Based on outputs, push configs, monitor alerts, or update dashboards.
Comparision – Features, Pros & Cons
Feature | Cisco DNA Center APIs |
---|---|
Protocol | HTTPS REST APIs |
Authentication | OAuth2 Token-based |
Data Format | JSON (standard output) |
API Categories | Intent, Assurance, CLI, Path Trace, Topology |
Documentation | Cisco DevNet API Reference |
Security | Role-based access control (RBAC) |
Pros and Cons
Pros | Cons |
---|---|
End-to-end network automation | Requires Cisco DNA Center appliance |
Rich telemetry and assurance APIs | Learning curve for complex use cases |
Easy JSON format and REST architecture | Requires API coding knowledge |
Works with Python, Postman, Ansible, etc. | Licensing requirements for full features |
Excellent Cisco DevNet support | DNAC setup can be resource-intensive |
Essential CLI Commands (Cisco Devices)
While the real magic happens via API, here are some CLI commands used in context with DNA Center integration:
Purpose | CLI Command | Notes |
---|---|---|
Check HTTP/HTTPS server status | `show running-config | include http` |
Enable SSH and Telnet | ip ssh version 2 , line vty 0 4 | Device reachability setup |
Check device inventory manually | show inventory | Verifies hardware info DNAC collects |
Show CDP neighbors | show cdp neighbors detail | Helps in discovery and topology build |
Check NETCONF/RESTCONF status | show netconf-yang status | Required for config API via YANG |
Monitor interfaces | show interfaces status | Equivalent to assurance interface APIs |
Run CLI via Command Runner | N/A – done via API call | Automates CLI via DNAC |
Real-World Use Case
Use Case | What DNA Center API Does | Benefit |
---|---|---|
Device Inventory Collection | GET /dna/intent/api/v1/network-device | Real-time hardware & software inventory |
Automated Path Trace | POST /dna/intent/api/v1/flow-analysis | Hop-by-hop trace for traffic visibility |
Run CLI on Devices | POST /dna/intent/api/v1/network-device-poller/cli/read | Executes CLI remotely, fetches result |
Interface Health Monitoring | GET /dna/intent/api/v1/interface | Status and metrics of all interfaces |
Topology Visualization | GET /dna/intent/api/v1/topology | Builds real-time network topology |
Python Automation Dashboard | Uses multiple APIs in one workflow | Complete custom GUI for NetOps |
EVE-NG Lab – Simulating Cisco DNA Center APIs (With Diagram)
Note: Cisco DNA Center can’t be emulated directly in EVE-NG due to resource requirements. But we can simulate device-side interaction and mock DNAC behavior using Python/Postman.
Lab Topology

Router Configuration
hostname API-Router
!
username admin privilege 15 password cisco123
!
ip http secure-server
ip http authentication local
ip domain-name networkjourney.com
crypto key generate rsa modulus 1024
!
netconf-yang
restconf
!
line vty 0 4
login local
transport input ssh
!
interface g0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
API Testing Steps
- Get Token from DNAC (simulated here)
POST to/dna/system/api/v1/auth/token
with base64 encoded credentials. - List Devices via API
GET /dna/intent/api/v1/network-device
- Path Trace Example (POST) jsonCopyEdit
{ "sourceIP": "192.168.1.1", "destIP": "8.8.8.8" }
- Command Runner Sample via API
Runshow version
via POST CLI request.
Troubleshooting Tips
Issue | Cause | Fix |
---|---|---|
401 Unauthorized | Token expired or wrong credentials | Regenerate token, verify username/password |
API not reachable | HTTP server not enabled | Run ip http secure-server |
JSON parsing error | Incorrect headers or syntax | Ensure Content-Type and Accept are set to JSON |
Device not discovered in DNAC | SNMP or SSH not reachable | Check management VLAN and access settings |
Path Trace fails | Endpoints unreachable | Check routing and IP reachability |
CLI Command Runner no output | Device not reachable or bad command | Test via CLI manually |
Most Common FAQs
1. What is Cisco DNA Center and how do its APIs help in automation?
Answer:
Cisco DNA Center is Cisco’s centralized network management and automation platform. It simplifies day-to-day network operations like configuration, monitoring, provisioning, and assurance.
The DNA Center APIs expose the platform’s features via RESTful endpoints, allowing developers and network engineers to automate tasks such as:
- Device onboarding
- Configuration pushes
- Gathering inventory and health data
- Running network assurance reports
This saves hours of manual CLI work and allows consistent, error-free deployments.
2. Are DNA Center APIs RESTful, and what formats do they support?
Answer:
Yes, DNA Center APIs are RESTful and adhere to standard HTTP methods like GET, POST, PUT, and DELETE.
They primarily return data in JSON format, making them easy to integrate with modern web tools, Python scripts, and automation frameworks like Ansible or Postman.
This REST-based structure ensures scalability and simplicity for both DevOps teams and network engineers.
3. What kind of tasks can I automate using Cisco DNA Center APIs?
Answer:
With DNA Center APIs, you can automate a wide range of tasks including:
- Inventory retrieval (devices, topology, interfaces)
- Software image management and compliance checks
- Configuration templates and deployments
- Device provisioning and onboarding
- Network assurance and health monitoring
- User and client tracking
- Site creation and management
Basically, everything you do via GUI can be automated via APIs, making it ideal for large-scale or repetitive tasks.
4. How do I authenticate with Cisco DNA Center APIs?
Answer:
DNA Center uses token-based authentication. Here’s the basic process:
- Send a POST request with your username/password to
/dna/system/api/v1/auth/token
. - You’ll receive a JWT token (JSON Web Token).
- Use this token in the
X-Auth-Token
header for all subsequent API calls.
This token-based approach is secure and easy to integrate into automation scripts or CI/CD pipelines.
5. Do I need a special license to access DNA Center APIs?
Answer:
To access the full suite of APIs, your DNA Center must have an essential or advantage license, depending on the features.
Basic read-only APIs like inventory and topology may work with lower tiers, but advanced APIs (e.g., configuration templates, assurance) require appropriate licensing.
Always check the Cisco licensing guide for your DNA Center version to confirm what’s included.
6. Can I use Python to interact with DNA Center APIs?
Answer:
Absolutely! Python is one of the most popular languages for working with DNA Center APIs.
You can use libraries like:
requests
for making HTTP callsdnacentersdk
(official Cisco SDK for DNA Center) for easier integrationjson
to parse and handle responses
Here’s a quick snippet for authentication:
import requests
url = "https://dnac-ip/dna/system/api/v1/auth/token"
headers = {'Content-Type': 'application/json'}
response = requests.post(url, auth=("username", "password"), headers=headers, verify=False)
token = response.json()["Token"]
This token can be used to automate any DNA Center feature via Python.
7. What is Cisco’s DNA Center SDK and how does it help?
Answer:
The Cisco DNA Center SDK (dnacentersdk
) is a Python wrapper for the DNA Center APIs.
It simplifies the process of:
- Authenticating
- Making API calls
- Handling responses
Instead of building raw REST calls, you can use SDK methods like:
dnac.devices.get_device_list()
This drastically reduces development time and helps beginners get started with DNA Center automation quickly.
8. How do DNA Center APIs support network assurance?
Answer:
DNA Center’s Assurance APIs provide visibility into:
- Network health
- Client connectivity issues
- Application performance
You can automate the collection of telemetry and run reports to identify trends, detect anomalies, and even trigger alerts.
This enables proactive network monitoring, saving you from firefighting later.
9. Can DNA Center APIs be integrated with external tools like Ansible or ServiceNow?
Answer:
Yes, DNA Center APIs can integrate with popular external tools like:
- Ansible: Use REST API modules or custom playbooks for provisioning and auditing.
- ServiceNow: Automate incident or change ticket creation based on DNA Center alerts.
- Jenkins or GitLab CI/CD: Include network automation workflows in your pipelines.
These integrations allow cross-platform orchestration, making your automation truly enterprise-ready.
10. What are some best practices when using Cisco DNA Center APIs?
Answer:
Here are a few expert tips:
- Use token caching to avoid repeated authentications.
- Handle API rate limits and response errors gracefully in your scripts.
- Paginate results where necessary (e.g., inventory lists).
- Use Postman or Swagger (API documentation at
https://dnac-ip/api-docs
) for exploring endpoints. - Always test in a lab before deploying in production.
By following these practices, you’ll build reliable, scalable, and maintainable automation solutions.
YouTube Link
Watch the Complete CCNP Enterprise: Cisco DNA Center APIs – Automating the Network the Smarter Way Lab Demo & Explanation on our channel:
Final Note
Understanding how to differentiate and implement Cisco DNA Center APIs – Automating the Network the Smarter Way is critical for anyone pursuing CCNP Enterprise (ENCOR) certification or working in enterprise network roles. Use this guide in your practice labs, real-world projects, and interviews to show a solid grasp of architectural planning and CLI-level configuration skills.
If you found this article helpful and want to take your skills to the next level, I invite you to join my Instructor-Led Weekend Batch for:
CCNP Enterprise to CCIE Enterprise – Covering ENCOR, ENARSI, SD-WAN, and more!
Get hands-on labs, real-world projects, and industry-grade training that strengthens your Routing & Switching foundations while preparing you for advanced certifications and job roles.
Email: info@networkjourney.com
WhatsApp / Call: +91 97395 21088
Upskill now and future-proof your networking career!