---
title: "Prepairing Data Sources: ServiceNow API"
url: "https://docs.noreja.com/en/article/prepairing-data-sources-servicenow-api"
language: "en"
last_updated: "2026-02-28T11:34:36.549Z"
---

# Prepairing Data Sources: ServiceNow API

Preparing a ServiceNow data source for integration ensures secure, structured, and high-performance access to operational IT and business data. By leveraging the built-in REST APIs—such as the Table API, Aggregate API, Attachment API, Import Set API, and Scripted REST endpoints—organizations can enable reliable data exchange while maintaining governance, authentication standards, and performance controls. A properly configured ServiceNow API connection provides the foundation for seamless synchronization with Noreja and supports scalable, secure process analytics.

## Overview

Below is a consolidated reference for the most commonly used ServiceNow REST API endpoints. These built-in APIs enable CRUD operations on tables, statistical aggregations, attachment handling, import set staging, and custom logic via scripted endpoints. Use the REST API Explorer in your instance (System Web Services ▶ Inbound ▶ REST API Explorer) to test requests and inspect available parameters.

In summary, ServiceNow provides the following core REST interfaces:

**Table API** (`/api/now/table/{tableName}`) for standard CRUD on any table [servicenow.com](https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html?utm_source=chatgpt.com)[servicenow.com](https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_RESTAPI.html?utm_source=chatgpt.com)

**Aggregate API** (`/api/now/stats/{tableName}`) for record counts and statistical summaries [servicenow.com](https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/concept/c_AggregateAPI.html?utm_source=chatgpt.com)

**Attachment API** (`/api/now/attachment/*`) for uploading, downloading, and listing file attachments [servicenow.com](https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html?utm_source=chatgpt.com)

**Import Set API** (`/api/now/import/{stagingTableName}`) for bulk staging and transformation of external data [servicenow.com](https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/concept/c_ImportSetAPI.html?utm_source=chatgpt.com)

