# POST /api/v2/projects/{project}/tasks

Create a task on a project

- MCP id: projects.tasks.store
- Scope: api:write:kanban
- Permission: kanban::manage_self
- Rate cost: 1 unit, write bucket. A write costs the same whatever `view` you ask for.
- Cache-Control: private, no-store

Creates a kanban task under one of the project's budgets and returns it with a `Location` header pointing at the flat item path.

The project comes from the path, so `project_id` is not accepted in the body, and a task has no `project_id` of its own anyway: `budget_id` is the task's only link to a project, it is settable here and nowhere else, and a budget belonging to a different project is rejected as an unprocessable relationship. The task is always created for the authenticated user: `user_id` is not accepted, so creating a card on a colleague's board is not available through the API even to a holder of `kanban::manage_for_others`. Creating additionally requires `projects::read` for the parent project, plus `budgets::read` and a token satisfying `api:read:budgets` for the budget reference; a token created with `api:write:kanban` alone gets a permanent 422 on `budget_id`. A trashed project answers `404` with no escape.

## Parameters
- project (integer, path): The Project's numeric id. Accepts a soft-deleted record.
- view (string, optional): Which field set to render.
- X-Request-Id (header, optional): A correlation id of your own. It is recorded in our logs next to the server's request id but never returned: the response header always carries the server's id. A value that does not match the pattern is discarded silently, never rejected.
- Idempotency-Key (header, optional): A caller-chosen key that makes this POST safe to retry. Replaying it returns the original response with Idempotency-Replayed: true.

## Request body
- budget_id (integer → Budget.id, required): Budget the task is filed under. This is the task's only link to a project (a task has no `project_id` of its own), and it is settable at create time only; a task cannot be re-budgeted through the API.
- due_date (date (YYYY-MM-DD), required): Day the task is due. Required when creating a task through the API, and clearable afterwards; tasks created in plnnrly may carry `null`.
- minutes (integer ≥ 0, required): Estimated effort, in minutes.
- description (string ≤ 255, required): Short description shown on the kanban card. This is the task's label and the only field `?q=` searches.
- comment (string or null ≤ 255, optional): Optional longer comment on the card, capped at 255 characters.
- status (string, optional): Kanban column the card sits in.
- is_finished (boolean, optional): Whether the task is done. Cross-synced with `status` on every write: setting `status` to finished sets this `true` and any other status sets it `false`, while setting this `false` on a finished task moves `status` back to active. `status` wins when both are sent.
- is_billable (boolean, optional): Whether time logged on this task is billable. Defaults to `true` when a task is created through the API, regardless of the budget's own setting.

Unknown keys are refused with `422` validation-failed, naming the key.

## Response 201
- id (integer, required): Unique identifier.
- budget_id (integer, required): Budget the task is filed under. This is the task's only link to a project (a task has no `project_id` of its own), and it is settable at create time only; a task cannot be re-budgeted through the API.
- user_id (integer or null, required, server-assigned): The employee the task belongs to. Always the authenticated user on create; not writable. Null on a task left unassigned in plnnrly.
- team_id (integer or null, required, server-assigned): Team the task is filed under. Nothing on the API path assigns it, so a task created through the API always carries `null`; plnnrly itself is the only place a team is set. Not writable, and there is no `team` object beside it.
- due_date (date (YYYY-MM-DD) or null, required): Day the task is due. Required when creating a task through the API, and clearable afterwards; tasks created in plnnrly may carry `null`.
- minutes (integer, required): Estimated effort, in minutes.
- description (string ≤ 255, required): Short description shown on the kanban card. This is the task's label and the only field `?q=` searches.
- comment (string or null ≤ 255, required): Optional longer comment on the card, capped at 255 characters.
- is_finished (boolean, required): Whether the task is done. Cross-synced with `status` on every write: setting `status` to finished sets this `true` and any other status sets it `false`, while setting this `false` on a finished task moves `status` back to active. `status` wins when both are sent.
- is_billable (boolean, required): Whether time logged on this task is billable. Defaults to `true` when a task is created through the API, regardless of the budget's own setting.
- status (string, required): Kanban column the card sits in.
- order_column (integer, required, server-assigned): Position on the kanban board, lowest first. Appended to the end of the board on create and changed when someone drags the card in plnnrly. Not writable.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync.
- budget (Ref or BudgetSummary, required): The budget this task is filed under.
- user (Ref or UserSummary or null, required): The employee the task belongs to.
- links (TaskLinks, required)
  - self (url, required): The canonical URI of this record.

## Errors
- 403 forbidden-by-policy | insufficient-permission | insufficient-token-scope: Forbidden.
- 409 idempotency-key-in-flight | idempotency-key-reused: Conflict.
- 415 unsupported-media-type: Unsupported media type.
- 422 unprocessable-relationship | validation-failed: Unprocessable content.
- 400 idempotency-key-required | invalid-cursor | invalid-query-parameter | malformed-request | unsupported-parameter: Bad request.
- 401 token-expired | unauthenticated: Unauthenticated.
- 404 endpoint-not-found | resource-not-found: Not found.
- 406 not-acceptable: Not acceptable.
- 429 rate-limit-exceeded: Too many requests.
- 500 internal-error: Server error.
- 503 tenant-unavailable: Service unavailable.

## Example
```bash
curl -X POST \
  'https://<your-url>/api/v2/projects/1/tasks' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <key>' \
  -d '{
    "budget_id": 1,
    "description": "Wire up the SSO callback",
    "due_date": "2026-09-15",
    "minutes": 240
  }'
```
