Metabase
Prerequisites
To connect Metabase as a data source in Zenskar, ensure the following:
Authentication
To set up a Metabase data source connector in Zenskar, you need:
-
Username and password: Used to generate a new session token
-
Session token: A token used to authenticate API requests (typically expires every 14 days)
If you provide only username and password, Zenskar will generate a session token automatically when running queries. This may trigger security notifications in the user's Metabase account.
Metabase API URL
- The URL of your Metabase instance API (must use
https://) - Example:
https://your-metabase-domain.com/api/
Obtain a session token (optional)
You can manually generate a session token using Metabase’s API:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"username": "[email protected]", "password": "fakepassword"}' \
https://your-metabase-domain.com/api/sessionThe response includes an id field — this is your session_token:
{"id":"38f4939c-ad7f-4cbe-ae54-30946daf8593"}
Expiration of session tokensSession tokens expire (14 days by default). Update it in Zenskar when expired or configure your Metabase server’s
MAX_SESSION_AGEenvironment variable to extend the session duration.
Invalid or expired session token errorsThe connector will alert you of an invalid or expired session token by returning a 401 Unauthorized response status code.
Set up a Metabase data-source connector via Zenskar dashboard
Once the prerequisites are complete, connect Metabase as a data source in Zenskar.
- Log into your Zenskar dashboard.
- In the left side bar, click Usage > Data Sources.
- In the top-right corner, click + ADD DATA SOURCE.
- On the Add New Data Source page, configure the Metabase connector
General details
| Field | Description | Required |
|---|---|---|
| Source Name | Enter a unique name for this data source. | Yes |
| Source Type | Select Metabase from the dropdown menu. | Yes |
Connector configuration
| Field | Description | Required |
|---|---|---|
| Metabase instance API URL | URL to your Metabase instance API. Must start with https://. Example: "https://localhost:3000/api/" | Yes |
| Username | Username for authenticating with Metabase | Yes |
| Password | Password for authenticating with Metabase | Yes |
| Session token | Session token for Metabase authentication | Yes |
Data source access mode (read-only)
Zenskar replicates data directly from your Metabase instance to Zenskar’s data infrastructure. The data is periodically synced to maintain freshness. This option is:
- Ideal for small-mid size database (less than 30GB)
- Ideal for periodical data ingestion
- Optimised for quicker invoice generation
- Click on the SAVE SOURCE button
Addendum
Supported streams
Refer to the Metabase API reference.
| Stream | Description |
|---|---|
| Card | Export cards (questions) from Metabase |
| Collections | Export collection metadata |
| Dashboard | Export dashboards and metadata |
| User | Export user information |
| Databases | Export database metadata |
| Native Query Snippet | Export SQL snippets saved in Metabase |
Data-type mapping
| Metabase type | Zenskar type |
|---|---|
string | string |
integer, number | number |
array | array |
object | object |
Updated 8 days ago
