# Bubble + Dizo

> Call Dizo from Bubble's API Connector with a private key in the header, then use enrichment and email finding as data sources or workflow actions.

Type: REST recipe — base URL `https://api.dizo.ai/v1`. No native app needed.

## Steps
1. In the **Plugins** tab, install Bubble's **API Connector** plugin and add a new API collection named Dizo.
2. Set **Authentication** to **Private key in header**: Key name `Authorization`, Key value `Bearer dz_live_...`, Development key value `Bearer dz_test_...`.
3. Add a call, set **Use as** to Action (or Data), method `POST`, the endpoint URL below, body type **JSON**, and a `Content-Type: application/json` header.
4. Tick **Include errors in response & allow workflow actions to continue**, then click **Initialize call** using sample values only.
5. Use the call from a workflow (Action) or from Get data from an external API (Data), and branch on the error fields when nothing is found.

## Where to go
In the editor: Plugins → install **API Connector** → add an API with a private `Authorization: Bearer` header.

Open the Bubble API Connector docs: https://manual.bubble.io/help-guides/integrations/api/the-api-connector

## API Connector: collection
```
API Name:               Dizo
Authentication:         Private key in header
Key name:               Authorization
Key value:              Bearer dz_live_...
Development key value:  Bearer dz_test_...
Shared headers:         Content-Type: application/json
```

## API Connector: Enrich company call
```
Name:       Enrich company
Use as:     Action
Method:     POST
URL:        https://api.dizo.ai/v1/companies/enrich
Body type:  JSON
Body:
{
  "domain": "<domain>",
  "max_credits": 1
}
Parameter:  domain = example.com  (sample value for Initialize call only)
[x] Include errors in response & allow workflow actions to continue
→ Initialize call
```

## Find an email (second call)
```
Name:    Find email
Use as:  Action
Method:  POST
URL:     https://api.dizo.ai/v1/email/find
Body:
{
  "first_name": "<first_name>",
  "last_name": "<last_name>",
  "company_domain": "<domain>",
  "max_credits": 1
}
```

## Notes
- Keep the key in **Private key in header** only. Bubble warns that private values in a collection using None or self-handled auth can be retrieved by anyone, including logged-out users.
- Initialization sends a real request. With a `dz_test_` key as the development key value you get synthetic data and spend nothing.
- A `404` from Dizo means not found and not charged. With the error option ticked, read the returned status code in your workflow instead of letting it stop.

