# Update a ticket

`PUT /api/tickets/{id}`



- **Group:** Tickets
- **Since:** v0.0.0
- **Authentication:** `authtoken` header, created under Setup > API > API Management
- **HTML version:** /apiguide/tickets/put-ticket/

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authtoken` | String | **required** | Authentication token, generated from admin area |

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `subject` | String | **required** | Mandatory Ticket name . |
| `department` | String | **required** | Mandatory Ticket Department. |
| `contactid` | String | **required** | Mandatory Ticket Contact. |
| `userid` | String | **required** | Mandatory Ticket user. |
| `priority` | String | **required** | Mandatory Priority. |
| `project_id` | String | optional | Optional Ticket Project. |
| `message` | String | optional | Optional Ticket message. |
| `service` | String | optional | Optional Ticket Service. |
| `assigned` | String | optional | Optional Assign ticket. |
| `tags` | String | optional | Optional ticket tags. |

## Example request

```bash
curl -X PUT "https://yoursite.com/api/tickets/123" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "subject": "...", "department": "...", "contactid": "...", "userid": "...", "priority": "..." }'
```

## Success response

### Success-Response:

```json
HTTP/1.1 200 OK
{
  "status": true,
  "message": "Ticket Update Successful."
}
```

## Error responses

### Error-Response:

```json
HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Ticket Update Fail."
}
```

---

Perfex CRM REST API by Themesic Interactive. Full reference: /apiguide/