**Scripted REST API** (custom `/api/{namespace}/{api_id}/…`) for bespoke endpoints with server-side logic [servicenow.com](https://www.servicenow.com/community/developer-forum/what-is-difference-between-table-api-import-set-api-and-scripted/m-p/3265574?utm_source=chatgpt.com)

Below, each endpoint is described with its URI pattern, supported methods, key query parameters, and a brief usage example.

## Table API

Performs Create, Read, Update, and Delete operations on any ServiceNow table.

**Base URI**

````plaintext
https://<instance>.service-now.com/api/now/table/{tableName}
``` :contentReference[oaicite:5]{index=5}  

````

**Supported Methods**

-   `GET` – retrieve records
-   `POST` – create a new record
-   `PUT` / `PATCH` – update an existing record
-   `DELETE` – delete a record

**Common Query Parameters**

-   `sysparm_query` – encoded query string (e.g. `active=true^priority=1`)
-   `sysparm_limit` / `sysparm_offset` – pagination controls
-   `sysparm_fields` – comma-separated list of fields to return
-   `sysparm_display_value` – `true`/`false`, return display vs. raw values

**Example: Retrieve Top 10 Incidents**

````plaintext
GET https://<instance>.service-now.com/api/now/table/incident
    ?sysparm_limit=10
    &sysparm_query=priority=1
    &sysparm_fields=number,short_description,priority
``` :contentReference[oaicite:6]{index=6}  
````

## Aggregate API

Generates summary statistics (counts, sums, averages) on table data without retrieving full records.

**Base URI**

````plaintext
https://<instance>.service-now.com/api/now/stats/{tableName}
``` :contentReference[oaicite:7]{index=7}  

````

**Supported Methods**

-   `GET` only

**Key Query Parameters**

-   `sysparm_count` – `true` to return total record count
-   `sysparm_sum_fields` – comma-separated numeric fields to sum
-   `sysparm_group_by` – comma-separated fields to group results
-   `sysparm_query` – filtered subset for aggregation

**Example: Count High-Priority Incidents**

````plaintext
GET https://<instance>.service-now.com/api/now/stats/incident
    ?sysparm_count=true
    &sysparm_query=priority=1
``` :contentReference[oaicite:8]{index=8}  
````

## Attachment API

Handles file attachments for any recordable table.

**Upload a File**

```plaintext
POST https://<instance>.service-now.com/api/now/attachment/file
    ?table_name={tableName}
    &table_sys_id={recordSysId}
    &file_name={filename}
```

Content-Type: `multipart/form-data` or binary [servicenow.com](https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html?utm_source=chatgpt.com)

**Download a File**

```plaintext
GET https://<instance>.service-now.com/api/now/attachment/{attachmentSysId}/file
```

**List Attachments on a Record**

```plaintext
GET https://<instance>.service-now.com/api/now/attachment
    ?sysparm_query=table_name={tableName}^table_sys_id={recordSysId}
```

**Delete an Attachment**

```plaintext
DELETE https://<instance>.service-now.com/api/now/attachment/{attachmentSysId}
```

## Import Set API

Stages external data in an “import set” table for transformation and loading into target tables.

**Single Record Insert**

```plaintext
POST https://<instance>.service-now.com/api/now/import/{stagingTableName}
```

Body: JSON object representing one record [servicenow.com](https://www.servicenow.com/community/developer-articles/import-set-api-goodbye-srapis/ta-p/2318624?utm_source=chatgpt.com)

**Bulk Insert (Insert Multiple)**

```plaintext
POST https://<instance>.service-now.com/api/now/import/{stagingTableName}/insertMultiple
```

Body: `{ "records": [ { … }, { … } ] }`[ahmeddrar.me](https://ahmeddrar.me/2021/05/15/quebec-tour-part-3import-set-rest-api-insert-multiple/?utm_source=chatgpt.com)

**Key Query Parameters**

None; all mapping and transformation is handled after staging

## Scripted REST API

Allows creation of fully custom endpoints backed by server-side scripts.

**Definition Location**

Navigate to **System Web Services ▶ Scripted REST APIs** in your instance. [servicenow.com](https://www.servicenow.com/community/developer-forum/what-is-difference-between-table-api-import-set-api-and-scripted/m-p/3265574?utm_source=chatgpt.com)

**URI Pattern**

```plaintext
https://<instance>.service-now.com/api/{namespace}/{api_id}/{resourcePath}
```

**Typical Methods**

-   `GET`, `POST`, `PUT`, `DELETE`, as defined in your script
-   Custom request/response scripting in the Scripted REST resource

**Use Cases**

-   Complex business workflows
-   Data transformations not covered by core APIs
-   Secured, versioned custom interfaces

## Discovering and Testing Endpoints

**REST API Explorer**

-   Within your ServiceNow instance: **System Web Services ▶ REST API Explorer**
-   Browse built-in APIs, dynamically construct sample requests, and view response schemas [servicenow.com](https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/task/explore-rest-api-for-table.html?utm_source=chatgpt.com)

**Versioning**

-   Endpoints may include a version: `/api/now/v1/...` or `/api/now/v2/...`
-   Omitting the version defaults to the current API stability level [servicenow.com](https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/concept/c_RESTAPI.html?utm_source=chatgpt.com)

## Authentication & Security

**Supported Schemes**

-   Basic Authentication (username/password)
-   OAuth 2.0 (recommended for integrations)
-   Mutual TLS (instance-level certificate)

**Rate Limits & Best Practices**

-   Respect `sysparm_limit` and `sysparm_offset` to avoid large, blocking queries [blog.josephvelliah.com](https://blog.josephvelliah.com/pull-table-data-from-servicenow-instance-using-rest-api?utm_source=chatgpt.com)
-   Use index-friendly filters (`sysparm_query`) to optimize performance

By leveraging these built-in ServiceNow REST interfaces, you can integrate and manage the communication with the Noreja tool —seamlessly and securely with your ServiceNow data model.
