---
sourceDocument: Australia API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Message variable substitution

# Variable substitution in outbound REST messages {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

You can use variables when creating outbound REST messages and assign values to those variables when performing a request.

Variables are allowed in the Endpoint URL, HTTP Header and HTTP Query Parameter Value fields, and the Content field for POST and PUT methods.

The syntax for variables is <var class="keyword varname">${variable_name}</var>. The REST message substitutes this variable with the parameter values provided when the method runs. For example, if the REST message Endpoint is
http://myserver.mycompany.com/offices/${id}, a parameter named id must exist and contain a value that can be used when the method runs.

You can assign a value to variables when running the request using the RESTMessageV2 API setStringParameter and setStringParameterNoEscape methods.

When testing an HTTP method that includes variables, the Test value for each variable in the Variable Substitutions related list is used.
* **[Generate REST message variables](https://www.servicenow.com/docs/3wof92qkOg6oLlrRDrkJTA)**   
  Populate the list of variable substitutions automatically based on variables defined in several REST message HTTP method fields.

