Use it to pull inventory and health data or automate provisioning in Catalyst Center, and when an API call fails.
Catalyst Center APIs
Catalyst Center APIs (Intent API) give programmatic access to inventory, sites, assurance health, templates and provisioning. Clients first get a token from the authentication endpoint and send it in the X-Auth-Token header.
1. Get a token: curl -sk -X POST -u <user>:<pw> https://<dnac>/dna/system/api/v1/auth/token.
2. Call with -H 'X-Auth-Token: <token>' — 401 → token expired.
3. Write call returns a taskId → GET /dna/intent/api/v1/task/<id> for the result.
4. 429 → rate limited; slow down.
5. Large results → page with offset and limit.
source of truth → data validated → API or tool authenticated → change applied idempotently → state read back → matches intent
Calls succeed at first, then return 401; long jobs report success but nothing changes on devices.
Possible stored cause: The authentication token expired, or the code ignores the asynchronous task result and treats submission as success.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Calls succeed at first, then return 401; long jobs report success but nothing changes on devices.
Step 1 Verification & evidence Verify boundary
Validate token/auth, endpoint/version, task/asynchronous result and returned device/object IDs.
Step 2 Common failure modes Narrow the fault
Token expiry, wrong API version/path, asynchronous task not polled, object ID mismatch or missing privilege.
Step 3 Troubleshooting workflow Narrow the fault
Focus for this topic: Token expiry, wrong API version/path, asynchronous task not polled, object ID mismatch or missing privilege.
Step 4 Common mistakes Narrow the fault
- Not refreshing the auth token (it expires after about an hour).
- Polling task IDs too fast or never checking the task result.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Token: POST /dna/system/api/v1/auth/token with basic auth; it expires (about an hour). Many write calls are asynchronous: they return a task ID — poll the task API for the result. Respect rate limits and use paging (offset/limit) on large lists.
curl -sk -u <user>:<pw> -H 'Accept: application/yang-data+json' https://<device>/restconf/data/ietf-interfaces:interfaces— RESTCONF read.curl -i— HTTP status code and headers (200 OK, 201 Created, 204 No Content, 400, 401, 403, 404).python3 -m json.tool < file.json/jq . file.json— JSON valid and readable.show netconf-yang status/show platform software yang-management process— device API agents running.show ip http server status— HTTPS server for RESTCONF.
ReferenceWhat it is1 section · depth on demand
Concept overview
API-driven inventory, assurance and automation workflows around Cisco Catalyst Center.
Key ideas: Controller APIs let automation query inventory/state and invoke supported workflows through authenticated, versioned endpoints.
ReferenceWhy it matters1 section · depth on demand
Why it matters
Controller APIs let automation query inventory/state and invoke supported workflows through authenticated, versioned endpoints.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Working with the Catalyst Center API
Catalyst Center exposes its functions through a REST API, and every script starts the same way. The Catalyst Center API documentation describes the flow:
1. Send a POST to /dna/system/api/v1/auth/token with Basic authentication: base64-encoded username:password over HTTPS, as encoding isn't encryption.
2. Receive a token in the JSON response.
3. Send that token in the X-Auth-Token header on every later request.
Tokens are valid for 60 minutes. After that, requests return 401 and the script must authenticate again.
API patterns
| Pattern | Example |
|---|---|
| Read inventory | GET /dna/intent/api/v1/network-device |
| Health and issues | GET /dna/intent/api/v1/network-health, /issues |
| Command runner | POST /dna/intent/api/v1/network-device-poller/cli/read-request |
| Long-running actions | The response contains a task ID; poll /dna/intent/api/v1/task/{taskId} |
| Templates | Template programmer APIs for deploying configuration |
Robust script habits
| Habit | Reason |
|---|---|
| Refresh the token on a 401 | Tokens expire after 60 minutes |
Validate the certificate (verify= the CA bundle) | Protects the credentials |
| Poll tasks until they finish, with a timeout | Many changes are asynchronous |
Use pagination parameters (offset, limit) | Large inventories |
| Store credentials in a vault or environment variables | Never in the script |
dev$ TOKEN=$(curl -s -X POST -u "$CATC_USER:$CATC_PASS" \
-H "Content-Type: application/json" \
https://catc.example.net/dna/system/api/v1/auth/token | jq -r .Token)
dev$ curl -s -H "X-Auth-Token: $TOKEN" \
"https://catc.example.net/dna/intent/api/v1/network-device?family=Switches%20and%20Hubs&limit=5" \
| jq -r '.response[] | [.hostname, .managementIpAddress, .softwareVersion] | @tsv'
acc-2f-01 10.255.1.21 17.12.4
acc-3f-07 10.255.1.37 17.9.5
dev$ curl -s -o /dev/null -w "%{http_code}\n" -H "X-Auth-Token: expired" https://catc.example.net/dna/intent/api/v1/network-device
401
SDK option
Cisco's Python SDK (catalystcentersdk, earlier dnacentersdk) handles tokens and endpoints for you. Check that the SDK version matches the Catalyst Center release, because API versions differ between releases.
Discovering endpoints
The Developer Toolkit in the Catalyst Center GUI documents every API for the installed release, with request and response schemas. It is the authoritative reference for that system.
Documented example, not captured output.
Quick reference
Catalyst Center exposes most of its functions through a REST API. Scripts first obtain an authentication token, then use it to read inventory, sites and health data or to start actions. Many actions run in the background, so the API returns a task identifier that must be checked until the work is finished.
Catalyst Center REST API workflow:
POST /dna/system/api/v1/auth/token (Basic auth) → {"Token": "…"}
GET /dna/intent/api/v1/network-device header X-Auth-Token: <token>
GET /dna/intent/api/v1/site
POST /dna/intent/api/v1/network-device-poller/cli/read-request
GET /dna/intent/api/v1/task/{taskId}
Many write calls are asynchronous: they return a task ID, which must be polled for completion and errors. Use the official dnacentersdk/catalystcentersdk Python SDK or Ansible collection to avoid handling tokens and pagination manually.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation and Artificial Intelligence → Catalyst Center APIs. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/cloud-systems-management/catalyst-center/series.html · confidence 94%Deep reference
Design & tradeoffs
ENCOR design tradeoffs
Controller APIs reduce device-by-device logic but introduce controller object models and workflow states.