WhatsApp API key

KEYAuthentication

WhatsApp API key: how to get it, use it and keep it safe

Your WhatsApp API key is the one secret that lets your server send messages through Koverage. Learn where to find it, how to send it, and where it must never go.

Every request carries this header
Authorization: Bearer YOUR_API_KEY
AuthorizationThe header name.
BearerThe scheme, then one space.
YOUR_API_KEYYour key from the dashboard.
Content-Type: application/json
Find your key: Dashboard, then API docs. It is at the top of the page.
01Get and use

Find your WhatsApp API key and make the first call

The key lives at the top of the API docs in your Koverage dashboard. Copy it once, store it safely, then send it as a Bearer token.

  1. Open the API docs

    Sign in to your Koverage dashboard and open the API docs page.

  2. Copy the key

    Your key is shown at the top. Put it in an environment variable on your server. Do not paste it into code.

  3. Add the header

    Send Authorization: Bearer YOUR_API_KEY and Content-Type: application/json with every request.

API key••••••••••••Regenerate Key

A sketch of the key area. Your real key never appears on this page.

cURL test
02Trust boundary

Keep your WhatsApp API key on your server

Your server is the only safe place for the key. Browsers and apps talk to your server. Your server talks to Koverage.

Not safe

Browser or app

Your website, your mobile app, your visitors.

No key here
your request
Safe

Your server

Holds the key in an environment variable. Adds the Bearer header and calls Koverage.

Key lives here
Bearer key
Koverage

Send message API

Checks the key and accepts the request.

Needs the key

Never do this: call Koverage straight from browser code or an app. The key would sit in code that every visitor can read.

03Quick quiz

Where can a WhatsApp API key live?

Tap Safe or Not safe for each place. You get the reason straight away.

  • A variable on your server
  • A .env file that git ignores
  • Your cloud’s secrets manager
  • Your website’s JavaScript
  • Your mobile app code
  • A public GitHub repository
  • A chat message, email or screenshot

04In code

Read the key from the environment, never from the file

Your code reads the key when it runs. The key itself is never typed into a file that you save or share.

Do not

Anyone who can read this file can use your key. Files get copied, committed and shared.

Do this
Key from the environment
05Header checker

Check your WhatsApp API key header

Paste your Authorization header with a fake key. The checker finds the usual mistakes: angle brackets, quotes, a missing Bearer and extra spaces.

Use a fake key here. This checker runs in your browser and sends nothing anywhere. Never paste a live key into any website.

ResultLooks right
    06Lifecycle

    The life of a WhatsApp API key

    A key is not set once and forgotten. You get it, store it, use it, and rotate it when you need to. Then every system gets the new key.

    The key lifecycle: get, store, use, rotate, update. After update you go back to use.1Get2Store3Use4Rotate5UpdateLoop backto Use
    1. 1
      Get

      Open the API docs in your Koverage dashboard. The key is at the top of the page.

    2. 2
      Store

      Put it in an environment variable or a secrets manager on your server.

    3. 3
      Use

      Send it as a Bearer token in the Authorization header of every request.

    4. 4
      Rotate

      Press Regenerate Key if the key leaks or if someone who knew it leaves.

    5. 5
      Update

      Put the new key everywhere the old one was used. Send one test message.

    07If it fails

    If Koverage refuses your request

    Work through these four checks in order. Most key problems are in the first two.

    1. 1
      Check the header format

      Paste your header into the checker above. Look for angle brackets, quotes and a missing Bearer.

    2. 2
      Check you copied the whole key

      Copy it again from the API docs. A key cut short, or with a space at the end, is refused.

    3. 3
      Check the key is current

      If someone pressed Regenerate Key, the key you copied earlier may no longer work.

    4. 4
      Read the Error Codes page

      It is in your dashboard docs, next to Conventions and Webhooks.

    WhatsApp API key: your questions answered

    Where do I find my WhatsApp API key?

    Open the API docs in your Koverage dashboard. The key is shown at the top of the page, and a Regenerate Key button sits next to it.

    How do I send the WhatsApp API key?

    Add the header Authorization: Bearer YOUR_API_KEY to every request. Also add Content-Type: application/json. Replace YOUR_API_KEY with your real key.

    Can I put the key in my website or mobile app?

    No. Anyone can read code that runs in a browser or an app. Keep the key on your server. Your website or app should call your server, and your server should call Koverage.

    Where should I store the key on my server?

    Use an environment variable or a secrets manager. If you use a .env file, add it to .gitignore so it is never committed.

    What does Regenerate Key do?

    It creates a new key. Update every system that uses the key, then send one test message. Before you rotate on a live system, check in your dashboard what happens to the old key.

    What should I do if my key leaks?

    Regenerate the key, put the new key everywhere the old one was used, and check your recent messages in the dashboard.

    Do I need phoneId with the key?

    No. phoneId is optional. If you leave it out, the first phone ID on your account is used. Set it when you have more than one WhatsApp number.

    My request is refused. What do I check?

    Check the header format with the checker on this page, confirm you copied the whole key, and confirm the key was not regenerated since you copied it. Then read the Error Codes page in your dashboard docs.

    Send your first message with your WhatsApp API key

    Get the key from your dashboard, keep it on your server and call the send message API. Want to try it without code? Use the Postman collection.

    Scroll to Top