---
title: "Create a new task"
method: POST
path: "/cohorts/{cohortId}/tasks"
tags: ["Tasks"]
---

# Create a new task

`POST /cohorts/{cohortId}/tasks`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/cohorts/{cohortId}/tasks`
- Auth: HTTP bearer

Create a new task for a cohort

## Path parameters

- `cohortId` string, uuid, required

## Request body

- CreateTaskRequest
  - `title` string, required: Task title
  - `description` string: Detailed task description
  - `assignee_id` string, uuid: Assigned user ID
  - `parent_task_id` string, uuid: Parent task ID for subtasks
  - `session_id` string, uuid: Session this task is linked to
  - `job_title_id` string, uuid: Job title for assignment
  - `status` 'not_started' | 'in_progress' | 'complete' | 'blocked' | 'cancelled'
  - `priority` 'low' | 'medium' | 'high' | 'urgent'
  - `phase` 'cohort_setup' | 'cohort_prep' | 'live_delivery' | 'wrap_renewal'
  - `due_date` string, date
  - `due_time` string

## Response `201`

Task created successfully

- object
  - `success` boolean
  - `data` TaskWithDetails
    - `id` string, uuid: Unique identifier
    - `task_group_id` string, uuid, nullable: Task group this task belongs to
    - `cohort_id` string, uuid: Cohort this task belongs to
    - `parent_task_id` string, uuid, nullable: Parent task ID for subtasks
    - `session_id` string, uuid, nullable: Session this task is linked to
    - `job_title_id` string, uuid, nullable: Job title for assignment resolution
    - `title` string: Task title
    - `description` string, nullable: Detailed task description
    - `assignee_id` string, uuid, nullable: Assigned user ID
    - `status` 'not_started' | 'in_progress' | 'complete' | 'blocked' | 'cancelled': Task status
    - `priority` 'low' | 'medium' | 'high' | 'urgent': Task priority
    - `phase` 'cohort_setup' | 'cohort_prep' | 'live_delivery' | 'wrap_renewal', nullable: Task phase
    - `due_date` string, date, nullable: Due date (YYYY-MM-DD)
    - `due_time` string, nullable: Due time (HH:MM)
    - `completed_at` string, date-time, nullable
    - `completed_by` string, uuid, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `assignee_name` string, nullable
    - `assignee_email` string, nullable
    - `job_title_name` string, nullable
    - `session_title` string, nullable
    - `subtask_count` integer
    - `subtasks_completed` integer
    - `comment_count` integer

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `404`: Cohort not found

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
