Skip to main content
Version: 1.28 (Current)

Raw Response

Audience: Low-code Engineers

Skill Prerequisites: APIs, Actions, Tokens

Returns content you write yourself as the response of an API endpoint, for example text, HTML, XML or JSON. You also set the HTTP status code and headers.

It ends the action list, so actions after it don't run.

The content type is text/html unless you add a Content-Type header.

Typical Use Cases​

  • Return a custom JSON or XML body, for example for a webhook that expects a specific format
  • Return an error with a status code such as 400 Bad Request or 404 Not Found
  • Return a custom error body from the API's On error actions
  • Return plain text, such as OK, or an HTML fragment

Don't use it to​

Action NameDescription
New Object as JSONReturns a JSON object built from name/value pairs.
Existing Object as JSONReturns one item of a list as JSON.
Existing List as JSONReturns the items of a list as a JSON array.
Download FileReturns a file with a file name and permission checks.
File ResponseReturns a file by its ID, with response caching.

Which response action should I use?​

You want to returnUse
Plain text, HTML, XML or JSON you write yourselfRaw Response
A JSON object built from name/value pairsNew Object as JSON
One item of a list as JSONExisting Object as JSON
The items of a list as a JSON arrayExisting List as JSON
A file, with a file name, permission checks and a download or preview optionDownload File
A file by its ID, with response cachingFile Response

If no action returns a response, the API returns the text Success.

Input Parameter Reference​

The parameters unique to this action are listed below. Review the common parameters for all actions here.

ParameterDescriptionSupports TokensDefaultRequired
ContentThe response body, for example {"status": "ok", "id": [OrderId]}. Token values are inserted as they are, without escaping. If it's empty, the body is empty.Yesempty stringNo
Http codeThe HTTP status code, optionally followed by a description, for example 201 or 404 Not Found. If it's empty, the status is 200.Yesempty stringNo
HTTP HeadersResponse headers, each with a Name and a Value, for example Content-Type = application/json. Both names and values support tokens.YesemptyNo

How the response is built​

  1. Each header is added to the response. If there's no Content-Type header, Content-Type: text/html is added.
  2. The status code is set from Http code. The number comes first. Anything after the first space is the status description. Without a description, the standard one is used, for example Not Found for 404.
  3. The content is written as the body.

Error status codes keep your body. IIS doesn't replace it with its own error page.

If Http code isn't a number, or doesn't start with one, the response fails. The caller gets a 400 JSON error that starts with The HTTP Code should have the following format: 'number message'.

Considerations​

  • Set the content type. For JSON, add a Content-Type header with application/json. For XML, use application/xml. For plain text, use text/plain. Write the header name as Content-Type. Other spellings, such as content-type, aren't recognized, and text/html is used instead.
  • Tokens aren't escaped. Token values are inserted into Content exactly as they are. In JSON, put text values in quotes, and make sure they can't contain quotes, backslashes or line breaks. In HTML, make sure values can't contain markup. When in doubt, use the JSON actions.
  • Use it in On error. A Raw Response in the API's On error actions replaces the default error response. The [ErrorMessage] token contains the error.
  • Response caching. When the API has Cache Response turned on, the response is cached for the same input parameter values and returned without running the actions. The cache doesn't depend on who's calling.
  • Final action. Only the first final action that runs returns the response. Use conditions to choose between several responses, for example a 404 when a record isn't found and a 200 otherwise.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Return a JSON confirmation​

This action returns a 201 Created status and a small JSON body with the new order's ID. The OrderId token must exist, for example from a previous Run SQL Query.

{
"Title": "Raw Response",
"ActionType": "RawResponse",
"Description": "Return the new order ID",
"Parameters": {
"Content": "{\"status\": \"created\", \"orderId\": [OrderId]}",
"HttpCode": "201 Created",
"Headers": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
}

2. Return 404 when a record isn't found​

This action returns a 404 Not Found with a plain text message when the CustomerName token is empty. Put it before the action that returns the normal response.

{
"Title": "Raw Response",
"ActionType": "RawResponse",
"Description": "Customer not found",
"Condition": "[CustomerName] == \"\"",
"Parameters": {
"Content": "Customer [CustomerId] was not found.",
"HttpCode": "404 Not Found",
"Headers": [
{
"name": "Content-Type",
"value": "text/plain"
}
]
}
}

Revised 09/27/2026