Skip to navigation

Creating API keys in the management environment

With an API key in your management environment (a partner key), you can manage all your accounts via the API using a single key. You set the permissions for each key yourself. If you are looking for a key for a single individual account, please read Creating an API key.

API keys in the management environment are not enabled by default. Please contact the helpdesk to request access. Only administrators of the management environment can see the ‘API keys’ section.

Creating a new API key

You can create a maximum of 10 keys per management environment.

1

Open the API keys

In the management environment, go to Settings → API keys and click ‘New API key’.

2

Enter a name and description

Under ‘Name’, enter a name. Under ‘Description’, you can enter additional remarks.

3

Choose the permissions

Under ‘Permissions’, tick which API calls the key is allowed to make. Nothing is ticked by default; without any ticks, the key cannot do anything yet.

4

Confirm and save

Enter your password and click ‘Save’. If you log in with Single Sign-On (SSO), you do not need to enter a password.

5

Copy the key

After saving, the ‘API key created’ screen appears and you will see the full key once. Click ‘Copy the key’ and store it in a safe place. After that, you will only see the first four characters in the overview.

If you lose a key, you will not be able to view it again. In that case, create a new key and delete the old one.

Which permissions can you grant to a key?

A key can only make the API calls for which the permission is ticked. The permissions are divided into groups, such as subscribers, campaigns, and automations. The ‘Partner keys only’ group includes the permission to retrieve the partner’s accounts.

If your integration makes a call for which the permission is not enabled, the API will return a 403 error message containing the missing permission. Some calls never work with a partner key, such as editing the account settings.

Editing, blocking, or deleting a key

In the overview, click ‘Details’ next to a key to edit it:

  • Edit the name, description, or permissions and click ‘Save’.
  • Tick ‘Block this key’ and click ‘Save’ to temporarily disable the key. The key will stop working until you remove the tick.
  • Click ‘Delete’ to permanently remove the key. Once you confirm, integrations that use this key will no longer work.

Using the key in the API

When using authentication with HTTP Basic Auth, you send the partner key as the username and the account_id of the account as the password:

cURL
curl -u KEY:ACCOUNT_ID https://api.laposta.nl/v2/list

If you want to retrieve an overview of your accounts and their account_id, call the endpoint for partner accounts with an empty password (-u KEY:). For this, your key does need the permission to retrieve the partner’s accounts:

cURL
curl -u KEY: https://api.laposta.nl/v2/partner/accounts

If the API returns a 401 error message, the account_id is missing, the account_id is incorrect, the account belongs to another partner, or the key or partner is blocked.