API: Update Schedule

Request

Update the details of a specific schedule by ID:

PUT /schedules/{id}

Request Body:


{
  "name": "Updated Morning Schedule"
}
                

Sample Response:


{
  "status": "success",
  "message": "Schedule updated successfully",
  "data": {
    "id": 1,
    "name": "Updated Morning Schedule",
    "status": 1,
    "created_by": 1,
    "updated_by": 1,
    "created_at": "2024-01-01T12:00:00",
    "updated_at": "2024-01-15T14:30:00",
    "deleted_at": null
  }
}
                

Validation Rules:

  • name - Required, string, maximum 255 characters

Notes:

  • The schedule ID is required in the URL to specify which schedule to update.
  • If the schedule does not exist or has been deleted, the API will return a 404 error.