API Reference
Enquiries API
Enquiry and lead management
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Enquiry and lead management
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /enquiries | Public | Create an enquiry |
| GET | /enquiries | Required | List enquiries |
| GET | /enquiries/{id} | Required | Get enquiry details |
| PATCH | /enquiries/{id} | Required | Update enquiry status |
| POST | /enquiries/verify-whatsapp | Public | Verify WhatsApp number |
POST /enquiries
{
"to_company_id": "7b3f1c2d-4e5a-6f7b-8c9d-0e1f2a3b4c5d",
"product_id": "9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"message": "Interested in bulk order of 500 units",
"quantity": 500,
"user_name": "Amit Sharma",
"user_email": "amit@example.com",
"user_phone": "+91-9876543210"
}
| Field | Type | Required | Description |
|---|---|---|---|
to_company_id | uuid | Yes | Supplier company receiving the enquiry |
product_id | uuid | No | Specific product of interest |
message | string | No | Enquiry message |
quantity | int | No | Requested quantity |
user_name | string | Yes | Buyer’s name |
user_email | string | Yes | Buyer’s email |
user_phone | string | No | Buyer’s phone number |
201 Created{
"id": "550e8400-e29b-41d4-a716-446655440000",
"to_company_id": "7b3f1c2d-4e5a-6f7b-8c9d-0e1f2a3b4c5d",
"product_id": "9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"message": "Interested in bulk order of 500 units",
"quantity": 500,
"user_name": "Amit Sharma",
"user_email": "amit@example.com",
"user_phone": "+91-9876543210",
"status": "pending",
"zoho_lead_id": null,
"created_at": "2024-01-15T10:30:00Z"
}
| Status | Detail |
|---|---|
400 | Validation error (e.g. company not found) |
500 | Failed to create enquiry |
GET /enquiries
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
company_id | uuid | No | — | Filter by supplier company (must be yours) |
status | string | No | — | Filter by status |
source_platform | string | No | — | Filter by source platform |
page | int | No | 1 | Page number |
page_size | int | No | 50 | Items per page (max 100) |
| Value | Meaning |
|---|---|
pending | New, not yet acted on |
contacted | Initial contact made |
qualified | Lead qualified |
converted | Converted to customer |
lost | Lost opportunity |
200 OK{
"items": [...],
"total": 142,
"page": 1,
"page_size": 50,
"total_pages": 3
}
| Status | Detail |
|---|---|
403 | Not enough permissions to access this company’s enquiries |
GET /enquiries/{enquiry_id}
200 OK| Status | Detail |
|---|---|
404 | Enquiry not found |
PATCH /enquiries/{enquiry_id}
{
"status": "qualified",
"notes": "Buyer confirmed budget and timeline"
}
| Field | Type | Required | Description |
|---|---|---|---|
status | string | No | New status (see status values above) |
notes | string | No | Internal notes |
200 OK| Status | Detail |
|---|---|
404 | Enquiry not found |
POST /enquiries/verify-whatsapp
{
"phone": "+91-9876543210"
}
200 OK{
"phone": "+91-9876543210",
"is_valid": true,
"is_whatsapp": true,
"error": null
}
POST /enquiries
└── Enquiry saved to DB
└── Background task:
├── WhatsApp message → supplier's phone
├── Email notification → supplier
└── Zoho CRM push → Lead created (zoho_lead_id stored on success)
| Endpoint | Limit |
|---|---|
POST /enquiries | 60/min (public) |
POST /enquiries/verify-whatsapp | 60/min (public) |
| All authenticated endpoints | 120/min (general) |