Skip to main content
Back to API docs

API authentication

Authenticate Wahdx Connection API Requests

Wahdx Connection API requests use an X-API-Key header. Treat this key like a production credential: store it in a trusted backend, serverless function, or private integration layer, never in browser JavaScript or mobile client bundles. This authentication model keeps publishing requests controlled while giving teams a clear path for backend integrations.

Required header

Send the API key with each server-to-server request. The key should be loaded from your environment variables or secret manager. The example below calls GET /api/content/accounts to confirm the key works; the response lists the connected accounts for the workspace.

const headers = {
  'X-API-Key': process.env.WAHDX_API_KEY
};
Example response · 200
{
  "success": true,
  "subscription": "pro",
  "data": [
    {
      "accountId": "acc_tiktok_internal_uuid",
      "platform": "tiktok",
      "display_name": "Wahdx Creator",
      "username": "wahdx_creator",
      "avatar_url": "https://example.com/avatar.jpg",
      "bio_description": "Content team account",
      "status": "active",
      "followers": 12000,
      "following": 210,
      "likes": 45000,
      "videos": 128,
      "is_verified": false
    }
  ]
}

Server-side request pattern

Use a backend route, serverless function, or internal worker to call Wahdx Connection. This prevents credentials from being exposed to users.

const API_BASE_URL = 'https://api.wahdx.com';
const API_KEY = process.env.WAHDX_API_KEY;

await fetch(API_BASE_URL + '/api/content/accounts', {
  method: 'GET',
  headers: {
    'X-API-Key': API_KEY
  }
});
Example response · 200
{
  "success": true,
  "subscription": "pro",
  "data": [
    {
      "accountId": "acc_tiktok_internal_uuid",
      "platform": "tiktok",
      "display_name": "Wahdx Creator",
      "username": "wahdx_creator",
      "avatar_url": "https://example.com/avatar.jpg",
      "bio_description": "Content team account",
      "status": "active",
      "followers": 12000,
      "following": 210,
      "likes": 45000,
      "videos": 128,
      "is_verified": false
    }
  ]
}

Key handling checklist

Secure key handling reduces risk when building social publishing workflows.

  • Store API keys in server-side environment variables.
  • Never place API keys in browser code, public repositories, or mobile bundles.
  • Rotate keys immediately if a key is exposed.
  • Route client actions through your backend or server-side proxy.

FAQ

Common questions about this API topic.

Can I use the API key directly from the browser?

No. API keys should only be used from trusted server-side environments so they are not exposed to users.

Which header authenticates requests?

Use the X-API-Key header on each request that calls Wahdx Connection API endpoints.

What should I do if my key is leaked?

Rotate the key immediately and remove the exposed value from code, logs, and public history where possible.