Inquiries API
Inquiry management and workflow automation system
Overview
The Inquiries API provides a webform submission endpoint for external platforms to send inquiries with personal contact data, business information, and inquiry details. The system automatically processes submissions, sends acknowledgment emails, and tracks inquiry status through its lifecycle.
Personal Data
- Name and contact info
- Address details
- Phone and email
Business Data
- Company details
- Business address
- Invoice & VAT info
Features
- Type categorization with icons
- Auto-acknowledgment
- Per-type status pipelines
- Status audit history
- Transition validation
- Offer management
Status engine: inquiry transitions are validated against the ordered, per-type pipeline from
GET /api/inquiries/meta/statuses. Status history is written to the shared status package when available,
with automatic fallback to the legacy inquiry history table.
| Method | Endpoint | Description | Requirements |
|---|---|---|---|
| Inquiry Types | |||
| GET | /api/inquiries/meta/types | Get all available inquiry types with icons and metadata. Each type includes a <code>statuses</code> array with the ordered workflow pipeline for that type. |
|
| Inquiry Submission | |||
| POST | /api/inquiries | Submit a new inquiry. User profile data (name, email, address) is fetched from UserHub using user_id — do not send personal data in this payload. |
|
| Inquiry Management | |||
| GET | /api/inquiries/list | List inquiries with filtering |
|
| GET | /api/inquiries/{id} | Retrieve inquiry details with related offers |
|
| POST | /api/inquiries/{id}/action | Perform action on inquiry (update status, close) |
|
| File Attachments | |||
| GET | /api/inquiries/{id}/attachments | List all file attachments for an inquiry |
|
| POST | /api/inquiries/{id}/attachments | Upload a file attachment to an inquiry (multipart/form-data) |
|
| GET | /api/inquiries/{id}/attachments/{attachmentId}/download | Download an attachment file |
|
| DELETE | /api/inquiries/{id}/attachments/{attachmentId} | Delete an attachment (removes file from disk) |
|
| Status & History | |||
| GET | /api/inquiries/meta/statuses | Get all inquiry type status pipelines grouped by type slug. Each pipeline lists the ordered workflow steps with key, label, description, color, and terminal/initial flags. |
|
| GET | /api/inquiries/{id}/history | Get the full status change audit trail for an inquiry, ordered oldest first |
|
Request Examples
Get Available Inquiry Types
GET /api/inquiries/meta/types
Response:
Submit Inquiry (customer submits their own request)
POST /api/inquiries
User profile data (name, email, address) is fetched from UserHub using user_id. Do not send personal data in this payload.
Submit Inquiry (contractor/admin on behalf of a customer)
POST /api/inquiries
Pass the customer's ID as user_id (ownership & visibility) and the
contractor's/admin's ID as created_by (audit trail).
The server honours user_id from the payload without overriding it with the token holder's identity.
If created_by is omitted the server derives it automatically from the proxy token context.
Success Response (201 Created)
user_id is the owning customer. created_by is the actor who submitted
the request (same as user_id when the customer submits their own inquiry;
different when a contractor/admin acts on their behalf).
Get Inquiry Details
GET /api/inquiries/42
List Inquiries with Filtering
GET /api/inquiries/list?status=open&per_page=10
Filter by Inquiry Type
GET /api/inquiries/list?inquiry_type=callback_request
You can filter by type slug or ID: ?inquiry_type=2
Get Inquiry Type Status Pipelines
GET /api/inquiries/meta/statuses
Returns all workflow pipelines grouped by type slug. Use ?type=offer_request to limit to one type. The maps_to_case_status field indicates the advisory case status a transitioning inquiry maps to (if any).
Transition Validation Error Example
POST /api/inquiries/42/action
When a requested transition is not part of the inquiry type pipeline, the API rejects it.
Get Inquiry Status History
GET /api/inquiries/42/history
Returns the append-only audit trail of all status transitions for the inquiry, ordered oldest first. from_status is null for the initial creation entry. changed_by is the UserHub user ID of the actor who made the change (may be null for system-triggered changes).