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

# Call APIs with External Request

> Use the External Request block in Fliqr AI Flows to GET or POST to your APIs and map JSON responses into custom fields.

**External Request** lets a Flow call an HTTP API mid-conversation. Use it to look up orders, load options, create tickets, or sync CRM data — then continue the script with the result.

## When to use it

* Fetch account or order status for a contact
* Load dynamic multiple-choice options from your backend
* Create a row in your system when a lead qualifies
* Validate a coupon or appointment slot before confirming

For platform **event push** to your server (flow completed, new message), see [Webhooks](/docs/integrations/webhooks). External Request is the opposite direction: the Flow pulls or posts during a run.

## Build an External Request

<Steps>
  <Step title="Prepare the endpoint">
    Use HTTPS. Decide method (`GET` or `POST`), headers, and auth (API key, bearer token, etc.).
  </Step>

  <Step title="Add the block">
    In Flow Builder, add **External Request**. Set URL, method, and headers. Use `{{field}}` placeholders in query/body when you need contact data.
  </Step>

  <Step title="Map the response">
    Parse JSON paths into custom fields (for example save `data.status` → `order_status`).
  </Step>

  <Step title="Branch on success and failure">
    Add paths for HTTP success vs error/timeout. Never assume the API always returns 200.
  </Step>

  <Step title="Test with real payloads">
    Run **Test Flow** with sample contact fields and confirm mappings.
  </Step>
</Steps>

## Response mapping example

Example API body:

```json theme={null}
{
  "success": true,
  "base": "EUR",
  "rates": {
    "USD": 1.23396,
    "GBP": 0.882047
  }
}
```

To show the USD rate, map `rates.USD` → a custom field (for example `usd_rate`). You do **not** need to prefix JSONPath with `x.` — use the path as it appears in the response.

Test the request, copy the JSON, and validate paths with a [JSONPath finder](https://www.site24x7.com/tools/jsonpath-finder-validator.html).

Another example for [Dynamic choices](/docs/core-concepts/flows/dynamic-choices):

```json theme={null}
{
  "data": ["Blue", "White", "Black", "Yellow", "Red"]
}
```

Map `data` into the options custom field.

### Special mapping paths

| Path                                     | Saves                 |
| ---------------------------------------- | --------------------- |
| `http_status_code`                       | HTTP status code      |
| `http_response_body`                     | Full response body    |
| `http_download_mp3` (or other extension) | Downloaded media file |

Branch on `http_status_code` with a [Condition](/docs/core-concepts/flows/conditions) when you need custom error handling.

### Two ways to show API data

1. **Map → custom fields → messages** — best for third-party APIs you do not control.
2. **[Dynamic content](/docs/core-concepts/flows/dynamic-content)** — your API returns ready-to-send `messages` / `actions` JSON that Fliqr AI delivers on every channel.

## Design rules

<Warning>
  Do not put long-lived secrets in message text. Prefer server-side auth headers configured in the block, and rotate keys if they leak.
</Warning>

* Keep payloads small; store only fields you will use.
* Set clear error messages for contacts when the API fails.
* Prefer idempotent server endpoints for retries.
* Log correlation IDs on your side for support debugging.

## Related integrations

| Need                                | Doc                                        |
| ----------------------------------- | ------------------------------------------ |
| Receive Fliqr events on your server | [Webhooks](/docs/integrations/webhooks)         |
| No-code connectors                  | [Zapier & Make](/docs/integrations/zapier-make) |
| Google Sheets and similar           | Integrations section (native connectors)   |

## Next

<CardGroup cols={2}>
  <Card title="Dynamic content" icon="code" href="/docs/core-concepts/flows/dynamic-content">
    Return messages and actions from your API.
  </Card>

  <Card title="Extract JSON" icon="file-code" href="/docs/core-concepts/flows/extract-json">
    Split JSON into multiple custom fields.
  </Card>

  <Card title="Dynamic choices" icon="list" href="/docs/core-concepts/flows/dynamic-choices">
    Turn API arrays into multiple-choice options.
  </Card>

  <Card title="Common errors" icon="triangle-exclamation" href="/docs/core-concepts/flows/common-errors">
    Fix External Request and delivery failures.
  </Card>
</CardGroup>
