Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to Connect External APIs Using API Connector in Bubble

Bubble's API Connector plugin lets you connect to any REST API without writing backend code. This tutorial walks through adding a new API with authentication, configuring GET and POST requests with dynamic parameters, initializing each call so Bubble maps the JSON response, and displaying or acting on API data inside your pages and workflows.

What you'll learn

  • How to install and configure a new API in the API Connector plugin
  • How to set up authentication with API keys and Bearer tokens securely
  • How to configure GET and POST requests with dynamic parameters
  • How to initialize calls, map response data, and use it in pages and workflows
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate11 min read25-35 minAll Bubble plansMarch 2026RapidDev Engineering Team
TL;DR

Bubble's API Connector plugin lets you connect to any REST API without writing backend code. This tutorial walks through adding a new API with authentication, configuring GET and POST requests with dynamic parameters, initializing each call so Bubble maps the JSON response, and displaying or acting on API data inside your pages and workflows.

Overview: Connecting External APIs with API Connector in Bubble

The API Connector is Bubble's built-in plugin for talking to any external REST API -- weather services, payment gateways, AI models, CRMs, or your own backend. This tutorial takes you through the complete lifecycle: adding the plugin, configuring an API with authentication, building GET and POST calls with dynamic parameters, initializing each call with test data so Bubble can read the response, and then wiring that data into your pages and workflows. It is written for non-technical founders who have an API key and documentation and need to connect the dots.

Prerequisites

  • A Bubble app with the API Connector plugin installed (Plugins tab → Add plugins → search 'API Connector')
  • An API key or credentials from the external service you want to connect
  • The API documentation for your target service open in another tab
  • Basic understanding of what GET (fetch data) and POST (send data) mean

Step-by-step guide

1

Add a new API and configure authentication

Go to the Plugins tab in your Bubble editor and click on API Connector. Click the 'Add another API' button. Give it a clear name matching the service (e.g., 'OpenWeather API', 'Stripe', 'OpenAI'). Under Authentication, choose the type that matches your API's documentation. For most modern APIs, select 'Private key in header'. Set the Key name to 'Authorization' and the Key value to 'Bearer YOUR_API_KEY' (replacing YOUR_API_KEY with your actual key). Check the 'Private' checkbox next to the key value -- this ensures the key is never sent to the browser and stays server-side only. If the API uses query-string authentication instead, choose 'Private key in URL' and enter the parameter name and value. Click the blue header area to collapse the auth section and save.

Pro tip: Never paste API keys directly into page elements or workflows. The API Connector's Private checkbox is the only safe place for credentials in Bubble -- it keeps them on the server and out of browser network requests.

Expected result: A new API entry appears in the API Connector with authentication configured and the key marked as Private.

2

Configure a GET request to fetch data

Under your new API, click 'Add another call'. Name it descriptively (e.g., 'Get Current Weather'). Select GET as the HTTP method. In the URL field, enter the full endpoint URL. For dynamic path segments, use square brackets: https://api.openweathermap.org/data/2.5/weather?q=[city]&units=metric. Bubble automatically creates a parameter called 'city' from the brackets. You can add more parameters by clicking 'Add parameter' -- useful for optional query strings like limit or page. Set the 'Use as' dropdown to 'Data' if you want to display the response in page elements (like a Text or Repeating Group), or 'Action' if you will call it from a workflow. For fetching and displaying data, Data is almost always the right choice. Leave Data type as JSON.

Expected result: A GET call is configured with the endpoint URL, dynamic parameters, and Use as type set appropriately.

3

Configure a POST request to send data

Click 'Add another call' again. Name it (e.g., 'Create Contact'). Select POST as the method. Enter the endpoint URL. Under Headers, add a new header: Key = 'Content-Type', Value = 'application/json'. In the Body section, toggle to 'Raw' and construct a JSON payload with dynamic parameters in square brackets. For example: {"name": "[contact_name]", "email": "[contact_email]", "phone": "[phone_number]"}. Bubble creates a parameter for each bracketed value. Make sure 'Querystring' is unchecked for body parameters (checked = sent as URL query string, unchecked = sent in the request body). Set 'Use as' to 'Action' since POST requests are typically triggered by user actions like button clicks. If any parameter contains sensitive data, check its 'Private' box.

Expected result: A POST call is configured with the endpoint URL, Content-Type header, a JSON body with dynamic parameters, and Use as set to Action.

4

Initialize each call with test data to map the response

