Instiq
Chapter 6 · Automation and Artificial Intelligence·v1.0.0·Updated 7/21/2026·~19 min

What's changed: Initial version

6.3Controller APIs and interpreting REST responses

Key points

Covers Catalyst Center's Intent API and SD-WAN Manager (vManage)'s REST API as a flow from token acquisition to the actual call, then teaches deciding what to do next (retry, fix credentials, fix the URL, or wait) from the returned status code200/201/204, 400/401/403/404/429, and 5xx—together with the payload.

What burns the most time in controller-API automation is misreading the returned code and trying to fix the wrong thing. Rewriting the URL over and over when a 401 came back, or retrying instantly on a 429 and jamming things further—both stem from failing to read where the code says responsibility lies. Broadly, status codes signal a division of responsibility: 2xx = success, 4xx = the caller's (client's) problem, 5xx = the server's problem. Using the real controllers Catalyst Center and SD-WAN Manager, this section follows the full arc of obtaining an auth token -> making the call -> interpreting the response -> choosing the next action.

6.3.1The shape of a controller API call

  • Catalyst Center (formerly DNA Center) is an on-prem controller governing the enterprise access network, exposing the Intent API. A call first obtains a token by sending credentials with Basic auth to POST /dna/system/api/v1/auth/token, then carries that token in the X-Auth-Token header to intent-based endpoints such as /dna/intent/api/v1/network-device. Tokens expire, and calls after expiry return 401.
  • SD-WAN Manager (vManage) is the management controller for the WAN overlay, handling device inventory, templates, policies, and statistics over REST. After authenticating you call endpoints such as /dataservice/device, maintaining a session (and a CSRF token) for operations. On both controllers the pattern is the same: authentication is a separate request, and subsequent calls present credentials in a header.
  • The HTTP method expresses the kind of operation: GET = read (safe, changes nothing) / POST = create (spawns a new resource or job) / PUT = replace (fields you omit may be cleared) / PATCH = partial update / DELETE = remove. On controllers a POST often does not complete immediately but returns a "task ID" for asynchronous processing, in which case you must GET the task-status endpoint to confirm completion.

6.3.2Where the status code places responsibility

  • 2xx = success. 200 OK means the request succeeded with a body (payload) (typical of GET). 201 Created means a new resource was created (typical of POST, with the location given in a Location header or the body). 204 No Content means success with no body to return (typical of DELETE and some updates)—reading a 204 as failure and re-running it risks double execution.
  • 4xx = the caller's problem, so retrying the identical request will not fix it. 400 Bad Request means the request's form or content is invalid (JSON syntax error, missing required field, type mismatch) -> fix the payload. 401 Unauthorized means not authenticated (no token presented, expired, or wrong credentials) -> re-obtain the token. 403 Forbidden means authentication succeeded but authorization is lacking -> review the account's role/permissions (re-fetching a token yields the same result).
  • 404 Not Found means the specified resource (URL) does not exist -> check the endpoint path and resource ID spelling (unlike 401, this is not a credentials problem). 429 Too Many Requests means you hit the rate limit -> do not retry immediately; honor the Retry-After header if present and resend with exponential backoff (lowering concurrency or switching to a bulk fetch also helps).
  • 5xx = the server's problem (500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable), and the request itself is likely correct. Rewriting the payload or token is therefore beside the point; the right move is retry with backoff plus checking the controller's logs and health. A 503 usually indicates transient overload or maintenance.
Exam point

Memorize status codes by splitting them three ways by "whose fault it is": 2xx = success (200 with a body, 201 created, 204 success with no body); 4xx = the caller (400 fix the payload, 401 re-obtain the token, 403 review permissions, 404 fix the URL, 429 wait and back off); 5xx = the server (retry with backoff without changing the content). ENCOR asks "this code came back—what do you do next?", so learn them as code -> remedy pairs.

