Skip to content

Get All Contacts

Get a paginated list of all contact form submissions.

Endpoint

GET /v1/contacts/

Authentication

Required

Query Parameters

Parameter Type Required Description
page integer Yes Page number (starts at 1)
count integer Yes Items per page (max 100)
search string No Search across all contact fields (case-insensitive)

Response

Success (200 OK)

{
  "count": 25,
  "data": [
    {
      "id": 1,
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@example.com",
      "phone": "+994501234567",
      "county": "Baku",
      "subject": "Inquiry about products",
      "message": "I have a question regarding...",
      "created": "01-15-2025 10:30:00"
    }
  ]
}

Error Responses

Unauthorized (401)

{
  "error": "Missing token on header!"
}

Pagination Error (400)

{
  "error": "page cannot be zero or minus"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/contacts/?page=1&count=20&search=john" \
  -H "Authorization: Token your_access_token"

Notes

  • Only returns non-deleted contacts
  • Search matches against: first_name, last_name, email, phone, county, subject, message
  • Results are ordered by ID descending (newest first)