NetStacksNetStacks

Quick Actions

TeamsEnterprise

One-click executable API call templates that automate common network operations with variable substitution and response rendering.

Overview

Quick Actions are one-click executable API call templates that automate common network operations. Unlike Quick Prompts (which send text to AI for analysis), Quick Actions execute real API calls against the NetStacks API or external systems and display the results directly.

Each Quick Action defines an HTTP method, URL template, optional headers and request body, and a response rendering configuration. Variables use the same {{variable_name}} placeholder syntax as Quick Prompts, and values are substituted at execution time.

  • One-click execution — Fill in variables and execute with a single click, no manual API calls needed
  • Variable substitution — Dynamic values in URLs, headers, and request bodies using {{placeholder}} syntax
  • Response rendering — Display API responses as formatted JSON, tables, or status badges
  • Org-level sharing — Share action templates with your team for consistent operational workflows
Quick Actions vs Quick Prompts

Quick Prompts ask AI a question and get a text response. Quick Actions execute a real API call and show the result. Use Quick Prompts for analysis and troubleshooting guidance. Use Quick Actions for operational tasks like triggering backups, fetching device data, or deploying configurations.

How It Works

The Quick Actions system combines HTTP request templating with response rendering:

Action Template Structure

Each Quick Action defines the components of an HTTP request:

  • HTTP Method — GET, POST, PUT, PATCH, or DELETE
  • URL Template — The API endpoint with variable placeholders (e.g., /api/devices/{{device_id}}/snapshots)
  • Headers — Optional request headers (authentication is handled automatically for NetStacks API calls)
  • Body Template — Optional JSON request body with variable placeholders

Variable Substitution

Variables in the URL, headers, and body are replaced with actual values at execution time. The same {{variable_name}} syntax used in Quick Prompts applies here. Variables can appear anywhere in the template — in path segments, query parameters, header values, or JSON body fields.

Response Rendering

After the API call completes, the response is displayed according to the action's rendering configuration:

  • Raw JSON — Pretty-printed JSON response, useful for debugging or detailed inspection
  • Table — Extract an array from the response and render it as a sortable table with configurable columns
  • Status badge — Show a success/failure indicator based on the HTTP status code, ideal for operations like backups or deployments

Execution Logging

Every Quick Action execution is logged with the user, timestamp, resolved variables, HTTP status code, and response body. This provides an audit trail of operational actions taken through the Quick Actions interface.

Org-Level Sharing

Like Quick Prompts, Quick Actions support a shared flag for organization-wide visibility. Shared actions allow teams to maintain a library of approved operational workflows that any team member can execute.

Creating Quick Actions

Follow these steps to create a new Quick Action template.

Step 1: Navigate to Quick Actions

Go to AI → Quick Actions in the Controller web interface or access Quick Actions from the AI Chat sidebar panel.

Step 2: Create a New Action

Click Create Action and enter a descriptive name (e.g., "Backup Device Config" or "Get Device Interfaces").

Step 3: Configure the HTTP Request

Select the HTTP method and enter the URL template with variable placeholders. For NetStacks API calls, use relative paths starting with /api/. For external APIs, use the full URL.

Step 4: Set Headers and Body

Add any required headers. For NetStacks API calls, authentication headers are added automatically. For the request body, write a JSON template with variable placeholders where dynamic values should be substituted.

External API authentication

When calling external APIs, you must provide authentication headers manually in the action template. Avoid hardcoding secrets directly — use variables like {{api_key}} that are filled in at execution time.

Step 5: Configure Response Rendering

Choose how the response should be displayed: raw JSON for detailed output, table for list responses, or status badge for simple success/failure operations.

Step 6: Set Sharing

Toggle shared to make the action available to all users in your organization. Shared actions appear in the team's Quick Actions library.

Step 7: Test Execution

Fill in sample variable values and execute the action to verify it works correctly. Check the response rendering to ensure it displays the data in a useful format.

Step 8: Save

Click Save. The action is immediately available for use.

Code Examples

Backup Device Configuration

Trigger a configuration snapshot for a device with a single click:

backup-action.jsonjson
{
  "name": "Backup Device Config",
  "method": "POST",
  "url": "/api/devices/{{device_id}}/snapshots",
  "headers": {},
  "body": null,
  "response_render": {
    "type": "status_badge",
    "success_message": "Backup initiated successfully",
    "failure_message": "Failed to initiate backup"
  },
  "shared": true
}

Get Device Interfaces

Fetch and display all interfaces for a device as a sortable table:

interfaces-action.jsonjson
{
  "name": "Get Device Interfaces",
  "method": "GET",
  "url": "/api/devices/{{device_id}}/interfaces",
  "headers": {},
  "body": null,
  "response_render": {
    "type": "table",
    "data_path": "interfaces",
    "columns": [
      { "key": "name", "label": "Interface" },
      { "key": "status", "label": "Status" },
      { "key": "speed", "label": "Speed" },
      { "key": "ip_address", "label": "IP Address" },
      { "key": "description", "label": "Description" }
    ]
  },
  "shared": true
}

Deploy VLAN Template

Deploy a VLAN configuration from a stack template with variable substitution in the request body:

