Skip to main content
Your API key authenticates every request to the WSAPI. Each account has a unique API key that grants access to all instances under that account.

Finding your API key

1

Log in to your dashboard

2

Create your API Key

Find the API Keys section and click on Generate Api Key.
3

Copy your key

Click the copy button next to your API key. You’ll use this in the X-Api-Key header for all API requests.
Store your API Key securely. You won’t be able to see it again after you navigate away. If you lose it, you’ll need to generate a new one.

Using your API key

Include the X-Api-Key header in every request alongside the X-Instance-Id header:
curl -X GET https://api.wsapi.chat/chats \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "X-Instance-Id: YOUR_INSTANCE_ID"

Security best practices

  • Never expose your key in client-side code — keep it server-side only
  • Don’t commit keys to version control — use environment variables instead
  • Rotate immediately if compromised — generate a new key from your dashboard
  • Use environment variables in your application:
export WSAPI_API_KEY="your_api_key_here"
export WSAPI_INSTANCE_ID="your_instance_id_here"

Rotating your API key

If you lost your API key or suspect it has been exposed, rotate it using the Rotate API Key button in the same section of your dashboard. This will invalidate the old key and generate a new one immediately.
After rotating your API key, update all applications and integrations that use the old key.