Skip to navigation

HTTP Actions

View as Markdown

HTTP Actions make API calls to your business systems so you can build automations. They can be chained together in Compound Actions.

HTTP Actions can be used to call both SOAP and REST APIs. Moveworks recommends using REST APIs with JSON payloads whenever possible for ease of configuration, and debugging purposes.

Set up an HTTP Action

You are able to setup an HTTP Action two ways:

  1. [Recommended] Import the entire HTTP Request via cURL.
  2. Manually select/create a connector + setup the API Request

Import from cURL

Warning
  1. Importing cURL will overwrite all of the current work you have in the HTTP Editor.

  2. If the Request you are trying to import uses a 2-step Auth method like OAuth 2.0, then you will have to set up the connector manually AFTER importing cURL.

Import steps

  1. Get your cURL command:

    1. You can typically find cURL commands in the API documentation for the source system you are trying to integrate with

    2. You can export your Postman requests to curl by clicking the </> icon on the right toolbar in Postman


  2. Click Import cURL

  3. Paste your cURL command into the text box.

  4. Double check everything is imported the way you expected.

Set up an HTTP Action manually

Before you set up manually

Please make sure to setup the connector for this action. For more information, see Connectors Help Documentation

Manual setup steps

If you’re manually configuring your API, you can do so by editing:

  1. Method - We support GET, POST, PUT, DELETE, and PATCH methods.
  2. Endpoint URL - This is the rest of the URL path starting from the end of the Base URL. It must start with a /.
    • Note: The Connector’s Base URL and the inputted Endpoint URL are combined to create the full Request URL.
  3. Headers - All request headers must be added to this table.
  4. Query Params - All query parameters must be added to this table. They cannot be saved in the Endpoint URL.
  5. Body - All body content must be added to this text box.
    • Note: If you want to use Content-Type: x-www-form-urlencoded , you have to convert the data to the following format: key=value&key2=value2

Use variables

Insert variables

You can use variables anywhere in the Headers, Params, Body, or Endpoint URL. They can also be used in JWT Connector Claims.

  • You insert variables by using {{{VARIABLE_NAME}}}.
  • You can also reference values from the HTTP action’s data bank, such as the current user. See Data bank and data mapper concepts.
    "{{{meta_info.user.email_addr}}}"

You can check variable names by clicking the Input Args button. See also our User Attributes Reference.

Escape variables

By default all variables will be HTML escaped. This follows the Mustache templating language.

Pro Tip!

You can use {{{VARIABLE_NAME}}} if you need avoid HTML escaping the content of the variable.

Test your API

If you use a variable in the request and want to test your API, then you must add an example value to the variable by clicking the Input Args button.

️

This does not apply to User Attributes. User Attributes will pull from the information of the current user who is logged in and configuring the request.

Once all your variables are configured, click Test to kick off a request with the example data you inputted via the Input Args button.

Response Schema

When you test an HTTP Action and save it, Moveworks creates a Response Schema from the test response. When a plugin runs the action, fields that aren’t in the schema can be dropped from the response before it reaches the caller of this action (for example, a compound action).

To view or edit the schema, toggle the Response Schema switch in the Response panel.

The Response panel of an HTTP Action after a test, with the generated Response Schema shown beside the response

Prune the response

To filter attributes out of your HTTP Action’s response, delete them from the Response Schema. The caller receives only the fields that remain in the schema.

Allow any response

The generated schema describes only the response you tested with. If the API can return fields that weren’t in that response, those fields can be dropped when the plugin runs.

To return every response in full, replace the Response Schema with an empty object:

{}

With an empty object as the schema, the action accepts any response and returns it with no truncation and no data removed.

An HTTP Action whose Response Schema is set to an empty object

Save the HTTP Action

When you choose to save the action, you will specify an Action Name. In Pre-April 2025 versions of the Plugin Workspace, you will reference this Action Name in subsequent Compound Actions as the action.action_name.

In Post-April 2025 versions of the Plugin Workspace, you will be able to either reference the action inside of a compound action, or you can reference the action directly in a plugin as an action activity.

If you created a new connector in the HTTP editor, you’ll also be prompted to provide a connector name.

Troubleshooting

My HTTP Action is failing

  1. Check our logs to understand why.
  2. Requests will timeout after 60 seconds with no response from the requested server.

Pass an array through the POST body

If you wish to pass an array through the POST body of an action, refer to the following steps:

  1. In the action body itself, refer to the array in triple braces without any quotes. For example:

{{{meeting_attendee_list}}}

no quotes.

  1. When you create inputs in the compound action, you need to stringify the array. For example your input arg would be:
1. data.input.$STRINGIFY_JSON()