deploy-vlan-action.jsonjson
{
  "name": "Deploy VLAN Template",
  "method": "POST",
  "url": "/api/stacks/{{stack_id}}/deploy",
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "variables": {
      "vlan_id": "{{vlan_id}}",
      "vlan_name": "{{vlan_name}}",
      "subnet": "{{subnet}}",
      "gateway": "{{gateway}}"
    },
    "target_devices": ["{{device_id}}"],
    "dry_run": false
  },
  "response_render": {
    "type": "status_badge",
    "success_message": "VLAN deployment initiated",
    "failure_message": "Deployment failed"
  },
  "shared": true
}

Check Device Health

Retrieve device health metrics and display as formatted JSON:

health-check-action.jsonjson
{
  "name": "Check Device Health",
  "method": "GET",
  "url": "/api/devices/{{device_id}}/health",
  "headers": {},
  "body": null,
  "response_render": {
    "type": "json",
    "pretty_print": true
  },
  "shared": false
}

Query External Monitoring API

Call an external Grafana API to retrieve dashboard metrics:

grafana-query-action.jsonjson
{
  "name": "Grafana Interface Utilization",
  "method": "GET",
  "url": "https://grafana.example.net/api/datasources/proxy/1/query?query={{promql_query}}&start={{start_time}}&end={{end_time}}&step=60",
  "headers": {
    "Authorization": "Bearer {{grafana_api_key}}"
  },
  "body": null,
  "response_render": {
    "type": "table",
    "data_path": "data.result",
    "columns": [
      { "key": "metric.__name__", "label": "Metric" },
      { "key": "metric.instance", "label": "Instance" },
      { "key": "value[1]", "label": "Value" }
    ]
  },
  "shared": true
}

Questions & Answers

Q: What is the difference between Quick Prompts and Quick Actions?
A: Quick Prompts send a text prompt to AI Chat and receive a natural language response with analysis and recommendations. Quick Actions execute a real HTTP API call and display the response. Use Quick Prompts when you need AI to analyze or explain something. Use Quick Actions when you want to trigger an operation (backup, deployment, data retrieval) and see the result.
Q: Can Quick Actions call external APIs?
A: Yes. Quick Actions can call any HTTP endpoint, not just the NetStacks API. For external APIs, use the full URL in the URL template and provide authentication headers. You can use variables like {{api_key}} in headers so credentials are provided at execution time rather than stored in the template.
Q: How does variable substitution work in Quick Actions?
A: Variables use the {{variable_name}} syntax and can appear anywhere in the URL path, query parameters, headers, or request body. When you execute an action, NetStacks extracts all unique variables, presents input fields for each, and replaces the placeholders with your values before making the HTTP request.
Q: How is the response rendered?
A: Each Quick Action defines a rendering configuration. The three options are: "json" for pretty-printed JSON output, "table" for extracting an array from the response and displaying it with configurable columns, and "status_badge" for showing a simple success or failure indicator based on the HTTP status code. Table rendering supports specifying a data_path to extract nested arrays from the response.
Q: Can I share Quick Actions with my team?
A: Yes. Like Quick Prompts, each Quick Action has a shared flag. When enabled, the action is visible to all users in your organization. Only the creator can edit or delete shared actions. This allows teams to maintain a library of approved operational workflows.
Q: Are Quick Action executions logged?
A: Yes. Every execution is recorded with the user who ran it, the timestamp, the resolved variable values, the HTTP status code, and the response. This provides a complete audit trail of who executed what actions and when, which is important for change management and incident investigation.

Troubleshooting

Action returning an error

If a Quick Action fails when executed:

  • Check the URL template for typos or incorrect path segments
  • Verify the HTTP method is correct for the endpoint (e.g., POST for creating resources, GET for reading)
  • For NetStacks API calls, confirm your session is authenticated and you have the required permissions
  • For external APIs, verify the API key or token is valid and has not expired

Variables not substituting

If you see literal {{variable_name}} text in the request:

  • Verify the placeholder syntax uses double curly braces
  • Check that all variable fields were filled in before executing
  • Ensure variable names in the template match exactly (including underscores and case)

Response rendering issues

If the response is not displayed correctly:

  • For table rendering, verify the data_path points to an actual array in the response JSON
  • For table columns, verify the key values match the actual field names in the response objects
  • Switch to "json" rendering temporarily to inspect the raw response structure

Permission denied when executing

If you receive a 403 Forbidden error:

  • Check your user role has permission to access the target API endpoint
  • For device-specific actions, verify you have access to the target device
  • Contact your administrator to review role permissions for API access
Tip

Use the "json" response rendering mode to debug actions. It shows the complete API response, which helps identify issues with table column mappings or data path configuration.

Quick Actions complement other NetStacks features:

  • Quick Prompts — AI prompt templates for analysis and troubleshooting (text-based, compared to Quick Actions which execute API calls)
  • AI Chat — Interactive AI sessions where Quick Action results can provide context
  • API Authentication — How authentication works for NetStacks API calls made by Quick Actions
  • NOC Agents — Autonomous agents that can incorporate Quick Action patterns in their tool sets
  • Devices API — API endpoints commonly used in device-related Quick Actions