Skip to main content
This endpoint requires authentication. The support request will be automatically associated with the authenticated user.

Endpoint

POST /support-request

Authentication

This endpoint requires a valid JWT token. Include the token in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN

Request Body

date
string
required
The date and time when support is needed. Must be a valid date format (e.g., YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
location
string
required
The location where support is needed. Must be at least 10 characters long
detail
string
required
A detailed description of the issue or support needed. Must be at least 10 characters long

Validation Rules

  • date: Required, must be a valid date
  • location: Required, must be a string, minimum 10 characters
  • detail: Required, must be a string, minimum 10 characters

Response

success
boolean
required
Indicates whether the request was successful
message
string
required
A human-readable message describing the result
data
object
required
The response data object

Response Examples

{
  "success": true,
  "message": "Support request created successfully",
  "data": {
    "supportRequest": {
      "id": 4,
      "user_id": 1,
      "date": "2026-03-15T10:30:00.000000Z",
      "location": "Building A, Room 305",
      "detail": "Network connectivity issues in the conference room. Unable to connect to WiFi.",
      "created_at": "2026-03-08T15:30:45.000000Z",
      "updated_at": "2026-03-08T15:30:45.000000Z",
      "deleted_at": null
    }
  }
}

Code Examples

curl -X POST https://api.example.com/support-request \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Accept-Language: en" \
  -d '{
    "date": "2026-03-15 10:30:00",
    "location": "Building A, Room 305",
    "detail": "Network connectivity issues in the conference room. Unable to connect to WiFi."
  }'

Error Responses

401 Unauthorized
Returned when the request is made without a valid JWT token or the token has expired
422 Unprocessable Entity
Returned when validation fails. The response includes an errors object with field-specific error messages

Behavior

  • The user_id is automatically set to the authenticated user’s ID
  • When a support request is created, all administrators receive a notification
  • The endpoint returns HTTP status code 201 (Created) on success
  • All timestamps are automatically managed by Laravel

Notes

  • The date field accepts various date formats but will be stored and returned in ISO 8601 format
  • Both location and detail must be at least 10 characters to ensure meaningful information
  • Administrators are notified via Laravel’s notification system when a new support request is created

Build docs developers (and LLMs) love