---
title: "Create task"
method: POST
path: "/api/v1/tasks"
tags: ["tasks"]
---

# Create task

`POST /api/v1/tasks`

## Request

- Base URL: `https://demo.invoiceninja.com`
- URL: `https://demo.invoiceninja.com/api/v1/tasks`
- Auth: none declared. Required headers: `X-API-TOKEN`, `X-Requested-With`
- TypeScript: <https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/docs/api/v1/tasks/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds an task to a company

## Query parameters

- `include` string

## Headers

- `X-API-TOKEN` string, required
- `X-Requested-With` string, required

## Request body

- TaskRequest
  - `description` string, required: Task description
  - `client_id` string: The hashed ID of the client
  - `project_id` string: The hashed ID of the project
  - `time_log` string: Time logged for the task
  - `status_id` integer: Status ID of the task
  - `custom_value1` string: Custom field value 1
  - `custom_value2` string: Custom field value 2
  - `custom_value3` string: Custom field value 3
  - `custom_value4` string: Custom field value 4
  - `is_deleted` boolean: Whether the task is deleted
  - `archived_at` integer: Timestamp when task was archived
  - `due_date` string, date: Due date for the task
  - `priority` integer: Priority level of the task
  - `tags` string[]: Full sync array of hashed tag IDs. Omit to leave existing tags unchanged; send [] to detach all tags.

## Response `200`

Returns the saved task object

- Task
  - `id` string: The hashed id of the task
  - `user_id` string: The hashed id of the user who created the task
  - `assigned_user_id` string: The assigned user of the task
  - `client_id` string: The hashed if of the client
  - `invoice_id` string: The hashed id of the invoice associated with the task
  - `project_id` string: The hashed id of the project associated with the task
  - `number` string: The number of the task
  - `time_log` string: An array of unix time stamps defining the start and end times of the task
  - `is_running` boolean: Determines if the task is still running
  - `is_deleted` boolean: Boolean flag determining if the task has been deleted
  - `task_status_id` string: The hashed id of the task status
  - `description` string: The task description
  - `duration` integer: The task duration in seconds
  - `task_status_order` integer: The order of the task
  - `rate` number: The task rate
  - `custom_value1` string: A custom value
  - `custom_value2` string: A custom value
  - `custom_value3` string: A custom value
  - `custom_value4` string: A custom value
  - `is_date_based` boolean: Boolean flag determining if the task is date based
  - `calculated_start_date` string: The calculated start date of the task
  - `invoice_documents` boolean: Boolean flags which determines whether to include the task documents on the invoice
  - `created_at` number: Timestamp
  - `updated_at` number: Timestamp
  - `archived_at` number: Timestamp
  - `hash` string: Unique hash identifier for this task
  - `meta` object: Metadata associated with this task
  - `status_id` string: The unique identifier of the task status
  - `status_order` integer: Sort order for status display
  - `status_sort_order` integer: Alternative sort order for status
  - `tags` TagAssignment[]: Tags assigned to the task
    - `id` string, required: The hashed tag id
    - `name` string, required: The tag name
    - `color` string, nullable: The tag color as a hex value, or null when unset

## Other responses

- `401`: Authentication error
- `403`: Authorization error
- `422`: Validation error
- `429`: Rate Limit Exceeded
- `5XX`: Server error
- `default`: Unexpected Error

## Changes

- **2026-05-31** `28befcbfadda`: 1 breaking
  - the response property `tags/items/color` became optional for the status `200`
- **2026-05-31** `edde330209e2`: 2 info
  - added the new optional request property `tags`
  - added the optional property `tags` to the response with the `200` status
- **2026-04-20** `69a36036d334`: 1 info
  - the response optional property `id` became read-only for the status `200`
- **2025-11-22** `00ad5cc89fad`: 5 info
  - added the optional property `hash` to the response with the `200` status
  - added the optional property `meta` to the response with the `200` status
  - added the optional property `status_id` to the response with the `200` status
  - added the optional property `status_order` to the response with the `200` status
  - …1 more
- **2025-10-10** `873a5da14619`: 1 breaking
  - added required request body

[Operation history](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/changes/api/v1/tasks/post.md)

---

[API](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference.md) - [All operations](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/revisions/bcda1f823746?raw)