Suppose you operate a script that pulls the full device inventory from Catalyst Center and then fetches interface details per device. One morning the run log records three responses in sequence: the inventory call GET /dna/intent/api/v1/network-device returned 401 Unauthorized; a re-run of the same call returned 200 OK with a list of 500 devices; and partway through the per-device interface loop, 429 Too Many Requests began repeating. The common mistake here is seeing the 401, concluding "the account lacks permissions," and asking an administrator for a role upgrade. But 401 is an authentication failure (who you are cannot be verified), whereas 403 is what signals insufficient permission (authenticated but not allowed). The log shows the call succeeded with 200 on a mere re-run—so the credentials and role were fine and the correct reading is that the token had simply expired. The durable fix is not a role change but adding logic that tracks token lifetime and, on a 401, automatically re-fetches from /auth/token and retries exactly once. As for the 429, reading it as "the server broke" and retrying immediately and repeatedly is the worst move, since it trips the rate limit further and delays recovery. A 429 is the controller explicitly saying "you are calling too much," so honor the Retry-After header if present and otherwise space calls with exponential backoff (1s, 2s, 4s...). The more structural improvement is to revisit the design of querying 500 devices one at a time, using bulk endpoints or pagination to cut the number of calls. Had a 500 been returned instead, the diagnosis inverts: the request is correct but processing failed on the controller, so touching the payload or token is beside the point—back off and retry while checking controller health and logs. Likewise, if a POST registering a new device returns 202 or a body containing a task ID, it means the work is not finished, and you must not treat it as success until you GET the task-status endpoint and confirm completion. Conversely, when a DELETE returns 204 No Content, treating the empty body as failure and re-running it is dangerous204 means success with nothing to return, and the deletion has in fact completed. In short, ENCOR asks not for the semantics of the code itself but for the choice of next move: "given this code, is what needs fixing the payload, the credentials, the permissions, the URL, or the call rate—or should nothing be changed and you simply wait?"

CodeMeaningResponsibilityNext action
200 OKSuccess with a body (payload)Parse the body and continue
201 CreatedA new resource was createdRecord the location (`Location` header or body ID)
204 No ContentSuccess with no body to returnTreat as success (do not re-run)
400 Bad RequestMalformed form or content (JSON syntax, type, missing field)CallerFix the payload (retrying alone will not help)
401 UnauthorizedNot authenticated (token missing or expired)CallerRe-obtain the token and retry once
403 ForbiddenAuthenticated but not authorizedCallerReview the account role/permissions
404 Not FoundThe specified resource or URL does not existCallerVerify the path and resource ID
429 Too Many RequestsRate limit reachedCallerHonor `Retry-After`, back off exponentially, reduce call volume
5xx (500/502/503)Server-side failure, overload, or maintenanceServerRetry with backoff unchanged and check the controller
Warning

Trap: Confusing 401 with 403 is the most common error—401 is authentication (identity unverified: re-obtain the token) and 403 is authorization (identity known but not allowed: review permissions), so requesting a role upgrade for a 401 misses the point. Also wrong: "204 has no body, so it failed"—it is success, and re-running invites double execution. And "429 is a server fault, so retry immediately" is wrong—it is an explicit signal that you are calling too much, and things worsen unless you wait and back off. Conversely, rewriting the payload or token on a 5xx is beside the point.

The shape of an API call and where the status code places responsibility.
Deciding what to do next from the status code

6.3.3Section summary

  • Both Catalyst Center's Intent API and SD-WAN Manager (vManage) share the pattern of authenticating in a separate request and presenting the token/session in a header
  • Split codes by where responsibility lies2xx = success (including 204), 4xx = the caller (400 payload, 401 token, 403 permissions, 404 URL, 429 rate), 5xx = the server
  • What is asked is not semantics but the next action: re-obtain the token on 401, review permissions on 403, honor Retry-After with exponential backoff on 429, and retry unchanged with backoff on 5xx

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. A script calling Catalyst Center's Intent API returned `401 Unauthorized`. The same credentials worked fine until a few hours earlier, and a re-run returned `200 OK`. What is the most appropriate durable fix?

Q2. Partway through a loop fetching interface details one device at a time across 500 devices, the controller began returning `429 Too Many Requests`. What is the most appropriate response?

Q3. A `DELETE` sent to a controller API returned `204 No Content` with an empty body. The script is implemented to treat this as a failure and resend the same `DELETE`. How should this implementation be assessed?

Check your understandingPractice questions for Chapter 6: Automation and Artificial Intelligence

Keep track of your progress

The full study guide is free to read. Sign up free to practice with the question bank, track what you have read, review your mistakes, and highlight passages.