## Related API docs
- [/docs/company-enrich](https://dizo.ai/docs/company-enrich.md)
- [/docs/email-find](https://dizo.ai/docs/email-find.md)
- [/docs/people-enrich](https://dizo.ai/docs/people-enrich.md)


## What Bubble is

Bubble is a visual builder for web apps. You design pages, define a database and wire behaviour together with workflows, all without writing code. Many founders use it to ship a first SaaS product, an internal tool or a customer portal, and some keep running real businesses on it long after the prototype stage.

Bubble talks to outside services through its API Connector plugin. You describe an API once as a collection, add one or more calls, and Bubble turns each call into either a data source you can display on a page or an action you can run inside a workflow. That is the piece this page relies on. There is no native Dizo plugin in the Bubble marketplace; you configure the connector yourself, which takes about ten minutes.

## Why connect Bubble to Dizo

Most Bubble apps collect a little information about a person or company and then need more. A sign-up form gives you an email and a domain. A CRM-style app holds names and companies but no contact details. A marketplace wants to know whether a buyer works at a real business before approving them. Dizo fills those gaps through REST calls that your Bubble app can make server side.

The billing model suits apps with unpredictable traffic. Dizo is pay as you go from one credit balance, and the lookups you will use most are charged only when they succeed. A [company enrich](/docs/company-enrich) costs 1 credit if the domain is matched, an [email find](/docs/email-find) costs 1 credit only if a validated work email comes back, and a miss returns `404 not_found` at no cost. You are not paying for empty results while your user base grows.

## What you can build

Each of these is a single API Connector call, or two chained in one workflow. They work equally well on a public app and on an internal admin tool.

- Enrich every new sign-up's company from the domain in their email, and store industry, headcount and HQ on the User.
- Add a Find email button to a contacts table that fills in the work address for a name and company.
- Re-identify contacts whose emails bounced, using person enrich at 2 credits per match, then look up a fresh work email at 1 credit if found.
- Show a company profile page built from domain to company, with funding stage and technologies.
- Let a sales user type a plain-English request such as "heads of RevOps at US fintechs" and list matching people from natural-language search.
- Flag sign-ups whose email does not resolve to a known person or company, as one input to your own review process.

## Setting up the API Connector

Open the Plugins tab, install the API Connector, and add a new API collection. Name it Dizo. Bubble notes that collection names end up in your app's client-side code, so keep anything sensitive out of the name.

Choose **Private key in header** as the authentication method. Bubble asks for a key name, which is the header to send, and a key value. Enter `Authorization` as the name and `Bearer dz_live_...` as the value, with the word Bearer and a space before the key, as Bubble's docs describe for providers that expect a prefix. Use the optional **Development key value** for a `dz_test_` key. Your development version then calls Dizo's sandbox, which returns synthetic data and never spends credits, while the live version uses the real key.

Add `Content-Type: application/json` as a shared header so every call inherits it. Then add your first call. Name it Enrich company, set **Use as** to Action if it will run in workflows, or Data if you want to bind the result to elements on a page. Choose POST, paste `https://api.dizo.ai/v1/companies/enrich`, and set the body type to JSON. In the body, wrap any value you want to set per request in angle brackets, as shown in the recipe above, and Bubble lists it as a parameter. Keep `max_credits` fixed in the body so no single call can spend more than you expect.

## Initializing and handling errors

Every Bubble call has to be initialized before you can use it. Initialization sends a real request, reads the response and creates typed fields for each value, including nested ones such as `company.hq.city`. Use sample values only. Bubble's docs point out that data entered here becomes part of the API schema in your app's source.

Before you initialize, tick **Include errors in response & allow workflow actions to continue**. Without it, a Dizo `404` for an unknown domain counts as a failure and the workflow stops. With it, Bubble lets the workflow carry on and exposes an error object with the status code, status message, body and a yes/no flag for whether an error was returned. Bubble says you must re-initialize if you change this option later, because it changes the shape of the response.

Now branch on those fields. A status of 404 means nothing was found and nothing was charged, so the workflow can simply skip the save step. A `402` means a spend cap or the balance has run out. Dizo's error body includes `error.code` and a plain-English `error.fix`, which you can log to a database thing for an admin to review.

## Controlling spend

Bubble workflows can fire more often than you think: a page load, a repeating group or a recursive backend workflow can call an API many times. Protect yourself on both sides.

On the Dizo side, create a dedicated key for the Bubble app in the console and give it a daily cap, a monthly cap, a per-request ceiling and an endpoint allow-list containing only the endpoints the app uses. See [API keys](/docs/keys) for the fields. Add an account-wide monthly spend cap on top. When a cap is hit, Dizo returns `402` rather than charging more. On the request side, keep `max_credits` in every body. To price a new call before you build around it, send the same body with `"dry_run": true` from the API Connector and read the quote; it spends nothing.

A worked example. Suppose your app gets 1,000 sign-ups a month and enriches each company once. If 800 domains match, that is 800 credits. At the pay-as-you-go rate of $0.025 that is $20 a month. If you also find a work email for 300 of them, add 300 credits, or $7.50. Buying a single $500 pack moves you to the Builder rate of $0.021, and the full [pricing](/pricing) table shows the tiers above that.

## Example workflows

**Sign-up enrichment.** Trigger: a user signs up. Step one extracts the domain from the email with Bubble's text operators and skips free-mail domains. Step two runs Enrich company with that domain. Step three, only when the returned status code is empty or 200, makes changes to the User: industry, employees and revenue band. Unmatched domains cost nothing and leave the record untouched.

**Find-email button.** On a contacts page, a button runs Find email with the row's first name, last name and company domain. If an address comes back, save it with its `status` and `confidence` score so users can see how strong the match is. If the status code is 404, show a small not-found label. Add an `Idempotency-Key` header with the contact's unique id so a double click within 24 hours is never charged twice.

**Bounce recovery.** Dizo does not verify arbitrary lists; a dedicated email-verification tool does that. What Dizo can do is re-find people whose addresses bounced. A backend workflow takes each bounced contact, runs [person enrich](/docs/people-enrich) to see where they work now, then runs Find email at the new company. If 200 bounced contacts produce 120 matches and 90 new emails, the job costs 240 plus 90 credits, or 330 credits ($8.25 at the entry rate). Contacts with no match cost nothing; suppress them so the app stops mailing them.

## Troubleshooting

**401 on initialize.** Check that the key value starts with `Bearer` and a single space, and that you are not mixing a test key into the live field. Remember which key the development version uses.

**The call stops the workflow on a miss.** You probably initialized before ticking the error option. Tick it and re-initialize, then update any expressions that read the response.

**Fields missing after initialization.** Bubble only knows the fields that were in the sample response. If the sample record had no funding data, initialize again with a richer sample or a test key, which returns a full synthetic shape.

**402 errors.** A key cap, the account monthly cap or the balance has been reached. Check usage in the console or call `GET /v1/billing`, which is free. **Slow or throttled calls.** `GET /v1/me` returns the key's rate limits; spread recursive workflows out rather than firing hundreds of calls at once.

## Security practices

Never use None or self-handled authentication for a collection that holds your Dizo key. Bubble's own guidance is that private values in such a collection can be read by anyone, including visitors who are not logged in. Keep the key in the header method and leave any per-call header with the key marked Private.

Keep the Bubble key scoped to `data:read` with no billing scopes, so nothing in the app can top up or change limits. Use the development key value for a `dz_test_` key so you can build and test without live data, then rotate the live key if anyone who leaves the team had access to the editor. [Sign up](/signup) for live keys, with 250 free credits and no card.

## FAQ

### Is there a Dizo plugin for Bubble?
No. There is no native Dizo plugin or marketplace listing. You configure Bubble's own API Connector with your key in the header and add one call per Dizo endpoint you need.

### Do Dizo calls run in the user's browser?
Not with this setup. Bubble routes API Connector calls through its server by default, and calls that carry headers or private parameters cannot be switched to run from the browser. Your key stays off the user's device.

### Will initializing a call cost credits?
Only if it uses a live key and finds data. Initialize in your development version with a `dz_test_` key as the development key value and you get synthetic data with no charge.

### Should I use Data or Action?
Use Action for anything that writes to your database or runs once per event, such as enriching a new user. Use Data when you want to display a result directly on a page, but be careful that page loads do not trigger repeated paid calls.

### How do I avoid paying twice for the same lookup?
Store results on the thing you enriched and check for them before calling again. Add an `Idempotency-Key` header with the record's unique id so retries within 24 hours are never charged twice.

### Can I use Dizo's MCP server from Bubble?
This page covers the REST API through the API Connector, which is what Bubble's docs describe for calling outside services. If you want an AI agent to choose tools on its own, connect Dizo's MCP server to an MCP client instead and check Bubble's docs for any newer AI features.
