Skip to main content

Endpoint

PUT /api/v1/tickets/{id}

Authentication

Requires authentication with ticket:write permission.

Path Parameters

ParameterTypeRequiredDescription
idstring (UUID)YesTicket ID to update

Request Body

{
  "category": "ELECTRICITY",
  "title": "Power Outage - Building A",
  "description": "Updated description of the issue with more details",
  "attachments": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
  "notes": "Updated with additional information from technician"
}

Body Parameters

ParameterTypeRequiredDescription
categorystringNoUpdated ticket category
titlestringNoUpdated short title/summary (max 120 chars)
descriptionstringNoUpdated description of the issue
attachmentsstring[]NoUpdated array of attachment URLs
notesstringNoUpdated notes/comments about the ticket

Valid Categories

  • MAINTENANCE - Building maintenance and repairs
  • SECURITY - Security-related issues and concerns
  • CLEANING - Cleaning and sanitation requests
  • WASTE - Waste management and disposal
  • ELECTRICITY - Electrical issues and repairs
  • WATER - Water supply and plumbing issues
  • GAS - Gas supply and safety concerns
  • INTERNET - Internet connectivity and IT issues
  • OTHER - Miscellaneous requests

Request Example

curl -X PUT "http://localhost:3001/api/v1/tickets/550e8400-e29b-41d4-a716-446655440000" \
  -H "Content-Type: application/json" \
  -H "Cookie: session=your-session-cookie" \
  -d '{
    "category": "ELECTRICITY",
    "title": "Power Outage - Building A",
    "description": "Updated description of the issue with more details",
    "attachments": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
    "notes": "Updated with additional information from technician"
  }'

Response

Success Response (200)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "userId": "550e8400-e29b-41d4-a716-446655440001",
  "status": "PENDING",
  "category": "ELECTRICITY",
  "title": "Power Outage - Building A",
  "description": "Updated description of the issue with more details",
  "attachments": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
  "assignedTo": "550e8400-e29b-41d4-a716-446655440002",
  "notes": "Updated with additional information from technician",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T13:00:00Z"
}

Error Response (400)

{
  "success": false,
  "error": {
    "message": "Validation failed",
    "code": "VALIDATION_ERROR",
    "details": {
      "category": "Invalid category value"
    }
  }
}

Error Response (404)

{
  "success": false,
  "error": {
    "message": "Ticket not found",
    "code": "NOT_FOUND"
  }
}

Error Response (401)

{
  "success": false,
  "error": {
    "message": "Unauthorized access",
    "code": "UNAUTHORIZED"
  }
}

Error Response (403)

{
  "success": false,
  "error": {
    "message": "Insufficient permissions",
    "code": "FORBIDDEN"
  }
}

Notes

  • The updatedAt timestamp is automatically updated
  • Only the provided fields are updated; omitted fields remain unchanged
  • The status, assignedTo, and userId fields cannot be updated through this endpoint
  • The title field has a maximum length of 120 characters
  • The notes field is a single text string, not an array
  • Use Change Ticket Status to update status
  • Use Assign Ticket to update assignment
  • Attachment URLs should be valid and accessible