# Update Ticket Assignee

{% hint style="warning" %}
All API requests should contain [authorization headers](https://developers.socialboards.com/docs/apis/tickets/authorization-headers).
{% endhint %}

#### Request&#x20;

```
PATCH /tickets/{ticketId}/Assignee
```

#### Query Parameters

<table><thead><tr><th>Name</th><th width="100">Type</th><th width="100">Required</th><th>Comments</th></tr></thead><tbody><tr><td>ticketId</td><td>integer</td><td>yes</td><td>Id of ticket you want to update.</td></tr></tbody></table>

#### Request Body

The request body must contain the model with the Id of the teammate (as `assigneeId`) and the current user assigned to the ticket (as `previousAssigneeId`). Send `assigneeId` as null if you want to set the ticket as unassigned.

You can obtain the list of teammates by requesting the corresponding [teammates endpoint](https://developers.socialboards.com/docs/apis/tickets/reference/endpoints/get-all-teammates).

You can retrieve the current assigned user value from the response from [get ticket by id endpoint](https://developers.socialboards.com/docs/apis/tickets/reference/endpoints/get-ticket-by-id) (property `lockedBy` in the response object).

```json
{
    "assigneeId": "31aee6af-3e38-40d9-98b1-aa2b9238f24d",
    "previousAssigneeId": "null"
}
```

You cannot assign a user, which is not a part of the team (such as a client, vendor, or read-only user).&#x20;

<table><thead><tr><th>Name</th><th width="100">Type</th><th width="100">Required</th><th>Comments</th></tr></thead><tbody><tr><td>assigneeId</td><td>Guid</td><td>yes</td><td>Unique Id of a teammate who is assigned to the ticket. Set to <code>null</code> if the ticket should be unassigned</td></tr><tr><td>previousAssigneeId</td><td>Guid</td><td>yes</td><td>Unique Id of the current teammate who is assigned to the ticket. If the ticket is unassigned, the value should be set to <code>null</code></td></tr></tbody></table>

**Response**

```json
{
  "data": {},
  "errorCode": -1,
  "errorText": null
}
```
