# Using FieldSwap with Make.com

FieldSwap doesn't have an official Make app yet, but you can call it from any
scenario today using the built-in **HTTP** module. This guide wires a single
enrichment lookup into a scenario — no code required.

This covers the enrichment (action) direction only: something happens in another
app → FieldSwap resolves a field → the result is used downstream. A
FieldSwap-as-a-trigger integration isn't available yet.

---

## What you'll build

A scenario that takes an identity value from an earlier module — say the email
address on a new CRM lead — sends it to FieldSwap, and gets a resolved field back
(a phone number, an employer, a deliverability score, …) to use in later modules
such as updating the record or routing the lead.

FieldSwap is the **action** in the middle of your scenario. The trigger ("watch
HubSpot contacts", "watch Google Sheets rows", …) and the final write-back module
are whatever apps you already use.

---

## Before you start

You need two things:

- A FieldSwap workspace with available credits.
- An API key. Create one in the **API keys** tab of the dashboard — it looks
  like `fs_live_…` and is shown only once, so paste it somewhere safe before
  leaving the page.

> **Store the key as a connection or a data store,** not inline in a note. Treat
> it like a password — anyone with the key can spend your credits.

---

## Add the HTTP module

Add a module and pick **HTTP → Make a request**. Configure it like this:

| Field | Value |
|---|---|
| URL | `https://api.fieldswap.founderscale.com/v1/lookup` |
| Method | `POST` |
| Headers | Add one header — `Authorization` with value `Bearer fs_live_<your_key>`. (`X-Api-Key` works too.) |
| Body type | Raw |
| Content type | JSON (application/json) |
| Parse response | Yes |

In **Request content**, paste the JSON below, then map the field from your
trigger module in place of the email value (shown here as `{{lead_email}}`):

```json
{
  "input":  { "type": "email", "value": "{{lead_email}}" },
  "output": "phone"
}
```

Set `input.type` to whatever you're sending (`email`, `phone`, `linkedin`,
`full_name`, `ip`) and `output` to the field you want back. The full list is in
the [Field types](/docs#fields) reference.

> **Turn on "Parse response"** so Make reads the JSON reply and exposes
> `output.value.phone_e164` as a mappable field in later modules. Without it
> you'd get a raw string you'd have to parse yourself.

---

## Use the result

Run the scenario once. With **Parse response** on, FieldSwap's reply becomes
mappable fields:

```json
{
  "request_id": "8f1d2c20-…",
  "person_id":  "0a4e5b66-…",
  "output": {
    "type": "phone",
    "value": { "phone_e164": "+14155551234" },
    "fresh": true
  },
  "hit_source": "vendor",
  "credits_remaining": 9847,
  "status": "ok"
}
```

The resolved value lives under `output → value`. Map `output: value: phone_e164`
into your write-back module. Each output type has its own shape — see
[Field types](/docs#fields).

---

## Guard against empty results

FieldSwap returns `200 OK` even when it has no data, so always check the `status`
field rather than relying on the HTTP status. Add a **Filter** on the link
leaving the HTTP module that only continues when:

```
status   (Text operator: Equal to)   ok
```

A status of `not_found` means we identified the person but no vendor had the
requested field; `opt_out` means the person opted out of enrichment. In both
cases `output` is empty and there's nothing to write back.

---

## Credits & rate limits

Every lookup costs **1 credit**, whether or not a value comes back — you pay per
query, not per match. To avoid burning credits on rows that can't be enriched,
put a Filter *before* the HTTP module (e.g. only run when the email field isn't
empty).

Requests are rate-limited to **60 per minute per workspace**, shared across all
your API keys. For large batches, lower the scenario's number of consecutive
cycles or add a **Sleep** module; on a `429` Make's built-in error handling can
retry. For sustained higher volume, contact us to raise the limit.

---

## Troubleshooting

| You see | What it means |
|---|---|
| `401` | API key missing, mistyped, or revoked. Re-check the `Authorization` header. |
| `400` | The input value couldn't be parsed (e.g. not a valid email or phone). Check the field you mapped. |
| `402` | Out of credits, or your daily provider spend cap was reached. Top up or raise the cap in Billing. |
| `429` | Rate limit hit. Slow the scenario down or add a Sleep module; honor the `Retry-After` header. |

Every response carries an `x-request-id` header — quote it when you email
[support@fieldswap.io](mailto:support@fieldswap.io).
