Enquiries
Retrieve enquiry history and create enquiries
Enquiries
Returns a paginated list of enquiries submitted by the authenticated customer.
Endpoint
GET /enquiriesAuthentication
Requires a valid JWT access token.
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 50 | Number of enquiries to return (1 to 100) |
cursor | string | - | Enquiry ID to paginate from |
status | string | - | Filter by the organization's enquiry status value |
Common Status Values
Organizations can configure their enquiry workflow statuses. Common values include:
| Status | Description |
|---|---|
new | Enquiry has been submitted and not yet reviewed |
open | Enquiry is being looked at |
pending | Waiting for additional information or action |
resolved | Enquiry has been resolved |
closed | Enquiry is closed |
Example Request
curl -X GET "https://edge.tiquo.app/api/client/v1/enquiries?status=open&limit=10" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."Response
{
"success": true,
"data": {
"enquiries": [
{
"id": "enq_123",
"enquiryNumber": "ENQ-001234",
"type": "general",
"subject": "Question about services",
"message": "I have a question about your consultation packages.",
"category": "Sales",
"status": "resolved",
"priority": "medium",
"source": "website",
"responseCount": 2,
"createdAt": "2025-01-30T12:00:00Z",
"updatedAt": "2025-01-30T14:00:00Z",
"customerRole": "primary"
}
],
"hasMore": false
}
}Enquiry Object
| Field | Type | Description |
|---|---|---|
id | string | Enquiry document ID |
enquiryNumber | string | Human-readable enquiry number (e.g. ENQ-001234) |
type | string | Type of enquiry (e.g. general, support) |
subject | string | Subject line |
message | string | The enquiry message content |
category | string | Enquiry category (e.g. Sales, Support) |
status | string | Enquiry status (see values above) |
priority | string | One of: low, medium, high, urgent |
source | string | Where the enquiry came from (e.g. website, email) |
responseCount | integer | Number of responses to this enquiry |
createdAt | string | ISO 8601 timestamp when the enquiry was created |
updatedAt | string | ISO 8601 timestamp of the last update |
firstResponseAt | string or omitted | ISO 8601 timestamp of the first response |
resolvedAt | string or omitted | ISO 8601 timestamp when the enquiry was resolved |
customerRole | string | The customer's role (e.g. primary) |
Pagination
When hasMore is true, pass the response's nextCursor as the cursor parameter to fetch the next page.
Create an Enquiry
POST /enquiriesAuthenticated customers can create an enquiry with their bearer token. An unauthenticated website integration can instead send its public integration key in the publicKey field or X-Public-Key header, subject to its configured allowed origins.
The request body contains customer and enquiry objects. customer.email is required, and the enquiry must include at least one of message or subject.
curl -X POST "https://edge.tiquo.app/api/client/v1/enquiries" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
-H "Content-Type: application/json" \
-d '{
"customer": {
"firstName": "John",
"lastName": "Smith",
"email": "john@example.com",
"phone": "+441234567890"
},
"enquiry": {
"subject": "Question about services",
"message": "Please send me more information.",
"priority": "medium",
"source": "website"
}
}'A successful request returns 201 Created. The canonical result is in data, and enquiry and customer are also repeated at the top level for SDK compatibility.
{
"success": true,
"data": {
"enquiry": {
"id": "enq_123",
"enquiryNumber": "ENQ-001234",
"status": "new",
"priority": "medium",
"source": "website"
},
"customer": {
"id": "cust_456",
"customerNumber": "CUST-000001",
"email": "john@example.com"
}
},
"enquiry": { "id": "enq_123", "enquiryNumber": "ENQ-001234" },
"customer": { "id": "cust_456", "customerNumber": "CUST-000001" }
}For unauthenticated submissions, the returned customer contains only stable identifiers and the contact values submitted in this request; it does not expose an existing matched customer's stored profile or financial data.
Errors
| Status | Description |
|---|---|
400 | Missing or invalid customer or enquiry fields |
401 | Invalid or expired access token |
403 | The origin is not allowed for an unauthenticated submission |
500 | Internal server error |
Code Examples
JavaScript
async function getEnquiries(accessToken, options = {}) {
const params = new URLSearchParams();
if (options.limit) params.set('limit', options.limit);
if (options.cursor) params.set('cursor', options.cursor);
if (options.status) params.set('status', options.status);
const response = await fetch(
`https://edge.tiquo.app/api/client/v1/enquiries?${params}`,
{
headers: { 'Authorization': `Bearer ${accessToken}` },
}
);
return response.json();
}
const result = await getEnquiries(token, { status: 'open' });
console.log(`You have ${result.data.enquiries.length} open enquiries`);