# Custom API

Use **Custom API** when you want a workflow step to call an external HTTP endpoint from Fetch Hive and pass the response to later steps.

## Configuration

| Option                                                                                                               | Required | Description                                                                                     |
| -------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- |
| Name                                                                                                                 | No       | Label for the step in the workflow canvas.                                                      |
| API Method                                                                                                           | Yes      | HTTP method in **API Method**. Available values are `get` and `post`.                           |
| API URL                                                                                                              | Yes      | URL in **API URL**. This field supports workflow variables through **Insert Variable**.         |
| Headers                                                                                                              | No       | JSON string entered in **Headers**.                                                             |
| Body                                                                                                                 | No       | JSON string entered in **Body**. This field is only shown when **API Method** is `POST`.        |
| Retry Count                                                                                                          | No       | Number of retries in **Retry Count**.                                                           |
| When the step fails                                                                                                  | No       | Controls whether the workflow should **Terminate Workflow** or **Continue** if this step fails. |
| Add this step from the **Utilities** group in **Search steps...**. In the step picker, the label is **Call an API**. |          |                                                                                                 |

The settings sheet has separate fields for **API URL**, **Headers**, and **Body**. Each field can include values from **Inputs** or previous **Workflow Steps** with **Insert Variable**.

## Output

Click **Run** in the step header to test the request. Fetch Hive shows the response in **Output** after the run completes.

Use the variable picker in a later step to insert the exact response path available for that run. The base reference is:

```
{{STEP_IDENTIFIER.output}}
```

If you only need the full response payload, reference the base output directly:

```
{{step_2.output}}
```

If the response is a structured object, the variable picker shows the nested fields you can insert into later steps.

## Example

Add **Call an API** from the **Utilities** group in **Search steps...**.

Set **Name** to something like `Fetch customer profile`.

Choose **GET** or **POST** in **API Method**.

Enter the endpoint in **API URL**. If the endpoint needs data from earlier steps, click **Insert Variable** and add values such as `{{step_1.output.customer_id}}`.

If the request needs authentication or content headers, add them in **Headers** as JSON. If you use **POST**, add the request payload in **Body**.

Adjust **Retry Count** and choose what should happen in **When the step fails**.

Click **Run** and review the API response in **Output** before you wire that output into later steps.

## Notes

* The step picker label is **Call an API**, even though this page and file use **Custom API**.
* The deployment read-only view shows the URL, method, retry count, and failure behavior. It does not show the full headers or request body summary there.
* Use valid JSON in **Headers** and **Body** if your downstream API expects JSON payloads.

See also: [Creating and Editing](https://docs.fetchhive.com/workflows/creating-and-editing), [Testing and Iteration](https://docs.fetchhive.com/workflows/testing-and-iteration), and [Error Handling](https://docs.fetchhive.com/workflows/error-handling)
