How to Query the ServiceNow Table API with Ansible

ServiceNow’s Table API is how you read and write records programmatically — incidents, change requests, service catalog items, CMDB entries. Here’s how to query it from Ansible using the uri module. Authentication ServiceNow uses basic auth for API calls. Store your credentials as variables, not hardcoded values: 1 2 3 4 # group_vars/all.yml or vault snow_instance: "company.service-now.com" snow_user: "svc_automation" snow_password: "{{ vault_snow_password }}" Test your connection first: 1 2 3 4 5 6 7 8 9 10 - name: Test ServiceNow connectivity ansible.builtin.uri: url: "https://{{ snow_instance }}/api/now/table/incident?sysparm_limit=1" method: GET user: "{{ snow_user }}" password: "{{ snow_password }}" force_basic_auth: true status_code: 200 validate_certs: true register: snow_test Basic Table Query The Table API endpoint is /api/now/table/{table_name}. Common tables: ...

April 10, 2026 · 5 min · 932 words · Rob Washington