A Table API request is built from three parts: the address of your ServiceNow instance, the fixed segment /api/now/table/, and the table name. Add a sys_id to the end when you need one record. An optional version segment can sit between /api/now/ and table, and you add it when you want a version other than the latest.
How the base path is assembled
The endpoint comes in two forms. The default form is /api/now/table/ followed by the table name. The versioned form places a version value between /api/now/ and /table/. That value is optional. Leave it out and the request runs against the latest version. Add it when existing code needs an earlier version to stay in place. The version values offered also differ in how they answer a list request: version 1 returns 404 with no results on a list GET, while version 2 returns 200 with an empty array.
The version values available on your instance are listed in the REST API Explorer, so check there before you pin one. For the wider picture of which API options the platform offers, see the overview of whether ServiceNow has an API.
The table name is a path parameter that sits directly after /table/. The table name is a plain identifier. The worked example below uses incident. Each path names one table, so reading two tables takes two requests.
The six request paths and what each one does
All operations share the same base. The verb and the path after it decide whether you address the table as a whole or a single record inside it.
| Method | Path after /api | What it does |
|---|---|---|
| GET | /now/table/{tableName} | Retrieves multiple records from the table |
| GET | /now/table/{tableName}/{sys_id} | Retrieves the one record identified by the sys_id |
| POST | /now/table/{tableName} | Inserts one record into the table |
| PUT | /now/table/{tableName}/{sys_id} | Updates the record with the request body |
| PATCH | /now/table/{tableName}/{sys_id} | Updates the record with the name-value pairs in the request body |
| DELETE | /now/table/{tableName}/{sys_id} | Deletes the specified record from the table |
POST inserts one record per call, and multiple record insertion is not supported by that method. Loading many rows therefore means one POST for each row. For how bulk loading fits into a wider design, see the integration patterns guide. PATCH and PUT both update a record using field names and values in the request body.
A successful DELETE returns status 204, which signals success with no body to read. A GET for a single sys_id returns 404 when no record matches the identifier, so code that looks up a record should handle 404 as a possible outcome.
Building the query string after the path
Parameters follow the path as a query string. The list endpoint accepts sysparm_query, sysparm_fields, sysparm_limit, sysparm_offset, sysparm_display_value, sysparm_exclude_reference_link, sysparm_view, sysparm_no_count and sysparm_suppress_pagination_header. Three of them control how much comes back, and they interact in ways that catch people out.
sysparm_limit sets the maximum number of records returned, and its default is 10000. The limit is applied before access control lists are evaluated. A page can therefore contain fewer records than the number requested when some of the matching records are hidden from the calling user. If a call returns fewer records than you expect, check whether the calling user can see every matching row, because the limit is applied before access checks. Unusually large limit values can affect system performance, so a very large limit is not a shortcut for fetching everything in one call. For more on keeping heavy queries in check, see the task table performance best practices.
sysparm_offset sets the starting index and defaults to 0. It is the mechanism for paging through a large set. Advance the offset by the page size on each call. Do not pass a negative number.
sysparm_no_count defaults to false. Setting it to true skips the count query the platform would otherwise run against the table.
Paging with the Link header
A list response can carry a Link header. Its values are relative URLs, based on the previous request, that let a client page through the record set. The reference example shows next, prev, first and last relations. A client that keeps requesting the next link until none is left walks the whole set without calculating offsets itself.
sysparm_suppress_pagination_header removes the Link header when set to true. It defaults to false, so the header is present unless the parameter is changed.
Filtering with sysparm_query
sysparm_query carries the filter as a column name, an operator and a value. The operators are = for an exact match, != for not matching, LIKE, STARTSWITH and ENDSWITH for string fields, ^ to join conditions with AND, and ^OR to join them with OR. Sorting goes in the same parameter, using ORDERBY for ascending order and ORDERBYDESC for descending.
Column names, operators and values are case-sensitive, so a filter that matches one spelling can return nothing against another. An invalid part of the query is ignored by default and the rest still runs. A typo can therefore return more rows than intended without raising an error. The glide.invalid_query.returns_no_rows system property changes that behaviour, returning no rows when the query is invalid. For other common errors, see the guide to common REST and SOAP integration mistakes.
Choosing fields and display values
sysparm_fields takes a comma-separated list of the fields to return. The default returns all fields. Invalid field names are ignored rather than rejected. The sysparm_view parameter determines the UI view used to decide which fields are returned, and it is accepted on the GET list, GET by sys_id, POST, PATCH and PUT operations. When sysparm_view is also set, sysparm_fields takes precedence.
sysparm_display_value accepts true, false and all, and its default is false, which returns stored values. Display values are the labels shown on screen. Requesting them can cause performance problems, so ask for them deliberately.
For reference fields, which point at another record, sysparm_exclude_reference_link controls whether the Table API links to the referenced record are included. It defaults to false. Setting it to true removes those links from the response. It applies to GET, POST and PUT requests and is not part of the DELETE or PATCH description.
Request headers and body format
The Accept header selects the response format. The two options are application/json and application/xml, and the default is application/json. For PATCH and POST requests with a body, the Content-Type header sets how that body is read, and both default to application/json.
Response codes and empty results
For version 2, a list GET that matches nothing returns a 200 response with an empty result array. A successful single-record GET returns a result object, and a list GET returns a result array. The 404 for a missing sys_id and the 204 for a successful delete are covered above. When a call fails in a way the codes above do not explain, the troubleshooting guide for REST and SOAP integrations sets out a wider range of causes.
Permissions for the calling user
The calling user must have sufficient roles to access the data in the table named in the request. A request can be well formed and still fail on permissions. For how roles and access are designed across an integration, see the security and access design guide. The sysparm_query_no_domain parameter, which appears in the DELETE, GET list, GET by sys_id, PATCH and PUT operations, is limited to system administrators and to users with the query_no_domain_table_api role. To get a token for the calling user, see how to get an OAuth token with Postman.
A worked example of the full address
Consider a read of incidents with a short field list and a page size. The address is the instance address followed by /api/now/table/incident. The query string sets sysparm_fields to a short list such as number and short_description, and sysparm_limit to the page size. The response is a result array, and the Link header carries the relative URL for the next page when it is kept. Asking for application/xml in the Accept header changes the response format and leaves the path as it is.
To fetch one incident, append its sys_id to the same path and send a GET. To change one field on it, send a PATCH to that record path with a body containing the field name and its new value.
Frequently asked questions
Is the version segment required in a Table API URL?
No. It is optional and used when a version other than the latest is wanted. Without it, the request uses the latest version.
What comes back when a query matches nothing?
Version 2 returns a 200 response with an empty result array; version 1 returns 404 with no results.
How do I get the next page of results?
Follow the next relative URL in the Link header, or advance sysparm_offset by the page size on each call.
Can I insert several records in one POST?
No. The POST operation inserts one record per call, and multiple record insertion is not supported by that method.
Why might a page contain fewer records than the limit?
The limit is applied before access control lists are evaluated, so records the calling user cannot see still count toward it and are then removed.
What happens when part of a sysparm_query is malformed?
By default the invalid part is ignored and the rest of the filter runs. The glide.invalid_query.returns_no_rows property makes the call return no rows instead.