Help & Support

These endpoints allow users to create support tickets and allow administrators to manage them. Each ticket includes user details, a message, and a status. Emails are also triggered upon creation to confirm receipt.

📌 Common use cases: customer support, onboarding inquiries, issue resolution tracking.


🔸 POST /help-support/{user_id} – Submit a Support Ticket

Create a new help & support ticket for a specific user.

📥 Request Body:

{
  "name": "Jane Doe",
  "phone_number": "+1234567890",
  "email": "[email protected]",
  "message": "I'm having trouble connecting my database."
}

🔐 Auth Required: ❌ No 📨 Email confirmation is automatically sent to the user

📤 Response:

{
  "id": "b8234b1d-a657-4c99-bdf3-e125e9b027d0",
  "name": "Jane Doe",
  "phone_number": "+1234567890",
  "email": "[email protected]",
  "message": "I'm having trouble connecting my database.",
  "status": "open",
  "created_at": "2025-07-04T12:00:00Z",
  "updated_at": "2025-07-04T12:00:00Z"
}

✅ cURL Example:

curl -X POST https://api.yourdomain.com/help-support/abc123-userid \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "phone_number": "+1234567890",
    "email": "[email protected]",
    "message": "I'm having trouble connecting my database."
  }'

✅ JavaScript (fetch):

await fetch("https://api.yourdomain.com/help-support/abc123-userid", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    name: "Jane Doe",
    phone_number: "+1234567890",
    email: "[email protected]",
    message: "I'm having trouble connecting my database."
  })
});

🔸 GET /help-support/{ticket_id} – Get a Support Ticket by ID

🔐 Auth Required: ✅ Yes (Admin)

✅ cURL:

curl -X GET https://api.yourdomain.com/help-support/42 \
  -H "Authorization: Bearer <admin_token>"

🔸 GET /help-support – List All Support Tickets

Lists all support tickets (paginated).

Query Parameters:

  • skip: Offset (default: 0)

  • limit: Number of results (default: 100)

✅ cURL:

curl "https://api.yourdomain.com/help-support?skip=0&limit=50" \
  -H "Authorization: Bearer <admin_token>"

🔸 PATCH /help-support/{ticket_id}/status – Update Ticket Status

Update the status of a support ticket (e.g., open → resolved, pending → closed).

📥 Query Parameter:

  • status=resolved

✅ cURL:

curl -X PATCH "https://api.yourdomain.com/help-support/42/status?status=resolved" \
  -H "Authorization: Bearer <admin_token>"

🎯 Ticket Lifecycle

  • Status values: "open", "pending", "resolved", "closed"

  • Each submission triggers a confirmation email using HTML templates

  • Admins can view, filter, and update status as the ticket progresses


Last updated