What This Table Is

The sys_rest_message table stores the configuration data for outbound REST API integrations. Each record represents a complete REST message definition including endpoint URLs, authentication settings, HTTP headers, and connection parameters. These configurations are consumed by the RESTMessageV2 scripting class to make actual HTTP requests to external systems.

This table belongs to the Integration module and supports ServiceNow's outbound integration capabilities. Unlike inbound REST APIs (which use scripted REST resources), these records define how ServiceNow calls external services. The data flows from configuration → script execution → external API call, making this table the foundation for most enterprise integrations that push data out of ServiceNow.

The table does not extend any parent table and has one important child table: sys_rest_message_fn stores the individual HTTP methods (GET, POST, PUT, DELETE) for each REST message. A single REST message can have multiple HTTP methods, each with different parameters, request body templates, and response processing logic.

Most enterprises have 50-200 REST message records depending on their integration footprint. Performance is generally not a concern with this table since it's configuration data that's read during script execution rather than queried frequently. However, the actual REST calls configured here can become performance bottlenecks if not properly implemented with timeouts and error handling.

When You'll Script Against This Table

Direct queries against sys_rest_message are uncommon. Most developers work with this table indirectly through the RESTMessageV2 class, which automatically loads the configuration when you instantiate it with a REST message name. You'll typically script against this table in Business Rules, Script Includes, Scheduled Jobs, and Integration Hub flows when building dynamic integrations or managing REST message configurations programmatically.

Access to this table requires the rest_service role for read access and admin or rest_service_admin for write operations. The actual execution of REST messages through RESTMessageV2 can be done with lower privileges, but creating or modifying configurations requires elevated access.

  • Creating REST message configurations programmatically for multi-tenant integrations
  • Dynamically updating endpoint URLs based on environment (dev, test, prod)
  • Bulk updating authentication credentials across multiple REST messages
  • Auditing REST message usage and identifying unused integrations
  • Cloning existing REST messages with modified endpoints for testing
  • Setting up conditional REST endpoints based on record data or business logic
  • Implementing REST message configuration as code for deployment automation

Table Gotchas

⚠️

The endpoint field can contain variable substitutions like ${variable_name} but these are resolved at execution time, not when you query the table. The raw endpoint value in the database will still contain the unresolved variables.

⚠️

Authentication settings in the authentication_type and auth_profile_id fields are tightly coupled. Changing authentication_type without updating the corresponding auth_profile_id will cause REST calls to fail silently or with cryptic authentication errors.

  • The name field must be unique and is case-sensitive. Creating duplicate names will cause RESTMessageV2 to load the first match it finds, which may not be the one you expect.
  • REST message records are cached aggressively. Changes to endpoint or use_mid_server may not take effect immediately in running scripts. Restart the glide service or wait for cache expiration.
  • The accessible_from field controls scoped application access. Setting this to 'package_private' will prevent cross-scope REST message usage even if the calling script has elevated privileges.
  • Deleting a REST message record does not cascade delete its related sys_rest_message_fn records automatically in all versions. Always clean up HTTP method records manually to avoid orphaned data.
⚠️

Never query this table in loops or high-frequency operations. Use RESTMessageV2 constructor caching instead, or load configurations once and reuse them across multiple operations.

Free Newsletter

Enjoying this? Get one deep-dive per week.

Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.

No spam · Unsubscribe anytime

The sys_rest_message_fn table is the most important related table, storing individual HTTP methods for each REST message. You'll often join these tables when analyzing REST message configurations or building dynamic integration logic that needs to inspect available methods and their parameters.

Authentication-related queries frequently join with sys_auth_profile_basic, sys_auth_profile_oauth2, and other auth profile tables based on the authentication_type value. The ecc_queue table becomes relevant when use_mid_server is true, as REST calls are queued through the MID Server infrastructure. For audit and troubleshooting, sys_log often contains REST message execution logs that reference the message name.