Prerequisites
- A Refold account. Log in at app.refold.ai. Don’t have one? Contact us to get set up.
- An app to integrate. This guide uses HubSpot (
hubspot) as the example. Any connector works; swap the slug and action names to match yours. - A backend that can make HTTP calls. Every example here is a
curlyou can run from a terminal, then move into your server.
Every API call uses the base URL
https://app.refold.ai and sends your API key in the x-api-key header. Account-scoped calls also send the customer’s linked_account_id as a header. Never expose your API key in the browser.Step 1: Get your API key
Open Settings > Credentials
In the Refold Console, go to Settings > Credentials.
Step 2: Configure the app
Before a customer can connect an app, tell Refold how to authenticate with it.Not ready to use a real app? Configure the built-in Playground app (
playground_app) the same way and run the rest of this guide against it.Step 3: Create a linked account
A linked account represents one of your customers. You choose itslinked_account_id and reuse that id in every account-scoped call. Create one per customer, typically when they sign up.
cURL
Output
Step 4: Connect the app
Your customer authorizes the app from your product. The fastest way to see it work is the hosted Connect portal: generate a URL for the linked account and open it.cURL
Output
To embed the flow inside your product instead of redirecting, mint a session token for the linked account on your backend and pass it to the React SDK. The token authenticates the frontend so your API key stays server-side.
Step 5: Write data to the connected app
This is the payoff. With the account connected, write data straight into the customer’s HubSpot from your backend by executing an action. Refold uses the stored credentials automatically, so no app tokens go in the request. First, confirm the action you want exists for the app:cURL
cURL
Output
Open the customer’s HubSpot. The contact Jane Doe is there. You just wrote data to an external system through Refold.
Step 6: Go live
You have run the full loop in test. To take it to production:Switch to your production environment
Generate a production API key in Settings > Credentials and use real OAuth credentials for the app, not the shared test ones.
Embed the connect flow in your product
Replace the hosted portal with the React SDK or a build-your-own flow so customers connect without leaving your app.
Handle connection health
Subscribe to webhooks and surface connection status so customers can reconnect when a token expires.
Run the go-live checklist
Walk the go-live checklist before your first customer.
Next steps
Embed the connect flow
Bring the connection experience into your own UI.
Configure the integration
Collect customer input with config fields and field types.
Move data
Read, write, and sync data between your app and connected systems.
Recipes
Follow end-to-end builds for NetSuite, Salesforce, and Workday.