Getting Started with WorqHat API

This quickstart guide will help you make your first API request to the WorqHat platform. Follow these simple steps to get up and running quickly.

Step 1: Get Your API Key

Before you can make any API requests, you’ll need to obtain an API key:
  1. Log in to your WorqHat Dashboard
  2. Navigate to the API section
  3. Generate a new API key
  4. Copy your API key and store it securely
Never share your API key publicly or commit it to version control systems. Use environment variables or secure key management solutions to store your API key.

Step 2: Make Your First API Request

Let’s make a simple request to check the API health status:
curl -X GET "https://api.worqhat.com/health" \
  -H "Authorization: Bearer YOUR_API_KEY"
You should receive a response similar to:
{
  "status": "ok",
  "uptime": 123.45,
  "version": "1.0.0",
  "environment": "production",
  "timestamp": "2025-07-24T17:00:00Z",
  "services": {
    "database": "ok"
  }
}

Step 3: Explore the API

Now that you’ve made your first request, you can explore the different endpoints available:

Code Examples

Checking API Health

node.js
import Worqhat from 'worqhat';

const client = new Worqhat({
  apiKey: process.env.WORQHAT_API_KEY,
});

async function checkApiHealth() {
  try {
    const response = await client.health.check();
    console.log(`API Status: ${response.status}`);
    return response;
  } catch (error) {
    console.error('Error checking API health:', error);
  }
}

checkApiHealth();

Database Operations

node.js
import Worqhat from 'worqhat';

const client = new Worqhat({
  apiKey: process.env.WORQHAT_API_KEY,
});

async function queryDatabase() {
  try {
    const response = await client.db.executeQuery({
      query: "SELECT * FROM users WHERE status = 'active' LIMIT 10",
    });
    console.log(response.data);
    return response;
  } catch (error) {
    console.error('Error querying database:', error);
  }
}

queryDatabase();

Next Steps

Now that you’ve made your first API request, you can:
  1. Explore the API Reference for detailed endpoint documentation
  2. Learn about Authentication mechanisms
  3. Check out our Code Examples for common use cases
  4. Join our Developer Community for support

Need Help?

Contact our support team if you encounter any issues or have questions about the API.