# HTTP API

### Overview

The Call API integration allows you to make HTTP requests to any external API directly from a Decimal workflow. It acts as a universal connector when a native integration is not available or when you need full control over request structure.

This integration is commonly used to:

* Connect third-party services
* Fetch or push data to external systems
* Trigger internal or external workflows
* Extend Decimal beyond prebuilt integrations

Call API works as a workflow node and can be combined with logic, variables, and transformation nodes.

***

### Available Module

#### Call API

Makes an HTTP request to a specified URL using standard HTTP methods and stores the response in a workflow variable.

Supported request types include:

* GET
* POST
* PUT
* PATCH
* DELETE

***

### When to Use Call API

Use Call API when:

* A native integration does not exist
* You need custom headers or authentication
* You are building flexible or experimental workflows<br>

For common or repeated use cases, native integrations are recommended where available.

***

### Adding Call API to a Workflow

1. Open the Decimal workflow editor
2. Add a Trigger node
3. From Integration, select Call API
4. Connect the Call API node to your trigger\ <br>

Once added, the Call API Settings panel opens automatically.

![](https://1786796420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPrg38tsZBv433URqRSSf%2Fuploads%2F1C3t1Lz3pAPOPkUqSUqi%2Funknown.png?alt=media\&token=9ac0d3d8-0ec3-4bdf-b687-c23b89ff4900)

***

### Module Configuration

#### HTTP Method

Select the HTTP method for the request.

Supported options:

* GET – Fetch data
* POST – Send data
* PUT – Update data
* PATCH – Partially update data
* DELETE – Remove data<br>

Choose the method based on the API you are calling.

***

#### URL

Enter the full endpoint URL for the request.

**Example**:

*<https://api.example.com/data>*

This field is required.\
If left empty, the node will not execute.

***

#### Headers

Headers allow you to pass metadata and authentication information with the request.

**Default Header**

* Content-Type: application/json

This header is enabled by default and can be modified or removed if needed.

**Optional Headers**

* Authorization – Commonly used for API keys or Bearer tokens
* User-Agent – Used by some APIs for request identification\ <br>

You can:

* Enable or disable headers using the checkbox
* Edit header values
* Remove headers using the ❌ icon
* Add additional headers using + Add Header

***

#### Request Body

The request body is used for:

* POST
* PUT
* PATCH

Enter a valid JSON payload.

**Example**:

<mark style="color:$primary;">{</mark>

&#x20; <mark style="color:$primary;">"key": "value"</mark>

<mark style="color:$primary;">}</mark>

For GET requests, the request body is ignored.

![](https://1786796420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPrg38tsZBv433URqRSSf%2Fuploads%2F69DysgfOX0XMBP6gh8LN%2Funknown.png?alt=media\&token=8b40fde1-b617-49cb-b6f3-ceff8172a174)

***

#### Result Variable Name

Define the variable name that will store the HTTP response.

Default example:

*httpResult*

This variable becomes available to all downstream nodes in the workflow.

***

### Output & Variables

After execution, the response from the API is stored under the specified result variable.

Typical response data includes:

* Status code
* Response body
* Headers (if supported)\ <br>

**Example usage in downstream nodes:**

*httpResult.body*

*httpResult.status*

This data can be:

* Passed to logic nodes (If Else)
* Transformed using Run Code
* Stored using Set Variable
* Used to trigger further actions

***

### Example Workflow

Use Case: Fetch data from an external API and process it.

Workflow:

1. Trigger
2. Call API
3. If Else (check response)
4. Run Code or Set Variable

This allows you to build API-driven workflows without external services or scripts.

<br>