This is the most important step. For each call, enter real test values in the parameter fields. For the GET weather call, type an actual city name like 'London'. For the POST contact call, enter sample values like 'Jane Doe' and 'jane@example.com'. Click the 'Initialize call' button. Bubble sends the actual HTTP request to the API and displays the JSON response. If initialization succeeds, you see a green checkmark and Bubble lists every field from the response (e.g., temp, humidity, description for a weather API). Click 'Save' to lock in this response mapping. If initialization fails, check these common causes: 401 Unauthorized means your API key is wrong or expired. 404 Not Found means the URL or endpoint path is incorrect. 422 Unprocessable Entity means a required parameter is missing or malformed. 500 Internal Server Error means the external API itself is having issues -- try again later.

Pro tip: If the API returns different fields depending on the input, initialize with a value that returns the most complete response. Bubble can only reference fields it has seen during initialization.

Expected result: All API calls initialize successfully with green checkmarks, and Bubble displays the mapped response fields for each call.

5

Use GET data in your page elements

Go to the Design tab and navigate to the page where you want to display API data. Select any element (Text, Image, Repeating Group) and set its data source. Click 'Insert dynamic data' and choose 'Get data from an external API'. Select your API and the specific GET call (e.g., 'Get Current Weather'). Fill in the dynamic parameters -- for example, set city to an Input element's value on the same page. Once connected, the response fields appear as options. For a Text element, you might select 'Get Current Weather's main's temp' to show the temperature. For a Repeating Group, set the type to the API response type and use the list fields from the response. The API call runs automatically whenever the parameters change, so updating the city input instantly fetches new weather data.

Expected result: Page elements display live data from the external API, updating dynamically when input parameters change.

6

Trigger POST actions from workflows and handle responses

Go to a page with a form (e.g., a contact creation form with name, email, and phone inputs). Add a workflow on the Submit button click. In the workflow, add an action: Plugins → your API name → Create Contact (your POST call name). Map each parameter to the corresponding input field: contact_name = Name Input's value, contact_email = Email Input's value, phone_number = Phone Input's value. After the API action step, you can reference 'Result of step 1' to access the response data (e.g., the new contact's ID returned by the API). Add a subsequent step to show a success message or navigate to another page. For error handling, consider using the API Connector's 'Capture response headers' option and checking the status code in a conditional. If the response indicates an error, display a user-friendly alert instead of proceeding.

Expected result: Clicking the Submit button sends data to the external API via POST, and the workflow handles the response by showing a success message or processing the returned data.

Complete working example

API Connector payload
1{
2 "API_CONNECTOR_CONFIGURATION": {
3 "api_name": "Weather API",
4 "authentication": {
5 "type": "Private key in header",
6 "header_name": "Authorization",
7 "header_value": "Bearer sk_your_api_key_here",
8 "private": true
9 },
10 "calls": [
11 {
12 "name": "Get Current Weather",
13 "method": "GET",
14 "url": "https://api.openweathermap.org/data/2.5/weather?q=[city]&units=metric",
15 "use_as": "Data",
16 "parameters": {
17 "city": {
18 "test_value": "London",
19 "private": false
20 }
21 },
22 "response_fields": [
23 "main.temp",
24 "main.humidity",
25 "weather[0].description",
26 "wind.speed",
27 "name"
28 ]
29 },
30 {
31 "name": "Create Contact",
32 "method": "POST",
33 "url": "https://api.example.com/v1/contacts",
34 "use_as": "Action",
35 "headers": {
36 "Content-Type": "application/json"
37 },
38 "body": {
39 "name": "[contact_name]",
40 "email": "[contact_email]",
41 "phone": "[phone_number]"
42 },
43 "parameters": {
44 "contact_name": {
45 "test_value": "Jane Doe",
46 "private": false
47 },
48 "contact_email": {
49 "test_value": "jane@example.com",
50 "private": false
51 },
52 "phone_number": {
53 "test_value": "+1234567890",
54 "private": false
55 }
56 }
57 }
58 ]
59 },
60 "INITIALIZATION_CHECKLIST": [
61 "1. Enter valid test values for every parameter",
62 "2. Click Initialize call",
63 "3. Verify green checkmark and response fields listed",
64 "4. Click Save to lock the response mapping",
65 "5. Test from a page element or workflow"
66 ],
67 "HTTP_STATUS_REFERENCE": {
68 "200": "Success — response data returned",
69 "201": "Created — POST succeeded, new resource returned",
70 "400": "Bad Request — check parameter format",
71 "401": "Unauthorized — API key is wrong or expired",
72 "403": "Forbidden — key lacks required permissions",
73 "404": "Not Found — URL or endpoint path is incorrect",
74 "422": "Unprocessable Entity — missing required parameter",
75 "429": "Rate Limited — too many requests, slow down",
76 "500": "Server Error — problem on the API provider side"
77 }
78}

