Authentication & Security

Learn how to authenticate requests to the Wahide REST API using standard HTTP Authorization Bearer tokens.

API Key Security & Confidentiality

All requests require an active API Key generated from your Wahide Dashboard. Never expose your secret API keys in client-side code, public repositories, or mobile apps.

Obtaining Your API Key

1. Log in to your [Wahide Dashboard](/dashboard). 2. Navigate to **Settings > API Keys**. 3. Click **Generate New Key**, enter a descriptive label (e.g. `Production Server`), and copy your key. Keys are prefixed with `hide_` to ensure ultra-fast in-memory validation via the Redis pipeline.
Keep your API Key Confidential
Your API Key carries full permissions to send messages and manage connected devices. If a key is compromised, revoke it immediately from the dashboard.

Authentication Headers

Include your API Key in the standard HTTP `Authorization` header of every request with the `Bearer` prefix:
HTTP Request Header
POST /api/v1/wa/messages/send HTTP/1.1
Host: api.wahide.com
Authorization: Bearer hide_9a8b7c6d5e4f3a2b1c0d9e8f
Content-Type: application/json

Security Best Practices

• **Environment Variables**: Never hardcode API Keys in your application source code. Store them in secure server-side environment variables (e.g., `WAHIDE_API_KEY`). • **Zero Client-Side Exposure**: Never invoke Wahide API endpoints directly from web browsers, mobile apps, or client-side JavaScript. • **Immediate Key Rotation**: If your API Key is accidentally leaked or committed to a repository, navigate to **Settings > API Keys** on your dashboard and click **Regenerate Key** immediately to revoke the compromised token.
Sub-millisecond Redis Fast-Path
Wahide API Gateway utilizes an in-memory Redis pipeline to validate API Keys in sub-milliseconds (< 0.2ms) without adding latency to your high-throughput messaging workloads.

Unauthorized Error Format

If you omit the Authorization header, supply an invalid key, or the key has been revoked, the API returns `401 Unauthorized` with a standardized JSON error response:
401 Unauthorized Response
{
  "success": false,
  "message": "Invalid API Key",
  "error": "UNAUTHORIZED"
}