---
title: "Create Task"
method: POST
path: "/tasks"
tags: ["Task"]
---

# Create Task

`POST /tasks`

Create a schedule task. The task may be linked to a property (`property_id`), to a specific stay (`stay_code`), and/or assigned to a staff (`staff_id`); all are optional. When `stay_code` is provided the task is linked to the reservation; `property_id` is inferred from the stay when omitted (and must match the stay's property when both are supplied). The `type` selects the task category and `level` is only meaningful for cleaning tasks.

## Request body

- object
  - `type` 'cleaning' | 'maintenance' | 'reception' | 'room_service' | 'other', required — Task category.
  - `stay_code` string — Stay code to link the task to a specific reservation. When provided, the task is linked to the reservation and `property_id` defaults to the stay's property (an explicit `property_id` must match).
  - `property_id` integer — Id of the property the task belongs to. Omit to record an unassigned task (or to inherit from `stay_code` when supplied).
  - `staff_id` integer — Id of the staff to assign. Omit to leave the task unassigned.
  - `expected_date` string, date, required — Expected execution date in `YYYY-MM-DD`. Interpreted in the operator's configured timezone (see [Account Settings](https://hostex.io/app/account/setting)).
  - `expected_time` string — Expected execution time in `HH:mm:ss`. Optional. Interpreted in the operator's configured timezone.
  - `level` 'standard' | 'simple' | 'advanced' — Cleaning level. Only meaningful when `type=cleaning`.
  - `currency` string, required — Currency code for `fee`. See [Supported Currencies](/reference/supported-currencies) for more information.
  - `fee` number — Task fee. Defaults to 0 (or to the property's configured cleaning fee for cleaning tasks linked to a property when omitted).
  - `note` string — Free-form note attached to the task (max 500 characters).

## Response `200`

The task has been successfully created.

- object
  - `request_id` string, required — Unique identifier for the request.
  - `error_code` integer, required — Numeric error code representing the status of the response. A value of `200` indicates success. <br> See the [Error Codes](/reference/error-manual#error-codes) section for more information.
  - `error_msg` string, required — Message detailing the status of the response.
  - `data` object, required
    - `task_id` integer, required — Unique identifier of the newly created task.

---

[API](https://skmtc.net/hostex/apis/hostex-api.md) · [All operations](https://skmtc.net/hostex/apis/hostex-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hostex/hostex-api/revisions/a3fa555dee66/schema)
