> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.travtus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Task

> This endpoint allows users to update a task created by Adam.

This endpoint allows you to update a task with provided details.

You must provide either `identifier` parameter or an external reference via the `external_ref` attribute.

All datetime fields included in the body parameters need to be specified as [ISO8601-formatted date strings](https://en.wikipedia.org/wiki/ISO_8601).

Datetime fields should follow a "YYYY-MM-DDThh:mm:ss" format.

### Header

<ParamField header="Authorization" default="none" type="string" required>
  The authentication token for your request
</ParamField>

### Body

<ParamField body="identifier" default="none" type="string">
  The identifier of a task to use for updating a task.

  Please note you can either use the `identifier` or `external_ref` to update a task.
</ParamField>

<ParamField body="external_ref" default="none" type="string">
  The external reference of a task to use for updating a task.

  Please note you can either use the `identifier` or `external_ref` to update a task.
</ParamField>

<ParamField body="status" default="none" type="enum">
  The status of a task.

  Possible values: `created`, `in_progress`, `completed`, `error`  or `deleted`
</ParamField>

<ParamField body="due_datetime" default="none" type="datetime">
  The due date of the task. Example: 2023-01-01T00:00:00
</ParamField>

<ParamField body="reminder_datetime" default="none" type="string">
  The reminder date of a task. Example: 2023-01-01T00:00:00
</ParamField>

<ParamField body="completed_datetime" default="none" type="string">
  The completed date of the task. Example: 2023-01-01T00:00:00
</ParamField>

<ParamField body="importance" default="none" type="enum">
  The importance of the task. Possible value: `low`, `normal`, `high`, `very_high`.
</ParamField>

<ParamField body="assignee_id" default="none" type="string">
  The identifier of task assignee. You can use this field to update the task assignee.
</ParamField>

<ParamField body="resident_id" default="none" type="string">
  The identifier of the resident that the task is targeted for. You can use this field to update the task resident.
</ParamField>

<ParamField body="notes" default="none" type="string">
  The notes of the task.
</ParamField>

<ParamField body="title" default="none" type="string">
  The title of the task.
</ParamField>

<ParamField body="description" default="none" type="string">
  The description of the task.
</ParamField>

### Response

<ResponseField name="request_id" type="string">
  The UUID of the request. We handle requests asynchronously, the task update result will be sending by webhook event. You can use this ID to lookup webhook event on [consumer application portal](../webhook/consumer-app-portal).
</ResponseField>

<RequestExample>
  ```bash Example theme={null}
  curl --location --request PATCH 'https://api.travtus.com/task/' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <token>' \
  --data-raw '{
      "identifier": "2b1d4c71-766c-4834-a671-bea629e9af39",
      "status": "completed",
      "due_datetime": "2023-11-11 20:00:00",
      "notes": "Some notes"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
      "request_id": "5dc8327b-ebcb-4185-a0d0-5a5d40c56ed2"
  }
  ```

  ```json 401 theme={null}
  {
      "error": {
      "type": "missing_authorization",
      "message": "Your request does not include an 'Authorization' header with a bearer token for your account."
  }
  }
  ```

  ```json 401 theme={null}
  {
      "error": {
      "type": "expired_token",
      "message": "The bearer token you have provided in the 'Authorization' header has expired. Please obtain a new one."
  }
  }
  ```

  ```json 401 theme={null}
  {
      "error": {
      "type": "invalid_authorization",
      "message": "The bearer token you have provided in the 'Authorization' header is invalid."
  }
  }
  ```
</ResponseExample>
