Skip to main content
This endpoint requires authentication. Users can only update their own support requests.

Endpoint

PUT /support-request/{id}

Authentication

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

Path Parameters

id
integer
required
The unique identifier of the support request to update

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 updated successfully",
  "data": {
    "supportRequest": {
      "id": 1,
      "user_id": 1,
      "date": "2026-03-16T14:00:00.000000Z",
      "location": "Building A, Room 305 - Updated",
      "detail": "Network connectivity issues resolved. WiFi is now working properly.",
      "created_at": "2026-03-08T14:22:10.000000Z",
      "updated_at": "2026-03-08T16:45:30.000000Z",
      "deleted_at": null
    }
  }
}

Code Examples

curl -X PUT https://api.example.com/support-request/1 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Accept-Language: en" \
  -d '{
    "date": "2026-03-16 14:00:00",
    "location": "Building A, Room 305 - Updated",
    "detail": "Network connectivity issues resolved. WiFi is now working properly."
  }'

Error Responses

401 Unauthorized
Returned when the request is made without a valid JWT token or the token has expired
404 Not Found
Returned when:
  • The support request with the specified ID does not exist
  • The support request belongs to a different user (implicit ownership check)
422 Unprocessable Entity
Returned when validation fails. The response includes an errors object with field-specific error messages

Behavior

  • The user_id cannot be changed and remains associated with the original creator
  • The updated_at timestamp is automatically updated when the record is modified
  • All fields (date, location, detail) are required for the update

Notes

  • This is a full update endpoint (PUT), so all required fields must be provided
  • Users can only update support requests they created
  • The endpoint checks if the support request exists before attempting to update it
  • Laravel’s route model binding is used for automatic model retrieval

Build docs developers (and LLMs) love