Create a task
Add a habit, daily, to-do or reward.
POST https://cotlet.dev/api/v1/habitica/tasks
write
Creates the task in your own account and returns its ID. It reaches no one and you can delete it in Habitica, so it does not ask for OK by default. A daily without repeat_days is due every day.
Parameters
| Name | Type | Description |
|---|---|---|
| type string required | string | One of: habit, daily, todo or reward. |
| text string required | string | Task title. |
| notes string | string | Longer notes. |
| difficulty string | string | One of: trivial, easy, medium, hard. |
| repeat_days string[] | string[] | For a daily: the days it is due. One or more of: mo, tu, we, th, fr, sa, su. |
| due string | string | For a to-do: due date, ISO. |
| tags string[] | string[] | Tag names from list_tags. |
Request
curl -X POST https://cotlet.dev/api/v1/habitica/tasks \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"daily","text":"Water the plants","difficulty":"easy","repeat_days":["su"]}' result = client.call("habitica", "create_task", {"type":"daily","text":"Water the plants","difficulty":"easy","repeat_days":["su"]}) const result = await cotlet.call('habitica', 'create_task', {"type":"daily","text":"Water the plants","difficulty":"easy","repeat_days":["su"]}); cotlet call habitica create_task --data '{"type":"daily","text":"Water the plants","difficulty":"easy","repeat_days":["su"]}' Example response
{
"task_id": "9d2a7e44-1c6b-4f58-a0e3-7b8c1d2f3a55",
"type": "daily",
"title": "Water the plants",
"difficulty": "easy",
"repeat_days": [
"su"
]
}