Skip to main content

Introduction

Welcome to the ServITech Backend API documentation. This RESTful API provides comprehensive functionality for managing IT service requests, knowledge base articles, and user management. The API is built with Laravel and uses JWT (JSON Web Tokens) for authentication, providing secure access to protected endpoints.

Base URL

The API base URL depends on your environment:
Local Development: http://localhost:8000/api
For more details, see the Base URL Configuration page.

Authentication

Most endpoints require authentication using JWT tokens. To authenticate:
  1. Register a new account or login using the authentication endpoints
  2. Include the JWT token in subsequent requests using the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
Tokens expire after a specified time period (default: 60 minutes). You’ll receive the expiration time when you login.

Localization

All API endpoints support multi-language responses. The API automatically adapts to the user’s preferred language based on:
  • URL parameter
  • Cookie value
  • Session data
  • Accept-Language header

Supported Languages

  • Spanish (es) - Default language
  • English (en) - Fallback language

Example Request with Localization

curl -X GET "http://localhost:8000/api/articles" \
  -H "Accept-Language: en"

API Endpoints

The API is organized into the following categories:

Authentication

User registration, login, logout, and password reset

Articles

Knowledge base articles management

Categories

Article category management (Admin only)

Subcategories

Article subcategory management

Support Requests

User support request management (Authenticated)

Repair Requests

Device repair request management (Admin only)

User Profile

User profile and password management

Authentication Endpoints

All authentication endpoints are public (no authentication required).
MethodEndpointDescription
POST/auth/loginLogin with email and password
POST/auth/registerRegister a new user account
POST/auth/logoutLogout the authenticated user
POST/auth/reset-passwordSend password reset link
PUT/auth/reset-passwordReset password with token

Article Endpoints

Most article endpoints are public. Only create, update, and delete require Admin authentication.
MethodEndpointDescriptionAuth Required
GET/articlesGet all articlesNo
POST/articlesCreate a new articleAdmin
GET/articles/{category}Get articles by categoryNo
GET/articles/id/{article}Get article by IDNo
PUT/articles/{article}Update an articleAdmin
DELETE/articles/{article}Delete an articleAdmin

Category Endpoints

All category endpoints require Admin authentication.
MethodEndpointDescription
GET/categoryGet all categories
POST/categoryCreate a new category
GET/category/{name}Get category by name
PUT/category/{name}Update a category
DELETE/category/{name}Delete a category

Subcategory Endpoints

Subcategory endpoints are public for read operations.
MethodEndpointDescriptionAuth Required
GET/subcategoriesGet all subcategoriesNo
POST/subcategoriesCreate a subcategoryYes
GET/subcategories/{id}Get subcategory by IDNo
PUT/subcategories/{id}Update a subcategoryYes
DELETE/subcategories/{id}Delete a subcategoryYes

Support Request Endpoints

All support request endpoints require authentication.
MethodEndpointDescription
GET/support-requestGet all support requests
POST/support-requestCreate a new support request
GET/support-request/{id}Get support request by ID
PUT/support-request/{id}Update a support request
DELETE/support-request/{id}Delete a support request

Repair Request Endpoints

All repair request endpoints require Admin authentication.
MethodEndpointDescription
GET/repair-requestGet all repair requests
POST/repair-requestCreate a new repair request
GET/repair-request/{receipt_number}Get by receipt number
PUT/repair-request/{receipt_number}Update a repair request
DELETE/repair-request/{receipt_number}Delete a repair request

User Endpoints

All user endpoints require authentication.
MethodEndpointDescription
GET/user/profileGet current user profile
PUT/user/profileUpdate user basic information
PUT/user/passwordUpdate user password

Response Format

All API responses follow a consistent JSON structure. For detailed information about response formats, status codes, and error handling, see the Response Format page.

Success Response Example

{
  "status": 200,
  "message": "Success",
  "data": {
    // Response data here
  }
}

Error Response Example

{
  "status": 400,
  "message": "Error message",
  "errors": {
    // Error details here
  }
}

Rate Limiting

Currently, there are no rate limits enforced on the API. However, please use the API responsibly.

Versioning

The current API version is v1.0.0. The version may be updated in future releases with backward compatibility in mind.

Support

For questions or issues with the API, please contact the development team or file an issue in the project repository.

Build docs developers (and LLMs) love