---
title: "Create a task"
method: POST
path: "/tasks"
tags: ["Tasks"]
---

# Create a task

`POST /tasks`

Add a new task

## Headers

- `Accept-Language` string

## Request body

- object
  - `task` Task, required — Task resource.
    - `task_id` string — The unique ID of the task.
    - `task_type_id` string, required — The unique ID of the task type. [GET /task-types](https://carecloud.readme.io/reference/gettasktypes)
    - `task_state_id` string, required — The unique ID of the task state. [GET /task-states](https://carecloud.readme.io/reference/gettaskstates)
    - `customer_id` string, required — The unique ID of the customer. [GET /customers](https://carecloud.readme.io/reference/getcustomers)
    - `task_note` string — Text note of the task.
    - `task_title` string, required — Title of the task.
    - `task_priority` 1 | 2 | 3 | 4, required — The parameter filters tasks by their priority. *Possible values are: 1 - Critical / 2 - Major / 3 - Normal / 4 - Minor.*
    - `due_date` string, date — Due date of the task in ISO-8601 format (`YYYY-MM-DD`).
    - `created_at` string — Timestamp of the task creation. Format: `YYYY-MM-DD HH:MM:SS`. All times are in the local timezone.
    - `state` 0 | 1 | 2 — State of the task. *Possible values are: 0 - deleted / 1 - active / 2 - non active*
  - `property_records` PropertyRecord[] — List of a task property records
    - `property_record_id` string — The unique ID of the property record.
    - `property_id` string, required — The unique ID of the property.
    - `property_name` string — Name of the property.
    - `property_value` union — Value of the property record. The format depends on the data type of the property. - **string** – a plain text value: ```json { "property_id": "p1_note", "property_value": "VIP customer" } ``` - **date** – a date string in `YYYY-MM-DD` format: ```json { "property_id": "p1_birth_date", "property_value": "1985-06-15" } ``` - **integer** – a whole number: ```json { "property_id": "p1_visit_count", "property_value": 42 } ``` - **float** – a decimal number: ```json { "property_id": "p1_average_spend", "property_value": 149.90 } ``` - **enum** – a single-item array containing a PropertyItem object: ```json { "property_id": "p1_favourite_color", "property_value": [ { "id": "86e05affc7a7abefcd513ab400", "name": "Blue", "resource_record_id": null, "state": 1 } ] } ``` - **multiselect** – a multi-item array of PropertyItem objects: ```json { "property_id": "p1_favourite_color", "property_value": [ { "id": "86e05affc7a7abefcd513ab400", "name": "Blue", "resource_record_id": null, "state": 1 }, { "id": "81eaeea13b8984a169c490a325", "name": "Green", "resource_record_id": null, "state": 1 } ] } ``` - **custom data type** – the format depends on the specific data type configuration. For example, a serialized JSON object: ```json { "property_id": "p1_address", "property_value": "{\"street\":\"Main St\",\"city\":\"Prague\"}" } ```
      - string
      - number
      - integer
      - boolean
      - unknown[]
        - unknown
      - object
    - `last_change` string — Date and time of the last change. *(YYYY-MM-DD HH:MM:SS)*
  - `assignees` TaskAssignee[] — List of a task assignees
    - `task_assignee_id` string — The unique ID of the task assignee.
    - `user_id` string, required — The unique ID of the assigned user. [GET /users](https://carecloud.readme.io/reference/getusers)
    - `name` string — Name of the assigned user.
    - `last_change` string — Date and time of the last comment change. *(YYYY-MM-DD HH:MM:SS)*

## Response `201`

Created

- object
  - `data` object
    - `task_id` string — The unique ID of the task in CareCloud

## Other responses

- `400` — Bad input parameter. The response body's `error.error_data.invalid_params[]` array lists the parameters that caused the failure, each carrying a `reason` code. See the `BadRequestErrorBody` schema for the generic reason taxonomy. Operations with domain-specific business rules document additional reasons at the operation level.
- `401` — The client has invalid credentials or auth token.
- `403` — The client does not exist or the client tried to access an unauthorized property or resource.
- `404` — The resource was not found.
- `405` — The resource does not support the specified HTTP method.
- `429` — Too many requests - more than the resource limit.
- `500` — Server is not working as expected.
- `503` — Temporary state when the service is temporarily unavailable, overloaded or there is a maintenance window.

---

[API](https://skmtc.net/crmcarecloud/apis/rest-api-reference.md) · [All operations](https://skmtc.net/crmcarecloud/apis/rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crmcarecloud/rest-api-reference/versions/329c06dbf8d9/schema)
