Skip to main content

HEADS-UP BASIC AUTH (NOT BEARER)

We use BASIC authentication NOT bearer. Pay special attention to the following:
  • You must use HTTP BASIC authentication (more below).
  • The login (username) is always empty.
  • The password is your API key.
  • THERE IS A COLON before your API key.
Read on to learn:

Grab your API key

  1. head over to lemlist
  2. click on your profile picture in the bottom left-hand corner and click on Settings
  3. go to the Integrations tab
  4. click on Generate a new API key
  5. store it securely because you won’t be able to see it again
Generating a New API Key
Of course, never - ever - share your API key. Treat it like a password.

Authenticate

Basic authentication involves sending a verified username (empty, in our case) and password (your API key) with all requests. But not just like that. They must be Base64 encoded and passed in the Authorization header of all your requests. Step by step, this is how to authenticate to our API:
  1. you get an API key (cf. above)
  2. you build the string :YourApiKey (YES, colon at the start)
  3. you Base64 encode that :YourApiKey string (this is how in Javascript)
  4. you pass the encoded result in the Authorization header of all requests with the prefix “Basic ”.
In the end, a curl request to any endpoint in the API will look similar to this:
curl --location 'https://api.lemlist.com/api/{endpoint}' \
--header 'Authorization: Basic {the base64-encoded stuff from step 3}'

give us feedback on this page