---
title: "Regenerate task due dates"
method: POST
path: "/cohorts/{id}/regenerate-due-dates"
tags: ["Cohorts"]
---

# Regenerate task due dates

`POST /cohorts/{id}/regenerate-due-dates`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/cohorts/{id}/regenerate-due-dates`
- Auth: HTTP bearer

Recalculate task due dates after cohort date changes.
Only updates tasks where:
- Task has a template reference
- Task due_date_manually_set = false (not manually edited by user)
- Task status is not 'complete' or 'cancelled'

Manually edited due dates are preserved.

## Path parameters

- `id` string, uuid, required

## Response `200`

Due dates regenerated successfully

- object
  - `success` boolean
  - `data` object
    - `updated_count` integer: Number of tasks that had their due dates updated
    - `eligible_count` integer: Total number of tasks eligible for regeneration
    - `skipped_manual_count` integer: Number of tasks skipped because due date was manually set
  - `message` string

## Other responses

- `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)
