Table API
-
- UpdatedFeb 2, 2023
- 23 minutes to read
- Utah
- API reference
Table API
The Table API provides endpoints that allow you to perform create, read, update, and delete (CRUD) operations on existing tables.
The calling user must have sufficient roles to access the data in the table specified in the request.
Table - DELETE /now/table/{tableName}/{sys_id}
Deletes the specified record from the specified table.
URL format
Versioned URL: /api/now/{api_version}/table/{tableName}/{sys_id}
Default URL: /api/now/table/{tableName}/{sys_id}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the
endpoint to access. For example, v1 or
v2. Only specify this value to use an endpoint version
other than the latest.
Data type: String |
sys_id | Sys_id of the record to delete. Data type: String |
tableName | Name of the table from which to delete the specified record, such as "incident"
or "asset". Data type: String |
Name | Description |
---|---|
sysparm_query_no_domain | Flag that indicates whether to restrict the record search to only the domains for which the logged in user is configured. Valid values:
Data type: Boolean Default: false Note: The sysparm_query_no_domain parameter is available only to system administrators or users who have the query_no_domain_table_api
role. |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
204 | Indicates that the request completed successfully. |
Response body parameters (JSON or XML)
Name | Description |
---|---|
None |
Example: cURL request
Delete a record from the Incident table.
There is no response body.
Table - GET /now/table/{tableName}
Retrieves multiple records for the specified table.
For basic instructions, see Retrieve existing incidents.
URL format
Versioned URL: /api/now/{api_version}/table/{tableName}
Default URL: /api/now/table/{tableName}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the
endpoint to access. For example, v1 or
v2. Only specify this value to use an endpoint version
other than the latest.
Depending on the version, this endpoint returns different results on a valid query.
Data type: String |
tableName | Name of the table from which to retrieve the records. Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
Link | Relative URLs, based on the previous request, that you can use to page through the available record set. For example:
|
X-Total-Count | Total count of records returned by the query. |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Request completed successfully. If a valid query returned no results, the response body contains only an empty result array. |
Response body parameters (JSON or XML)
Parameter | Description |
---|---|
name-value pairs | Field names and values of all parameters within the specified record or those specified in the query parameters. |
Example: cURL request
Retrieve the first record from the Problem table.
The response contains the name-value pairs for the requested record.
Table - GET /now/table/{tableName}/{sys_id}
Retrieves the record identified by the specified sys_id from the specified table.
URL format
Versioned URL: /api/now/{api_version}/table/{tableName}/{sys_id}
Default URL: /api/now/table/{tableName}/{sys_id}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the
endpoint to access. For example, v1 or
v2. Only specify this value to use an endpoint version
other than the latest.
Data type: String |
sys_id | Sys_id of the record to retrieve. Data type: String |
tableName | Name of the table from which to retrieve the record. Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
404 | Not found. The requested item was not found. |
Response body parameters (JSON or XML)
Parameter | Description |
---|---|
name-value pairs | Field names and values of all parameters within the specified record or those specified in the query parameters. |
Example: cURL request
Retrieve a record from the Incident table.
The response contains the name-value pairs for the requested record.
Table - PATCH /now/table/{tableName}/{sys_id}
Updates the specified record with the name-value pairs included in the request body.
URL format
Versioned URL: /api/now/{api_version}/table/{tableName}/{sys_id}
Default URL: /api/now/table/{tableName}/{sys_id}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the
endpoint to access. For example, v1 or
v2. Only specify this value to use an endpoint version
other than the latest.
Data type: String |
sys_id | Sys_id of the record to update. Data type: String |
tableName | Name of the table in which to the specified record is located. Data type: String |
Name | Description |
---|---|
name-value pairs | Field name and the new value for each parameter to update in the specified
record. Note: All fields within a record may not be available for update. For
example, fields that have a prefix of "sys_" are typically system parameters that
are automatically generated and cannot be updated. |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
X-no-response-body | By default, responses include body content detailing the modified record. Set this request header to true to suppress the response body. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
404 | Not found. The requested item was not found. |
Response body parameters (JSON or XML)
Name | Description |
---|---|
name-value pairs | Field names and values of all parameters within the specified record or those specified in the query parameters. |
Example: cURL request
Update a record in the Incident table.
The response contains the name-value pairs for the updated record.
Table - POST /now/table/{tableName}
Inserts one record in the specified table. Multiple record insertion is not supported by this method.
URL format
Versioned URL: /api/now/{api_version}/table/{tableName}
Default URL: /api/now/table/{tableName}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the
endpoint to access. For example, v1 or
v2. Only specify this value to use an endpoint version
other than the latest.
Data type: String |
tableName | Name of the table in which to save the record. Data type: String |
Name | Description |
---|---|
name-value pairs | Field name and the associated value for each parameter to define in the
specified record. Note: All fields within a record may not be available for update.
For example, fields that have a prefix of "sys_" are typically system parameters
that are automatically generated and cannot be updated. Fields that are not
specified and not auto generated by the system are set to the associated data type's
null value. |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
X-no-response-body | By default, responses include body content detailing the new record. Set this header to true in the request to suppress the response body. |
Header | Description |
---|---|
Location | Location of the created resource. |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
201 | Indicates that the request completed successfully. |
400 | Bad Request. A bad request type or malformed request was detected. |
404 | Not found. The requested item was not found. |
Response body parameters (JSON or XML)
Name | Description |
---|---|
name-value pairs | Field names and values of all parameters within the newly created record or those specified in the query parameters. |
Example: cURL request
Insert a new record into the Incident table.
The response contains the name-value pairs for the new record.
Table - PUT /now/table/{tableName}/{sys_id}
Updates the specified record with the request body.
URL format
Versioned URL: /api/now/{api_version}/table/{tableName}/{sys_id}
Default URL: /api/now/table/{tableName}/{sys_id}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the
endpoint to access. For example, v1 or
v2. Only specify this value to use an endpoint version
other than the latest.
Data type: String |
sys_id | Unique identifier of the record to update. Data type: String |
tableName | Name of the table in which the record is located. Data type: String |
Name | Description |
---|---|
name-value pairs | Name-value pairs for the field(s) to update in the associated table. For
example, to update the short description file, enter a name-value pair similar to
the following: --data "{\"short_description\": \"my short desc\" }"
\ . |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the request body. Supported types: application/json or application/xml. |
X-no-response-body | By default, responses include body content detailing the modified record. Set this header to true in the request to suppress the response body. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
404 | Not found. The requested item was not found. |
Response body parameters (JSON or XML)
Name | Description |
---|---|
name-value pairs | All fields (not just modified) with their associated values for the change request. |
Example: cURL request
Update a record in the Incident table.
The response contains the name-value pairs for the updated record.