Skip to main content

Introduction

Målbar uses one distinct type of authentication:
Key typeUse caseWhere to use
API keysServer-to-server (REST APIs)Back-end only; store securely, never expose to client

API keys

API keys on Målbar allow you to access Målbar LCA programmatically. This is useful for integrating Målbar into your application or with other tools and services. Each API key is tied to a specific Customer – meaning you can use it to access that Customers’s resources. API keys on Målbar follow the format:
.env
MAALBAR_API_KEY=mb_[test|live]_xxxxxxxxxxxxxxxx
By default, you can use this key to perform any API request without restriction, so it must be stored securely in your app’s server-side code (such as in an environment variable or credential management system). Don’t expose this key on a website.

Create an API key

You can create an API key by following these steps:
1

Go to Målbar LCA

Go to API Keys in the dropdown > API Keys in your workspace.
2

Create an API Key

Click on the “Create API key” button.Input a name for the API key that describes the intent with the integrationClick on the Create API Key button to create the key. Make sure to copy your API key and store it in a safe place. You won’t be able to see it again.
3

Use your API Key

Now that you have your API key, you can use it to access Målbar LCA programmatically via any API request with the X-Api-Key header.
X-Api-Key: mb_live_xxxxxxxxxxxxxxxx