Getting started with ServiceNow SQL API
Summarize
Summary of Getting started with ServiceNow SQL API
The ServiceNow SQL API enables secure, read-only access to your ServiceNow instance data using standard ODBC and JDBC drivers. This connection allows Business Intelligence (BI) tools and data analysis platforms to query ServiceNow tables directly via SQL SELECT statements, leveraging ServiceNow’s existing security model. It supports complex queries with filtering, aggregation, and joins, helping customers integrate, analyze, and visualize ServiceNow data alongside external data sources without data duplication.
Show less
Key Features
- Direct BI Tool Integration: Connect popular BI platforms such as Power BI, DBeaver, and DBVisualizer directly to ServiceNow data using ODBC/JDBC drivers.
- Read-Only Access: The API supports only SELECT statements, preventing accidental data modification and ensuring data integrity.
- Complex Query Support: Write advanced SQL queries including WHERE filters, aggregations (COUNT, SUM, AVG), and INNER or LEFT OUTER joins across multiple tables.
- Security Enforcement: Access control respects ServiceNow’s ACL rules at table, row, and field levels by default, with options to disable row and field checks for specific service accounts while always enforcing table-level security.
- Optimized Data Transfer: Pass-through queries process filtering and aggregation on the ServiceNow side, minimizing network load and improving performance.
- Authentication Required: All connections must authenticate, ensuring secure access.
Practical Benefits
- Avoid Data Duplication: Query live ServiceNow data directly without replicating it to external warehouses or repositories.
- Comprehensive Analysis: Combine ServiceNow data with other external datasets within your BI tools for richer insights.
- Custom Reporting and Ad-Hoc Analysis: Enable flexible, on-demand reporting and data exploration without additional data preparation.
- Maintain Security and Compliance: Leverage ServiceNow’s secure-by-default ACL enforcement to restrict data access according to user roles and permissions.
Next Steps
To maximize the value of the SQL API, explore detailed documentation on architecture, configuration, plugin installation, supported SQL functions, and common use cases such as business intelligence reporting and custom report development. This will help you effectively implement and manage SQL API connections aligned with your organization’s data governance policies.
The ServiceNow SQL API provides data access to your ServiceNow instances through industry-standard ODBC and JDBC drivers, enabling direct connections from Business Intelligence (BI) tools and data analysis platforms.
The ServiceNow SQL API plugin uses ServiceNow web services support for a query-only interface. By default, the plugin supports only SELECT statements, allowing external applications to query authorized tables. It permits a limited set of additional SQL commands and enables you to compose more complex queries to retrieve only relevant data.
What you can achieve with SQL API
With the SQL API, you can:
- Connect your BI tools: Integrate standard BI platforms such as Power BI, DBeaver, DBvisualizer, and other ODBC/JDBC-compatible tools directly with your ServiceNow data.
- Query data securely: Access data through read-only operations that help avoid unintended modifications to your ServiceNow records. Allow access only to the desired tables.
- Eliminate data duplication: Query your ServiceNow data directly without replicating it to external repositories or data warehouses.
- Combine data sources: Merge your ServiceNow data with external datasets in your analytical platforms for comprehensive analysis.
- Optimize data transfer: Write targeted SQL queries to retrieve only the data you need, reducing network overhead for data pipeline and data transformation, and improving performance.
How SQL API works
When you connect your BI tool to your ServiceNow instance through the SQL API, you establish a standard database connection using ODBC or JDBC APIs. After connecting, you can write SQL queries to retrieve data from your ServiceNow tables and fields.
The API processes your queries and returns results in standard tabular format, which your BI tool can then visualize, analyze, or export.
Pass-through query support
The SQL API supports pass-through queries, meaning you can write SQL statements that execute directly on your ServiceNow data. This enables you to:
- Apply WHERE clauses to filter data at the source.
- Perform aggregations (COUNT, SUM, AVG, etc.) on the ServiceNow side.
- Join multiple ServiceNow tables in a single query. The query engine supports only INNER and LEFT OUTER joins.
- Limit result sets to reduce data transfer.
By processing queries at the source, you reduce the amount of data transferred over the network and improve overall query performance.
Security and access control
Your current ServiceNow security model still applies when you access the SQL API. The API implements the ServiceNow ACL model, which means:
- You can only access data that your ServiceNow role and permissions allow.
- All identity and access management protocols are enforced at the API level.
- Your queries follow table-level, row level, field level, query level, and record-level security rules.
-
By default, the SQL API checks access at the table, row, and field level for every query, following ServiceNow's secure-by-default approach. The SQL API validates all ACLs in your instance record by record, which may result in longer response times. This is expected.
If your use case does not require row and field-level checks — for example, a Business Intelligence integration — you can turn them off by assigning the
sn_sql_api_privileged_moderole to the service account. Table-level ACL checks always remain in effect and cannot be turned off. - Authentication is required for all connections.
Additionally, the SQL API is read-only by design. You cannot perform INSERT, UPDATE, or DELETE operations through this interface. This helps prevent accidental modification of production data.