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

# Create a task

`POST /tasks`

## Request

- Base URL: `https://gorest.co.in/public/v3`
- URL: `https://gorest.co.in/public/v3/tasks`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string

## Request body

- TaskCreate
  - `description` string
  - `due_on` string, date, nullable
  - `priority` 'low' | 'medium' | 'high' | 'urgent'
  - `status` 'todo' | 'in_progress' | 'done'
  - `title` string, required: Not blank; spaces at the ends are dropped.
  - `user_id` string, uuid, nullable: A user you can see.

## Response `201`

The new task.

- Task: Every field is present unless `fields[tasks]` asks for fewer. `user` is there only with `include`.
  - `created_at` string, date-time
  - `description` string
  - `due_on` string, date, nullable
  - `id` string, uuid, required
  - `priority` 'low' | 'medium' | 'high' | 'urgent'
  - `read_only` boolean: True for sample data (the seed); it cannot be changed.
  - `status` 'todo' | 'in_progress' | 'done'
  - `title` string
  - `updated_at` string, date-time
  - `user` NullableUser: Every field is present unless `fields[users]` asks for fewer.
    - `created_at` string, date-time
    - `email` string, email
    - `id` string, uuid, required
    - `name` string
    - `read_only` boolean: True for sample data (the seed); it cannot be changed.
    - `status` 'active' | 'inactive'
    - `updated_at` string, date-time
  - `user_id` string, uuid, nullable: Who the task is for; null when nobody.

## Other responses

- `400`: A parameter is wrong, unknown or out of range.
- `401`: No token, or the token is wrong, expired or revoked.
- `403`: The token lacks the scope this operation needs.
- `409`: The change clashes with another row, such as an email you already use.
- `413`: The body is over 64 KiB.
- `415`: The body is not `application/json` (or `application/merge-patch+json` on PATCH).
- `422`: The body has fields that fail their rules (`validation_failed`, with `errors`), or a cap is reached (`cap_reached`).
- `429`: Over the rate limit; wait `Retry-After` seconds.
- `500`: Something failed on the server.

---

[API](https://skmtc.dev/gorest/apis/gorest-api-v3.md) - [All operations](https://skmtc.dev/gorest/apis/gorest-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/gorest/apis/gorest-api-v3/revisions/89aa429755a6?raw)
