Connect a system through a REST API
For systems that only expose data through an API: ERP, CRM, marketing tools. Each API address (endpoint) becomes a table in LumeDB.
Before you start
Have the system's API documentation and the access credentials at hand: API key, token, user and password or the OAuth2 details, depending on what the system asks for.
Step 1 · Access
- In Connections, click + New connection and choose REST API.
- If the system is listed under Start from a template, search by name or by area (CRM, ERP, marketing) and click Use the template. It fills in the address, the authentication and the most common endpoints; you can change everything afterwards.
- Check the Base URL, for example
https://api.system.com/v1. - Under Schema in the Core, give the name the tables will appear under, for example
crm. Each endpoint becomescrm.table. - Choose the Authentication:
| Option | What to fill in |
|---|---|
| no authentication | nothing |
| API key | the key, the field name and whether it goes in the header or in the URL |
| fixed token (Bearer) | the token |
| user and password (Basic) | user and password |
| OAuth2 with refresh token | token URL, Client id, client secret and refresh token |
| OAuth2 client credentials | token URL, Client id and client secret |
- Click Configure endpoints.
I don't have the refresh token
With OAuth2 with refresh token authentication, open No refresh token? Generate one with the authorization code:
- Fill in the Authorization URL and the Redirect URI (the same one registered in the provider's app).
- Click Authorize at the provider and complete the sign-in that opens.
- The provider returns to the redirect URI with
?code=…in the address bar. Copy the value ofcode. - Paste it into the field and click Generate refresh token. The code works once and only for a few minutes.
With the client secret and the refresh token stored, LumeDB renews the access on its own for the following loads.
Step 2 · Endpoints
Each row is a table.
- Under table, give the name it will have in LumeDB.
- Under path, enter the endpoint, for example
/v1/orders. - Under where the list is, say which part of the response holds the records, for example
data.items. If you don't know, use*and LumeDB finds it on its own. - Choose the pagination the API uses: none, by page, by offset, by cursor or by the Link header.
- Click Preview to read the first page straight from the API and check the columns.
- Use + endpoint to add more tables.
Save before previewing
The preview uses the credentials stored on the server. If the connection hasn't been saved yet, click Save (it stays inactive) and go back to the preview.
Activate
Click Save and activate, or save, test it in the list and click Activate. The tables now show up on the Source node in Modeling.
If the preview fails
| Symptom | What to check |
|---|---|
| Access denied | The credential expired or has no permission for that endpoint. |
| It comes back empty | The where the list is field doesn't match the response; try *. |
| It only brings the first page | The chosen pagination isn't the API's; check the system's documentation. |