createTask

abstract suspend fun createTask(text: String, categoryId: String, additionalDescription: String? = null, position: Int? = 0): RainbowResult<Task>

Creates a new Task associated with a specified category.

This function creates a task for the connected user, associated with the given categoryId. If successful, the newly created Task is returned via a RainbowResult. The tasks property will also be updated to reflect the addition automatically.

If the device is offline when the task is created, the task will be stored locally and synchronized automatically once a network connection is re-established.

If you need to create a task based on an existing message, see createTaskFromMessage.

Return

A RainbowResult containing the created Task on success, or a com.ale.infra.rest.listeners.Failure on error.

Parameters

text

The main content of the task. Must not be null or empty.

categoryId

The ID of the category to associate with the task. Must not be null or empty.

additionalDescription

Optional additional description to provide more context about the task.

position

Optional position of the task within its category. Defaults to 0.