ServiceNow REST API
servicenow.com · Company
REST API for ServiceNow — the leading IT Service Management and workflow automation platform. Access incidents, changes, problems, CMDB, service catalog, and any custom table. ServiceNow has a free Personal Developer Instance (PDI) program.
Authentication
Sample Requests
Returns incident records. Filter with sysparm_query using ServiceNow encoded query format.
Hover any highlighted part to learn what it does
| Accept | application/json |
| Authorization | Basic BASE64_USER_PASS |
curl -X GET "https://{instance}.service-now.com/api/now/table/incident?sysparm_limit=10&sysparm_query=active%3Dtrue&sysparm_fields=number%2Cshort_description%2Cstate%2Cpriority" \
-H "Accept: application/json" \
-H "Authorization: Basic YOUR_BASE64_CREDENTIALS"import requests
params = {
"sysparm_limit": "10",
"sysparm_query": "active=true",
"sysparm_fields": "number,short_description,state,priority"
}
headers = {
"Accept": "application/json",
"Authorization": "Basic YOUR_BASE64_CREDENTIALS"
}
response = requests.get(
"https://{instance}.service-now.com/api/now/table/incident",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://{instance}.service-now.com/api/now/table/incident');
url.searchParams.set('sysparm_limit', '10');
url.searchParams.set('sysparm_query', 'active=true');
url.searchParams.set('sysparm_fields', 'number,short_description,state,priority');
const response = await fetch(url, {
headers: {
'Accept': 'application/json',
'Authorization': 'Basic YOUR_BASE64_CREDENTIALS'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://{instance}.service-now.com/api/now/table/incident")
q := baseURL.Query()
q.Set("sysparm_limit", "10")
q.Set("sysparm_query", "active=true")
q.Set("sysparm_fields", "number,short_description,state,priority")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Basic YOUR_BASE64_CREDENTIALS")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://{instance}.service-now.com/api/now/table/incident")
uri.query = URI.encode_www_form({
"sysparm_limit" => "10",
"sysparm_query" => "active=true",
"sysparm_fields" => "number,short_description,state,priority"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["Accept"] = "application/json"
req["Authorization"] = "Basic YOUR_BASE64_CREDENTIALS"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://{instance}.service-now.com/api/now/table/incident?" . http_build_query([
"sysparm_limit" => "10",
"sysparm_query" => "active=true",
"sysparm_fields" => "number,short_description,state,priority"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"Accept: application/json",
"Authorization: Basic YOUR_BASE64_CREDENTIALS"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Creates a new incident record.
Hover any highlighted part to learn what it does
| Content-Type | application/json |
| Authorization | Basic BASE64_USER_PASS |
{
"impact": "1",
"urgency": "1",
"category": "hardware",
"short_description": "Server is down"
}
curl -X POST "https://{instance}.service-now.com/api/now/table/incident" \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_BASE64_CREDENTIALS" \
-H "Content-Type: application/json" \
-d '{"impact":"1","urgency":"1","category":"hardware","short_description":"Server is down"}'import requests
headers = {
"Content-Type": "application/json",
"Authorization": "Basic YOUR_BASE64_CREDENTIALS"
}
data = {
"impact": "1",
"urgency": "1",
"category": "hardware",
"short_description": "Server is down"
}
response = requests.post(
"https://{instance}.service-now.com/api/now/table/incident",
headers=headers,
json=data,
)
print(response.json())const url = 'https://{instance}.service-now.com/api/now/table/incident';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic YOUR_BASE64_CREDENTIALS'
},
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"impact": "1",
"urgency": "1",
"category": "hardware",
"short_description": "Server is down"
}),
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"bytes"
"encoding/json"
)
func main() {
targetURL := "https://{instance}.service-now.com/api/now/table/incident"
jsonData, _ := json.Marshal({"impact":"1","urgency":"1","category":"hardware","short_description":"Server is down"})
req, _ := http.NewRequest("POST", targetURL, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Basic YOUR_BASE64_CREDENTIALS")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://{instance}.service-now.com/api/now/table/incident")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req["Authorization"] = "Basic YOUR_BASE64_CREDENTIALS"
req["Content-Type"] = "application/json"
req.body = "{\"impact\":\"1\",\"urgency\":\"1\",\"category\":\"hardware\",\"short_description\":\"Server is down\"}"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://{instance}.service-now.com/api/now/table/incident";
$opts = ["http" => [
"method" => "POST",
"header" => implode("\r\n", [
"Content-Type: application/json",
"Authorization: Basic YOUR_BASE64_CREDENTIALS",
"Content-Type: application/json"
]),
"content" => json_encode({"impact":"1","urgency":"1","category":"hardware","short_description":"Server is down"}),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Get a FREE Personal Developer Instance at https://developer.servicenow.com — no credit card needed
- Your instance URL: https://{instance}.service-now.com
- In Postman, set Authorization to Basic Auth with admin credentials
- Table API: /api/now/table/{table_name} — works for any ServiceNow table
- Use sysparm_query for filtering: field=value^ANDfield2=value2
- Use sysparm_fields to limit returned columns and reduce payload size
- Download official Postman collection at https://developer.servicenow.com
What can you build with ServiceNow REST API?
ServiceNow REST API is a Company API. Developers commonly use company APIs for:
- enriching CRM records with company firmographics
- building lead-generation and prospecting tools
- verifying business identity and registration details
- monitoring competitors and market intelligence
- powering B2B data enrichment pipelines
Basic authentication. Send your username and password (Base64-encoded) in the Authorization header. Always use HTTPS — Basic auth over plain HTTP exposes your credentials. ServiceNow REST API is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?