Skip to main content

Servicenow

@dougschaefer/servicenowv2026.05.27.1· 4d agoMODELS
01README

ServiceNow integration model — OAuth client_credentials authentication with automatic token caching, generic Table API CRUD (query, get, create, update, delete), Aggregate API for data analysis, and a passthrough REST call for endpoints outside the Table API. Foundation for spoke development, administration, and ad-hoc operations against any ServiceNow instance.

02Release Notes

Docs: backtick the model type in module JSDoc (symbols-docs scoring); standardize LICENSE. No functional change.

03Models1
@dougschaefer/servicenow-instancev2026.05.27.1servicenow/instance.ts
fn lookup()
Verify OAuth credentials, capture instance metadata (release, scope prefix), and identify the user the token impersonates. Run this first to confirm connectivity.
fn tableQuery(table: string, query?: string, fields?: string)
Query a ServiceNow table with an encoded query string. Returns matching records as resource artifacts. Use sysparm_query syntax (e.g., 'active=true^stateIN1,2^ORDERBYsys_created_on').
ArgumentTypeDescription
tablestringTable name (e.g., 'incident', 'sys_user', 'sys_app')
query?stringEncoded query string (sysparm_query). Empty returns all records up to limit.
fields?stringComma-separated field list to retrieve (sysparm_fields). Defaults to all fields.
fn tableGet(table: string, sysId: string, fields?: string)
Fetch a single record from a ServiceNow table by sys_id.
ArgumentTypeDescription
tablestringTable name
sysIdstringsys_id of the record
fields?stringComma-separated field list (sysparm_fields). Defaults to all fields.
fn tableCreate(table: string, fields: record)
Insert a new record into a ServiceNow table. Pass field values as a JSON object.
ArgumentTypeDescription
tablestringTable name
fieldsrecordField name → value object for the new record
fn tableUpdate(table: string, sysId: string, fields: record)
Update fields on an existing ServiceNow record. Uses HTTP PATCH semantics — only provided fields are changed.
ArgumentTypeDescription
tablestringTable name
sysIdstringsys_id of the record to update
fieldsrecordField name → value object with only the fields to change
fn tableDelete(table: string, sysId: string)
Delete a record from a ServiceNow table by sys_id. Destructive — verify the sys_id with tableGet first.
ArgumentTypeDescription
tablestringTable name
sysIdstringsys_id of the record to delete
fn tableAggregate(table: string, query?: string, count?: boolean, avgFields?: string, sumFields?: string, minFields?: string, maxFields?: string, groupBy?: string)
Aggregate query against a ServiceNow table (count, sum, avg, min, max, group_by). Use this for data analysis without dragging full record sets across the wire.
ArgumentTypeDescription
tablestringTable name
query?stringEncoded query (sysparm_query) to filter records before aggregation
count?booleanInclude record count (sysparm_count)
avgFields?stringComma-separated numeric fields to average (sysparm_avg_fields)
sumFields?stringComma-separated numeric fields to sum (sysparm_sum_fields)
minFields?stringComma-separated numeric fields for minimum (sysparm_min_fields)
maxFields?stringComma-separated numeric fields for maximum (sysparm_max_fields)
groupBy?stringComma-separated fields to group by (sysparm_group_by)
fn restCall(path: string, body?: unknown, params?: record)
Generic REST call to any path on the ServiceNow instance. Use for Scripted REST APIs, Import APIs, application-specific endpoints, or anything outside the Table API. The OAuth token is applied automatically.
ArgumentTypeDescription
pathstringURL path on the instance (e.g., '/api/sn_chg_rest/change' or '/api/x_amsoe_app/widget')
body?unknownRequest body for POST/PUT/PATCH (object will be JSON-serialized)
params?recordQuery string parameters

Resources

instance-info(infinite)— ServiceNow instance metadata snapshot — release, build, scope prefix, and the user identity the OAuth token impersonates
record(infinite)— A single record from a ServiceNow table — full field set as returned by the Table API, tagged with table name and sys_id
aggregate(infinite)— Result of a ServiceNow Aggregate API query — count/avg/sum/min/max/group_by output
rest-response(infinite)— Response body from a generic ServiceNow REST call — for endpoints outside the Table API (Scripted REST APIs, Import APIs, custom application endpoints)
04Previous Versions1
2026.05.05.3May 13, 2026

Initial publish — ServiceNow Table API CRUD integration with OAuth client_credentials auth.

05Stats
A
100 / 100
Downloads
4
Archive size
15.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels