> For the complete documentation index, see [llms.txt](https://docs.bluestorm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bluestorm.io/administration/pipelines/call-api.md).

# Call API

The call API task enables you to call an external API and parse the output. This can be used for instance to run external tests, or trigger other system to run other tasks. The following options are available:

Note: The following variables can be used in the request URL / body, and the response URL / body:

* %%REVISION\_ID%% - The ID of the revision used for this release.
* %%BRANCH\_NAME%% - The name of the branch used for this release.
* %%MX\_APP\_ID%% - The Mendix App ID of the app used for this release.
* %%ENVIRONMENT\_ID%% - The environment ID of the environment used for this release.
* %%APP\_URL%% - The URL of the environment used for this release.
* **Proceed on Failure.** If enabled, the pipeline will continue executing when this step fails.
* **API call type:** Synchronous or Asynchronous. When 'Synchronous' is selected the API will be called and the response will be parsed directly to determine if it was successful. When 'Asynchronous' is selected, a second API will be polled to determine if the call was successful or is still being processed.&#x20;
* **Use Authentication.** If selected, the call will use authentication.
  * **Authentication:** The authentication method to use for authentication.
  * **Username:** The username to use for authentication.
  * **Password:** The password to use for authentication.
* **Use custom HTTP headers:** If selected, the call will use the custom HTTP headers that you configure. For each custom header you can specify the following:
  * **Name.** The name of the HTTP header.
  * **Value:** The value of the HTTP header.
* **Request operation:** Select the HTTP operation used by the API: GET or POST.
* **Request URL:** Enter the full URL used for the API request. The variables listed above can be used in the URL.
* **Request body:** For POST type requests, the HTTP body to be sent. The variables listed above can be used in the body.
* **Response operation:** Select the HTTP operation to be used for the response by the API: GET or POST. This option is only used when you have selected 'Asynchronous' for the API call type.
* **Response URL:** Enter the full URL used for the API response. The variables listed above can be used in the URL. This option is only used when you have selected 'Asynchronous' for the API call type. This is the URL that will be called to check the response of the initial API request.
* **Response body:** For POST type requests, the HTTP body to be sent. The variables listed above can be used in the body. This option is only used when you have selected 'Asynchronous' for the API call type. This is the body that will be sent to the API to check the status of the initial API request.
* **Timeout (s):** The timeout (in seconds) to be used for all API calls.
* **Success check:** The Regex to be used to determine if the API call succeeded. This is used for both synchronous and asynchronous API calls and will be used to parse the response from the API request. Use a regex that is supported by the Mendix *isMatch()* string function. For synchronous calls, if you leave this empty the call will be successful if an HTTP 2XX status code is returned.
* **Processing check:** The Regex to be used to determine if the API call is still being processed. This is used only for asynchronous API calls and will be used to parse the response from the API (as returned from the Response URL configured above). Use a regex that is supported by the Mendix *isMatch()* string function.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bluestorm.io/administration/pipelines/call-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
