# Chatbot API API Reference

> **Version:** 1.0.0 | **Base URL:** `https://hifisys.com/api/v1/chatbot` | **Provider:** Hifisys

## Overview
Context-aware conversational AI assistant API powered by Google Gemini with company services and navigation awareness.

## Authentication
All requests require a valid API key passed in the request header:
```http
X-API-Key: YOUR_API_KEY
Accept: application/json
```
Alternatively, pass as a standard Bearer token:
```http
Authorization: Bearer YOUR_API_KEY
```

## Available Subscription Plans
| Plan | Price | Rate Limit | Monthly Quota | Trial |
|---|---|---|---|---|
| Free Trial | Free Trial | 30 req/min | 1,000 | 7 Days |
| Starter | USD 29.00/month | 60 req/min | 10,000 | No |
| Business | USD 99.00/month | 180 req/min | 50,000 | No |
| Enterprise | USD 249.00/month | 600 req/min | 250,000 | No |

## API Endpoints
### `POST` /api/v1/chatbot/message
**Send Conversational Message**
> **Scope:** `chat:message` | **Content-Type:** `application/json`

Dispatches a visitor prompt to the Hifisys conversational knowledge-base assistant and returns AI-generated response with suggested quick replies.

#### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| `message` | `string` | **Yes** | User prompt/query text. |
| `session_id` | `string` | No | Session ID for multi-turn conversation memory. |

#### Example Requests
**cURL:**
```bash
curl -X POST "https://hifisys.com/api/v1/chatbot/message" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"What web development services do you offer?"}'
```
**JavaScript:**
```javascript
const res = await fetch('https://hifisys.com/api/v1/chatbot/message', {
  method: 'POST',
  headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ message: 'What web development services do you offer?' })
});
const data = await res.json();
```
**PHP:**
```php
$ch = curl_init('https://hifisys.com/api/v1/chatbot/message');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['message' => 'What web development services do you offer?']));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
```
**Python:**
```python
import requests
res = requests.post('https://hifisys.com/api/v1/chatbot/message', json={'message': 'What web development services do you offer?'}, headers={'X-API-Key': 'YOUR_API_KEY'})
print(res.json())
```

#### Sample Response (200 OK)
```json
{
    "success": true,
    "reply": "Hifisys Tech provides enterprise web development, custom Laravel apps, React/Vue frontends, and API platforms.",
    "quick_replies": [
        "Get a Quote",
        "View Portfolio",
        "Contact Sales"
    ]
}
```

---

## Security Best Practices
- Store API keys in environment variables; never commit to public VCS repositories.
- Enforce TLS 1.3 across all client integrations.
- Implement exponential backoff algorithms for rate-limit handling (HTTP 429).

## Support & Contact
- **Email:** info@hifisys.com
- **Phone:** +91 8890897064
- **Website:** [Hifisys](https://hifisys.com)