Developers

Create and manage API keys

Generate API keys so you can send messages, manage contacts, and trigger campaigns from your own code.

Updated

On this page

API keys let external systems talk to WaSMS programmatically. Each key has defined scopes.

1. Create a key

  1. In the dashboard menu, open Developers, API keys.
  2. Click Create API key.
  3. Name it.
  4. Pick scopes.
  5. Click Create and copy the key. You can copy it again later from the same page.

Available scopes

  • messages:send — send messages
  • messages:read — read message history
  • contacts:read, contacts:write
  • otp:send, otp:verify
  • campaigns:read, campaigns:write
  • webhooks:manage

2. Use the key

Put the key in the Authorization header of every request. This sends one WhatsApp message:

Copy and paste
curl -X POST https://wasms.net/api/public/v1/whatsapp/send \
  -H "Authorization: Bearer YOUR_WASMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "923001234567", "message": "Hello from my software"}'

The same request in PHP, Python and Node.js, and what each reply means, is in Send a WhatsApp message with the API.

3. Copy / Revoke

  • Copy — copies the full key to your clipboard.
  • Revoke — immediately disables.

Security

  • Never commit API keys to Git.
  • Rotate when team members leave.
  • Use scopes — do not give blanket access.
  • Each key shows how many requests it made and how many failed. Check it now and then.

Did this guide solve it?