> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useparagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Making API Requests

> Making HTTP requests with Paragon

## Overview

You can make requests to any HTTP API using Paragon's Request steps. This is useful for connecting workflows to your application's internal API, the integration's API, or to any REST APIs in general.

## Types of Requests

<CardGroup>
  <Card title="Integration Requests" icon="plug" href="/workflows/requests#making-integration-requests" cta="Learn more" img="/assets/An Integration Request in Paragon.png">
    Make authenticated requests directly to integration providers' APIs using pre-configured connections.
  </Card>

  <Card title="API Requests" icon="globe" href="/workflows/requests#making-api-requests" cta="Learn more" img="/assets/An API Request in Paragon.png">
    Make HTTP requests to any external API or your own application's API. Perfect for external calls and connecting to internal services.
  </Card>
</CardGroup>

## Making Integration Requests

The **Integration Request** is a per-integration step that allows you to make HTTP calls to any endpoint the integration supports. This means you can access actions that aren't yet supported natively by Paragon.

<Frame>
  <img src="https://mintcdn.com/paragon/867oBBVpxd2C3zc4/assets/Using%20the%20Integration%20Request%20step%20for%20Slack%20in%20Paragon%20Connect.png?fit=max&auto=format&n=867oBBVpxd2C3zc4&q=85&s=52e78e2bb34e0b571b3a9fcc97778fb7" alt="" width="1934" height="1198" data-path="assets/Using the Integration Request step for Slack in Paragon Connect.png" />
</Frame>

### Configuring the Authentication

We've got you covered! You can leave out the authentication piece to connect to your integration's API since you've connected using Paragon. We prefix the URL of each integration, so you only have to enter the API endpoint and any parameters.

### Replacing the Base URL

If you need to overwrite the default base URL Paragon provides for any request you make to the integration provider, you can do so by typing `https://` in the input followed by the rest of the URL.

<Frame>
  <img src="https://mintcdn.com/paragon/cqJFSKyZXJDp3p3z/assets/Replacing%20the%20Base%20URL%20for%20an%20integration%20in%20Paragon%20Connect.gif?s=8249fbf536a6c6020239e3c914b64f22" alt="" width="1082" height="598" data-path="assets/Replacing the Base URL for an integration in Paragon Connect.gif" />
</Frame>

## Making API Requests

To add a request to your workflow, click the "+" button in the workflow canvas and choose the Request step from the sidebar. You can follow familiar specifications to setup requests in Paragon:

* URL
* Request type
  * `POST`
  * `GET`
  * `PATCH`
  * `PUT`
  * `DELETE`
* Request data
  * Query parameters
  * Headers
  * Body parameters
    * `JSON`
    * `multipart/form-data`
    * `x-www-form-urlencoded`
    * `GraphQL`
    * `XML`
    * `Raw`
  * Authorization
    * `Bearer Token`
    * `Basic Auth`
    * `Query Params`
    * `Auth Header`
    * `OAuth 2.0 Client Credentials`
    * `OAuth 2.0 Refresh Token`
    * `ROPC Access Token`

### Configuring your Request URL

You can enter the request URL in the input under "**Request URL"**. You can also include parameters as part of the URL by typing `{{` to invoke the variable menu.

<Frame>
  <img src="https://mintcdn.com/paragon/7RZyQGncIlY8Xl4A/assets/Including%20parameters%20in%20a%20URL%20request%20in%20Paragon.png?fit=max&auto=format&n=7RZyQGncIlY8Xl4A&q=85&s=40df3fd064a319b52870155359bbc3d1" alt="" width="2250" height="558" data-path="assets/Including parameters in a URL request in Paragon.png" />
</Frame>

The **variable menu** allows you to reference data from upstream steps in your request URL. For example, we can pass a `userId` from the Trigger into the request URL, which is represented as: `/users/{{1.event.userId}}`

### Sending data in a request

Query parameters, headers, and body parameters can be included in the request by adding them in the key-value table under their respective heading.

<Frame>
  <img src="https://mintcdn.com/paragon/HSp5hB8tE4Z6e44m/assets/Sending%20a%20JSON%20request%20in%20Paragon.gif?s=95c72eb253d7bc9c145a67ee00398b17" alt="" width="964" height="487" data-path="assets/Sending a JSON request in Paragon.gif" />
</Frame>

When using the key-value table, you can type in **static values** or **reference variables** from upstream steps by invoking the variable menu using the dropdown button.

### Sending JSON in a request

You can easily send JSON in a request by choosing `Raw` in the dropdown to the right of Body. When creating the raw JSON body, you can type in **static values** or **reference variables** from upstream steps by typing `{{` to invoke the variable menu.

<Frame>
  <img src="https://mintcdn.com/paragon/HSp5hB8tE4Z6e44m/assets/Sending%20nested%20JSON%20through%20a%20Request%20step%20in%20Paragon.png?fit=max&auto=format&n=HSp5hB8tE4Z6e44m&q=85&s=8967cc678ff5f24af5c29dcff4d3951f" alt="" width="1938" height="736" data-path="assets/Sending nested JSON through a Request step in Paragon.png" />
</Frame>

### Sending File Data in a request

You can send file data in a request by adding a `X-Paragon-Encoding` header. The encoding should be set to encoding used in the file, like `hex`.

<Frame>
  <img src="https://mintcdn.com/paragon/HSp5hB8tE4Z6e44m/assets/Sending%20files%20to%20your%20application%20in%20Paragon%20Connect.png?fit=max&auto=format&n=HSp5hB8tE4Z6e44m&q=85&s=bebafc43ebe2777f1bd26f896180be2b" alt="" width="2198" height="1210" data-path="assets/Sending files to your application in Paragon Connect.png" />
</Frame>

### Handling request failures

You can choose whether or not the workflow should continue to the next step if the request fails under "Continue workflow if request fails". This option is useful if you want to conditionally handle request failures. You can do this by adding a Conditional step after the Request step, then referencing the request's response status code in the Conditional.

<Frame>
  <img src="https://mintcdn.com/paragon/7RZyQGncIlY8Xl4A/assets/Handling%20request%20failures%20with%20a%20conditional%20step%20in%20Paragon.png?fit=max&auto=format&n=7RZyQGncIlY8Xl4A&q=85&s=8558443f81b8367c4831a028388f0385" alt="" width="2736" height="952" data-path="assets/Handling request failures with a conditional step in Paragon.png" />
</Frame>
