http://localhost:8000/api/ticket
All routes below are prefixed with this base URL.
Create a new support ticket as an authenticated customer.
Authorization: Bearer <customer_jwt_token>
{
"category": "Support",
"subject": "Account Issue",
"description": "I am facing an issue with my account."
}
{
"success": true,
"message": "Ticket created successfullly!",
"data": {
"_id": "6720b1c8f1c2b3a5e4d90130",
"creatorId": "671fa1c8f1c2b3a5e4d90001",
"creatorType": "customer",
"category": "Support",
"subject": "Account Issue",
"description": "I am facing an issue with my account.",
"priority": "low",
"status": "created",
"response": [],
"createdAt": "2024-10-28T11:00:00.000Z",
"updatedAt": "2024-10-28T11:00:00.000Z",
"__v": 0
}
}
Fetch all tickets associated with the authenticated customer’s team.
Authorization: Bearer <customer_jwt_token>
{
"success": true,
"message": "Ticket fetched successfullly!",
"data": [
{
"_id": "6720b1c8f1c2b3a5e4d90130",
"creatorId": "671fa1c8f1c2b3a5e4d90001",
"creatorType": "customer",
"category": "Support",
"subject": "Account Issue",
"description": "I am facing an issue with my account.",
"priority": "low",
"status": "created",
"response": [],
"createdAt": "2024-10-28T11:00:00.000Z",
"updatedAt": "2024-10-28T11:00:00.000Z",
"__v": 0
}
]
}
Add a reply/response to an existing ticket as a customer.
Authorization: Bearer <customer_jwt_token>
/create-reply?id=<ticketId>
{
"description": "I want to add more details about my issue."
}
{
"success": true,
"message": "Response added successfully!",
"data": {
"_id": "6720b1c8f1c2b3a5e4d90130",
"creatorId": "671fa1c8f1c2b3a5e4d90001",
"creatorType": "customer",
"category": "Support",
"subject": "Account Issue",
"description": "I am facing an issue with my account.",
"priority": "low",
"status": "created",
"response": [
{
"_id": "6720b321f1c2b3a5e4d90131",
"creatorId": "671fa1c8f1c2b3a5e4d90001",
"creatorType": "customer",
"description": "I want to add more details about my issue.",
"createdAt": "2024-10-28T11:05:00.000Z",
"updatedAt": "2024-10-28T11:05:00.000Z"
}
],
"createdAt": "2024-10-28T11:00:00.000Z",
"updatedAt": "2024-10-28T11:05:00.000Z",
"__v": 1
}
}
Fetch all tickets in the system as an admin.
Authorization: Bearer <admin_jwt_token>
{
"success": true,
"message": "Ticket fetched successfullly!",
"data": [
{
"_id": "6720b1c8f1c2b3a5e4d90130",
"creatorId": "671fa1c8f1c2b3a5e4d90001",
"creatorType": "customer",
"category": "Support",
"subject": "Account Issue",
"description": "I am facing an issue with my account.",
"priority": "low",
"status": "created",
"response": [],
"createdAt": "2024-10-28T11:00:00.000Z",
"updatedAt": "2024-10-28T11:00:00.000Z",
"__v": 0
}
]
}
Add a reply/response to an existing ticket as an admin.
Authorization: Bearer <admin_jwt_token>
/admin-create-reply?id=<ticketId>
{
"description": "We are looking into your issue and will update you soon."
}
{
"success": true,
"message": "Response added successfully!",
"data": {
"_id": "6720b1c8f1c2b3a5e4d90130",
"creatorId": "671fa1c8f1c2b3a5e4d90001",
"creatorType": "customer",
"category": "Support",
"subject": "Account Issue",
"description": "I am facing an issue with my account.",
"priority": "low",
"status": "created",
"response": [
{
"_id": "6720b473f1c2b3a5e4d90132",
"creatorId": "671fb1d8f1c2b3a5e4d90050",
"creatorType": "admin",
"description": "We are looking into your issue and will update you soon.",
"createdAt": "2024-10-28T11:10:00.000Z",
"updatedAt": "2024-10-28T11:10:00.000Z"
}
],
"createdAt": "2024-10-28T11:00:00.000Z",
"updatedAt": "2024-10-28T11:10:00.000Z",
"__v": 2
}
}