Common mistakes when connecting External APIs Using API Connector in Bubble

Why it's a problem: Trying to use an API call in a page before initializing it

How to avoid: Always click Initialize call with valid test data and save the response mapping before trying to reference the call in elements or workflows

Why it's a problem: Setting a GET call to Use as Action when you need to display the data on a page

How to avoid: Set Use as to Data for calls you want to display in page elements. Duplicate the call if you also need it as a workflow action.

Why it's a problem: Leaving API key parameters unchecked for Private

How to avoid: Always check the Private checkbox next to any parameter that contains an API key, token, or secret

Why it's a problem: Sending body parameters as querystring in a POST request

How to avoid: Uncheck Querystring for all parameters that belong in the POST request body

Best practices

  • Initialize every API call with realistic test data before referencing it anywhere in your app
  • Mark all credential parameters (API keys, tokens, secrets) as Private to keep them server-side
  • Use descriptive names for both the API and each call so your team can identify them at a glance
  • Set Use as to Data for display-oriented GET requests and Action for workflow-triggered requests
  • Add a Content-Type: application/json header to all POST and PUT requests that send JSON bodies
  • Handle error states gracefully by showing a user-friendly message when the API returns a non-200 status
  • Cache frequently requested data in a Bubble Data Type to reduce API calls and speed up page loads
  • Keep the external API documentation open in another tab while configuring -- field names must match exactly

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I need to connect my Bubble.io app to an external REST API that uses Bearer token authentication. The API has a GET endpoint to fetch records and a POST endpoint to create records. Walk me through the complete API Connector setup including authentication, parameter configuration, initialization, and using the response data in my pages and workflows.

Bubble Prompt

Help me connect to an external API using the API Connector. Set up Bearer token authentication marked as Private. Configure a GET call to fetch data (Use as Data) with a dynamic city parameter. Configure a POST call to create a contact (Use as Action) with name, email, and phone parameters in a JSON body. Show me how to initialize both calls and use the data in a page and a workflow.

Frequently asked questions

Can the API Connector connect to any API?

The API Connector supports JSON-based REST APIs over HTTP and HTTPS. It does not natively support SOAP, GraphQL, or WebSocket protocols. For GraphQL, you can send the query as a POST body string. For unsupported protocols, use middleware like Pipedream or Make to convert the format.

What is the difference between Use as Data and Use as Action?

Data calls appear in the Get data from an external API option on page elements and are meant for displaying information. Action calls appear under Plugins in workflow actions and are meant for operations triggered by user interaction. If you need both, duplicate the call and set one to each type.

Why does my initialization keep failing with a 401 error?

A 401 Unauthorized error means the API rejected your credentials. Double-check that the API key is correct, it has not expired, the header format matches the documentation exactly (e.g., 'Bearer ' with a space before the key), and the Private checkbox is checked.

How do I handle paginated API responses?

Many APIs return data in pages with a next_page token or offset parameter. Add a page or offset parameter to your call. In your workflow, call the API in a loop using the Bubble Schedule API Workflow on a list action, incrementing the offset each time until no more results are returned.

Is there a timeout limit for API calls in Bubble?

Yes. Bubble's API Connector has an approximately 150-second timeout. For long-running operations, use an async pattern: send the initial request, receive a job ID in the response, then poll a status endpoint at intervals until the job completes.

Can RapidDev help with complex API integrations?

Yes. RapidDev specializes in Bubble API integrations including OAuth2 flows, webhook receivers, data transformation between formats, error handling with retry logic, and multi-step API orchestration.

How do I pass an array in a POST request body?

Construct the full JSON array in the body field. For a static structure, write it directly: {"items": ["[item1]", "[item2]"]}. For dynamic-length arrays, build the JSON string in a Bubble text expression and pass it as a single parameter.

Can I test API calls without using my live API key?

Most APIs provide a test or sandbox environment with separate keys. Use the test key during initialization and development, then switch to the live key when you are ready to deploy. This prevents test data from mixing with production data.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.