Skip to main content

Overview

Inventories are collections of hosts that can be targeted by Ansible playbooks. AWX supports regular inventories, smart inventories (dynamic host filtering), and constructed inventories.

Endpoints

List Inventories

Create Inventory

Standard Inventory

Smart Inventory

string
required
Inventory name
string
Inventory description
integer
required
Organization ID
string
default:""
Inventory type: “ (regular), smart, or constructed
string
Smart inventory host filter (required for smart inventories)
string
Inventory variables in YAML or JSON format
boolean
default:"false"
Prevent falling back to default instance group

Retrieve Inventory

Response Schema

integer
Inventory ID
string
Inventory name
string
Inventory description
integer
Organization ID
string
Inventory kind: “, smart, or constructed
string
Smart inventory filter
string
Inventory-level variables
boolean
Whether any hosts have active failures
integer
Total number of hosts
integer
Number of hosts with failures
integer
Total number of groups
boolean
Whether inventory has sources
integer
Number of inventory sources
integer
Number of failed sources
boolean
Whether inventory is pending deletion
Links to related resources:
  • hosts - Inventory hosts
  • groups - Inventory groups
  • root_groups - Top-level groups
  • variable_data - All variables
  • script - Dynamic inventory script
  • tree - Inventory tree view
  • inventory_sources - Inventory sources
  • update_inventory_sources - Trigger source updates
  • activity_stream - Activity log
  • job_templates - Job templates using this inventory
  • ad_hoc_commands - Ad hoc commands
  • access_list - Access list
  • object_roles - Available roles
  • instance_groups - Instance groups
  • labels - Inventory labels
  • copy - Copy endpoint
  • input_inventories - Input inventories (constructed only)

Update Inventory

Delete Inventory

Deleting an inventory also deletes all hosts, groups, and inventory sources.

Inventory Hosts

List Hosts

Add Host

Inventory Groups

List Groups

Create Group

Inventory Sources

List Inventory Sources

Create Inventory Source

Update All Inventory Sources

Inventory Script

Get dynamic inventory script output:
Returns Ansible dynamic inventory JSON.

Inventory Tree

Get hierarchical tree view:

Variable Data

Get all inventory variables (inventory + group + host):

Ad Hoc Commands

Job Templates

List job templates using this inventory:

Labels

Instance Groups

Object Roles

Available roles:
  • admin_role - Full inventory administration
  • use_role - Use inventory in job templates
  • update_role - Trigger inventory source updates
  • adhoc_role - Run ad hoc commands
  • read_role - View inventory details

Copy Inventory

Filtering

Ordering

Smart Inventory Host Filters

Smart inventories use advanced filtering:

Complete Example