HGV Traders Docs

Enquiries API

Pull buyer enquiry records for your organisation via the bearer-authenticated API.

Overview

Use these routes to poll buyer enquiries into your CRM or DMS. For real-time delivery, prefer Webhooks (enquiry.created).

MethodPathPurpose
GET/api/v1/enquiriesPaginated enquiry list
GET/api/v1/enquiries/{id}Single enquiry detail

Both routes require bearer authentication. Pass organisationId when the user belongs to multiple organisations — see Accounts.

Note: Replying to enquiries is not available via REST in v1 — use the dashboard.

Response fields

Each enquiry includes buyer contact details and a linked stock summary:

FieldTypeDescription
idstringEnquiry CUID
stockIdstringLinked listing ID
organisationIdstringOwning dealership
namestringBuyer name
emailstringBuyer email
phonestring | nullBuyer phone
messagestringEnquiry message
statusenumNEW, CONTACTED, NEGOTIATING, SOLD, LOST
readAtISO datetime | nullWhen marked read in dashboard
repliedAtISO datetime | nullWhen dealer replied
firstResponseAtISO datetime | nullFirst response timestamp
createdAt, updatedAtISO datetimeRecord timestamps
stockobject{ id, title, slug } — linked listing summary

Internal dealer notes (dealerNote) are not exposed via the API.

List enquiries

curl "https://hgvtraders.com/api/v1/enquiries?status=NEW&limit=20&page=1" \
  -H "Authorization: Bearer YOUR_TOKEN"

Multi-org:

curl "https://hgvtraders.com/api/v1/enquiries?organisationId=clorg123abc&status=NEW" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "data": {
    "enquiries": [
      {
        "id": "clenq111aaa",
        "stockId": "clstk456def",
        "organisationId": "clorg123abc",
        "name": "Jane Smith",
        "email": "jane@example.com",
        "phone": "+447700900123",
        "message": "Is this still available? Can I arrange a viewing?",
        "status": "NEW",
        "readAt": null,
        "repliedAt": null,
        "firstResponseAt": null,
        "createdAt": "2024-06-01T14:22:00.000Z",
        "updatedAt": "2024-06-01T14:22:00.000Z",
        "stock": {
          "id": "clstk456def",
          "title": "2020 DAF XF 530",
          "slug": "2020-daf-xf-530"
        }
      }
    ],
    "total": 8,
    "page": 1,
    "pages": 1
  }
}

Query parameters

ParameterDescription
organisationIdRequired when user has multiple org memberships
statusFilter: NEW, CONTACTED, NEGOTIATING, SOLD, LOST
pagePage number (default 1)
limitItems per page (default 20, max 100)

Results are ordered by createdAt descending (newest first). See Pagination.

Get a single enquiry

curl "https://hgvtraders.com/api/v1/enquiries/clenq111aaa?organisationId=clorg123abc" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "data": {
    "id": "clenq111aaa",
    "stockId": "clstk456def",
    "organisationId": "clorg123abc",
    "name": "Jane Smith",
    "email": "jane@example.com",
    "phone": "+447700900123",
    "message": "Is this still available? Can I arrange a viewing?",
    "status": "NEW",
    "readAt": null,
    "repliedAt": null,
    "firstResponseAt": null,
    "createdAt": "2024-06-01T14:22:00.000Z",
    "updatedAt": "2024-06-01T14:22:00.000Z",
    "stock": {
      "id": "clstk456def",
      "title": "2020 DAF XF 530",
      "slug": "2020-daf-xf-530"
    }
  }
}

Returns 404 if the enquiry does not exist or belongs to another organisation.

Polling vs webhooks

ApproachWhen to use
WebhooksReal-time CRM push on enquiry.created — see Webhooks
PollingBatch export, legacy systems, or webhook fallback — poll GET /api/v1/enquiries?status=NEW on an interval

Track the highest createdAt or enquiry id you have processed to avoid duplicates.

Typical integration flow

  1. Register a webhook for enquiry.created or poll GET /api/v1/enquiries?status=NEW every few minutes
  2. Fetch detail with GET /api/v1/enquiries/{id} if the list payload is insufficient
  3. Create a lead in your CRM using name, email, phone, message, and stock.title
  4. Mark progress in the HGV Traders dashboard (status changes are not writable via API v1)

Errors

StatusTypical cause
400Invalid query or missing organisationId for multi-org users
401Invalid or missing bearer token
404Enquiry not found or wrong organisation
429Write rate limit exceeded (shared bucket with other bearer write routes)

See Errors.