Scripted REST APIs
Expose custom, secured REST endpoints from your instance for other systems to call.
Where REST integrations let ServiceNow call out, Scripted REST APIs let ServiceNow be called. You define your own inbound endpoints, with custom paths, methods, query parameters and response shapes, so external systems integrate with exactly the contract you design, not raw table access.
- Anatomy
- When to build one
- Try it Yourself
Where REST integrations let ServiceNow call out, Scripted REST APIs let ServiceNow be called. You define your own inbound endpoints, with custom paths, methods, query parameters and response shapes, so external systems integrate with exactly the contract you design, not raw table access.
Anatomy
- API, the service, with a base path like
/api/x_acme/orders. - Resource, a method + relative path (e.g.
GET /{id}) with a script. - Request / Response,
request.pathParams,request.queryParams,request.body.data; build the reply onresponse.
/v1/) from day one so you can evolve the contract without breaking existing callers.When to build one
Use a Scripted REST API when the out-of-box Table API is too broad or the wrong shape, when you want to hide internal fields, aggregate data, or present a clean, documented contract to partners.
▸ Press Run to execute.
Runs in a sandbox in your browser. Mock gs and GlideRecord and sample data are provided.